@@ -35,6 +35,8 @@ public class DetectIT {
35
35
private ByteArrayOutputStream bout ;
36
36
private PrintStream out ;
37
37
private Detect app ;
38
+ private static final String PROJECT_ID = System .getenv ("GOOGLE_CLOUD_PROJECT" );
39
+ private static final String BUCKET = PROJECT_ID ;
38
40
39
41
@ Before
40
42
public void setUp () throws IOException {
@@ -65,7 +67,7 @@ public void testFaces() throws Exception {
65
67
@ Test
66
68
public void testFacesGcs () throws Exception {
67
69
// Act
68
- String [] args = {"faces" , "gs://cloud-samples-tests /vision/face_no_surprise.jpg" };
70
+ String [] args = {"faces" , "gs://" + BUCKET + " /vision/face_no_surprise.jpg" };
69
71
Detect .argsHelper (args , out );
70
72
71
73
// Assert
@@ -89,7 +91,7 @@ public void testLabels() throws Exception {
89
91
@ Test
90
92
public void testLabelsGcs () throws Exception {
91
93
// Act
92
- String [] args = {"labels" , "gs://cloud-samples-tests /vision/wakeupcat.jpg" };
94
+ String [] args = {"labels" , "gs://" + BUCKET + " /vision/wakeupcat.jpg" };
93
95
Detect .argsHelper (args , out );
94
96
95
97
// Assert
@@ -111,7 +113,7 @@ public void testLandmarks() throws Exception {
111
113
@ Test
112
114
public void testLandmarksGcs () throws Exception {
113
115
// Act
114
- String [] args = {"landmarks" , "gs://cloud-samples-tests /vision/landmark.jpg" };
116
+ String [] args = {"landmarks" , "gs://" + BUCKET + " /vision/landmark.jpg" };
115
117
Detect .argsHelper (args , out );
116
118
117
119
// Assert
@@ -144,7 +146,7 @@ public void testLogos() throws Exception {
144
146
@ Test
145
147
public void testLogosGcs () throws Exception {
146
148
// Act
147
- String [] args = {"logos" , "gs://cloud-samples-tests /vision/logos.png" };
149
+ String [] args = {"logos" , "gs://" + BUCKET + " /vision/logos.png" };
148
150
Detect .argsHelper (args , out );
149
151
150
152
// Assert
@@ -166,7 +168,7 @@ public void testText() throws Exception {
166
168
@ Test
167
169
public void testTextGcs () throws Exception {
168
170
// Act
169
- String [] args = {"text" , "gs://cloud-samples-tests /vision/text.jpg" };
171
+ String [] args = {"text" , "gs://" + BUCKET + " /vision/text.jpg" };
170
172
Detect .argsHelper (args , out );
171
173
172
174
// Assert
@@ -188,7 +190,7 @@ public void testSafeSearch() throws Exception {
188
190
@ Test
189
191
public void testSafeSearchGcs () throws Exception {
190
192
// Act
191
- String [] args = {"safe-search" , "gs://cloud-samples-tests /vision/wakeupcat.jpg" };
193
+ String [] args = {"safe-search" , "gs://" + BUCKET + " /vision/wakeupcat.jpg" };
192
194
Detect .argsHelper (args , out );
193
195
194
196
// Assert
@@ -213,7 +215,7 @@ public void testProperties() throws Exception {
213
215
@ Test
214
216
public void testPropertiesGcs () throws Exception {
215
217
// Act
216
- String [] args = {"properties" , "gs://cloud-samples-tests /vision/landmark.jpg" };
218
+ String [] args = {"properties" , "gs://" + BUCKET + " /vision/landmark.jpg" };
217
219
Detect .argsHelper (args , out );
218
220
219
221
// Assert
@@ -239,7 +241,7 @@ public void detectWebAnnotations() throws Exception {
239
241
@ Test
240
242
public void detectWebAnnotationsGcs () throws Exception {
241
243
// Act
242
- String [] args = {"web" , "gs://cloud-samples-tests /vision/landmark.jpg" };
244
+ String [] args = {"web" , "gs://" + BUCKET + " /vision/landmark.jpg" };
243
245
Detect .argsHelper (args , out );
244
246
245
247
// Assert
@@ -264,7 +266,7 @@ public void testCropHints() throws Exception {
264
266
@ Test
265
267
public void testCropHintsGcs () throws Exception {
266
268
// Act
267
- String [] args = {"crop" , "gs://cloud-samples-tests /vision/wakeupcat.jpg" };
269
+ String [] args = {"crop" , "gs://" + BUCKET + " /vision/wakeupcat.jpg" };
268
270
Detect .argsHelper (args , out );
269
271
270
272
// Assert
@@ -289,7 +291,7 @@ public void testDocumentText() throws Exception {
289
291
@ Test
290
292
public void testDocumentTextGcs () throws Exception {
291
293
// Act
292
- String [] args = {"fulltext" , "gs://cloud-samples-tests /vision/text.jpg" };
294
+ String [] args = {"fulltext" , "gs://" + BUCKET + " /vision/text.jpg" };
293
295
Detect .argsHelper (args , out );
294
296
295
297
// Assert
0 commit comments