38
38
@ RunWith (JUnit4 .class )
39
39
@ SuppressWarnings ("checkstyle:abbreviationaswordinname" )
40
40
public class AnalyzeIT {
41
+ private static final String PROJECT_ID = System .getenv ("GOOGLE_CLOUD_PROJECT" );
42
+ private static final String BUCKET = PROJECT_ID ;
41
43
42
44
private Analyze analyzeApp ;
43
45
@@ -62,7 +64,7 @@ public class AnalyzeIT {
62
64
@ Test public void analyzeEntities_withEntitiesFile_containsGod () throws Exception {
63
65
// Act
64
66
List <Entity > entities =
65
- analyzeApp .analyzeEntitiesFile ("gs://cloud-samples-tests /natural-language/gettysburg.txt" );
67
+ analyzeApp .analyzeEntitiesFile ("gs://" + BUCKET + " /natural-language/gettysburg.txt" );
66
68
List <String > got = entities .stream ().map (e -> e .getName ()).collect (Collectors .toList ());
67
69
68
70
// Assert
@@ -83,7 +85,7 @@ public class AnalyzeIT {
83
85
@ Test public void analyzeSentimentFile_returnPositiveFile () throws Exception {
84
86
// Act
85
87
Sentiment sentiment =
86
- analyzeApp .analyzeSentimentFile ("gs://cloud-samples-tests /natural-language/"
88
+ analyzeApp .analyzeSentimentFile ("gs://" + BUCKET + " /natural-language/"
87
89
+ "sentiment/bladerunner-pos.txt" );
88
90
89
91
// Assert
@@ -105,7 +107,7 @@ public class AnalyzeIT {
105
107
@ Test public void analyzeSentiment_returnNegativeFile () throws Exception {
106
108
// Act
107
109
Sentiment sentiment =
108
- analyzeApp .analyzeSentimentFile ("gs://cloud-samples-tests /natural-language/"
110
+ analyzeApp .analyzeSentimentFile ("gs://" + BUCKET + " /natural-language/"
109
111
+ "sentiment/bladerunner-neg.txt" );
110
112
111
113
// Assert
@@ -116,7 +118,7 @@ public class AnalyzeIT {
116
118
@ Test public void analyzeSentiment_returnNeutralFile () throws Exception {
117
119
// Act
118
120
Sentiment sentiment =
119
- analyzeApp .analyzeSentimentFile ("gs://cloud-samples-tests /natural-language/"
121
+ analyzeApp .analyzeSentimentFile ("gs://" + BUCKET + " /natural-language/"
120
122
+ "sentiment/bladerunner-neutral.txt" );
121
123
122
124
// Assert
@@ -141,7 +143,7 @@ public class AnalyzeIT {
141
143
@ Test public void analyzeSyntax_partOfSpeechFile () throws Exception {
142
144
// Act
143
145
List <Token > token =
144
- analyzeApp .analyzeSyntaxFile ("gs://cloud-samples-tests /natural-language/"
146
+ analyzeApp .analyzeSyntaxFile ("gs://" + BUCKET + " /natural-language/"
145
147
+ "sentiment/bladerunner-neutral.txt" );
146
148
147
149
List <Tag > got = token .stream ().map (e -> e .getPartOfSpeech ().getTag ())
0 commit comments