use of com.google.cloud.vision.v1.BatchAnnotateImagesRequest in project google-cloud-java by GoogleCloudPlatform.
the class ImageAnnotatorClientTest method batchAnnotateImagesTest.
@Test
@SuppressWarnings("all")
public void batchAnnotateImagesTest() {
BatchAnnotateImagesResponse expectedResponse = BatchAnnotateImagesResponse.newBuilder().build();
mockImageAnnotator.addResponse(expectedResponse);
List<AnnotateImageRequest> requests = new ArrayList<>();
BatchAnnotateImagesResponse actualResponse = client.batchAnnotateImages(requests);
Assert.assertEquals(expectedResponse, actualResponse);
List<GeneratedMessageV3> actualRequests = mockImageAnnotator.getRequests();
Assert.assertEquals(1, actualRequests.size());
BatchAnnotateImagesRequest actualRequest = (BatchAnnotateImagesRequest) actualRequests.get(0);
Assert.assertEquals(requests, actualRequest.getRequestsList());
}
Aggregations