3838@ RunWith (JUnit4 .class )
3939@ SuppressWarnings ("checkstyle:abbreviationaswordinname" )
4040public class AnalyzeIT {
41+ private static final String PROJECT_ID = System .getenv ("GOOGLE_CLOUD_PROJECT" );
42+ private static final String BUCKET = PROJECT_ID ;
4143
4244 private Analyze analyzeApp ;
4345
@@ -62,7 +64,7 @@ public class AnalyzeIT {
6264 @ Test public void analyzeEntities_withEntitiesFile_containsGod () throws Exception {
6365 // Act
6466 List <Entity > entities =
65- analyzeApp .analyzeEntitiesFile ("gs://cloud-samples-tests /natural-language/gettysburg.txt" );
67+ analyzeApp .analyzeEntitiesFile ("gs://" + BUCKET + " /natural-language/gettysburg.txt" );
6668 List <String > got = entities .stream ().map (e -> e .getName ()).collect (Collectors .toList ());
6769
6870 // Assert
@@ -83,7 +85,7 @@ public class AnalyzeIT {
8385 @ Test public void analyzeSentimentFile_returnPositiveFile () throws Exception {
8486 // Act
8587 Sentiment sentiment =
86- analyzeApp .analyzeSentimentFile ("gs://cloud-samples-tests /natural-language/"
88+ analyzeApp .analyzeSentimentFile ("gs://" + BUCKET + " /natural-language/"
8789 + "sentiment/bladerunner-pos.txt" );
8890
8991 // Assert
@@ -105,7 +107,7 @@ public class AnalyzeIT {
105107 @ Test public void analyzeSentiment_returnNegativeFile () throws Exception {
106108 // Act
107109 Sentiment sentiment =
108- analyzeApp .analyzeSentimentFile ("gs://cloud-samples-tests /natural-language/"
110+ analyzeApp .analyzeSentimentFile ("gs://" + BUCKET + " /natural-language/"
109111 + "sentiment/bladerunner-neg.txt" );
110112
111113 // Assert
@@ -116,7 +118,7 @@ public class AnalyzeIT {
116118 @ Test public void analyzeSentiment_returnNeutralFile () throws Exception {
117119 // Act
118120 Sentiment sentiment =
119- analyzeApp .analyzeSentimentFile ("gs://cloud-samples-tests /natural-language/"
121+ analyzeApp .analyzeSentimentFile ("gs://" + BUCKET + " /natural-language/"
120122 + "sentiment/bladerunner-neutral.txt" );
121123
122124 // Assert
@@ -141,7 +143,7 @@ public class AnalyzeIT {
141143 @ Test public void analyzeSyntax_partOfSpeechFile () throws Exception {
142144 // Act
143145 List <Token > token =
144- analyzeApp .analyzeSyntaxFile ("gs://cloud-samples-tests /natural-language/"
146+ analyzeApp .analyzeSyntaxFile ("gs://" + BUCKET + " /natural-language/"
145147 + "sentiment/bladerunner-neutral.txt" );
146148
147149 List <Tag > got = token .stream ().map (e -> e .getPartOfSpeech ().getTag ())
0 commit comments