26
26
import org .junit .runner .RunWith ;
27
27
import org .junit .runners .JUnit4 ;
28
28
29
- /** Integration (system) tests for {@link ProductSearch}. */
29
+ /**
30
+ * Integration (system) tests for {@link ProductSearch}.Tests rely on pre-created product set
31
+ * that has been indexed.
32
+ **/
30
33
@ RunWith (JUnit4 .class )
31
34
@ SuppressWarnings ("checkstyle:abbreviationaswordinname" )
32
35
public class ProductSearchIT {
33
36
private static final String PROJECT_ID = System .getenv ("GOOGLE_CLOUD_PROJECT" );
34
37
private static final String COMPUTE_REGION = "us-west1" ;
35
- private static final String GCS_URI =
36
- "gs://java-docs-samples-testing/product-search/indexed_product_sets.csv" ;
37
38
private static final String PRODUCT_SET_ID = "indexed_product_set_id_for_testing" ;
38
39
private static final String PRODUCT_CATEGORY = "apparel" ;
39
40
private static final String PRODUCT_ID_1 = "indexed_product_id_for_testing_1" ;
40
41
private static final String PRODUCT_ID_2 = "indexed_product_id_for_testing_2" ;
41
42
private static final String IMAGE_URI_1 =
42
- "gs://java-docs- samples-testing/product-search /shoes_1.jpg" ;
43
+ "gs://cloud- samples-data/vision/product_search /shoes_1.jpg" ;
43
44
private static final String FILE_PATH_1 = "./resources/shoes_1.jpg" ;
44
45
private static final String FILTER = "style=womens" ;
45
46
private ByteArrayOutputStream bout ;
@@ -51,15 +52,11 @@ public void setUp() throws Exception {
51
52
bout = new ByteArrayOutputStream ();
52
53
out = new PrintStream (bout );
53
54
System .setOut (out );
54
- ImportProductSets .importProductSets (PROJECT_ID , COMPUTE_REGION , GCS_URI );
55
55
bout .reset ();
56
56
}
57
57
58
58
@ After
59
59
public void tearDown () throws Exception {
60
- ProductManagement .deleteProduct (PROJECT_ID ,COMPUTE_REGION ,PRODUCT_ID_1 );
61
- ProductManagement .deleteProduct (PROJECT_ID ,COMPUTE_REGION ,PRODUCT_ID_2 );
62
- ProductSetManagement .deleteProductSet (PROJECT_ID , COMPUTE_REGION , PRODUCT_SET_ID );
63
60
System .setOut (null );
64
61
}
65
62
0 commit comments