use of com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse in project google-cloud-java by GoogleCloudPlatform.
the class VideoIntelligenceServiceClientTest method annotateVideoTest.
@Test
@SuppressWarnings("all")
public void annotateVideoTest() throws Exception {
AnnotateVideoResponse expectedResponse = AnnotateVideoResponse.newBuilder().build();
Operation resultOperation = Operation.newBuilder().setName("annotateVideoTest").setDone(true).setResponse(Any.pack(expectedResponse)).build();
mockVideoIntelligenceService.addResponse(resultOperation);
String inputUri = "inputUri1707300727";
List<Feature> features = new ArrayList<>();
VideoContext videoContext = VideoContext.newBuilder().build();
String outputUri = "outputUri-1273518802";
String locationId = "locationId552319461";
AnnotateVideoResponse actualResponse = client.annotateVideoAsync(inputUri, features, videoContext, outputUri, locationId).get();
Assert.assertEquals(expectedResponse, actualResponse);
List<GeneratedMessageV3> actualRequests = mockVideoIntelligenceService.getRequests();
Assert.assertEquals(1, actualRequests.size());
AnnotateVideoRequest actualRequest = (AnnotateVideoRequest) actualRequests.get(0);
Assert.assertEquals(inputUri, actualRequest.getInputUri());
Assert.assertEquals(features, actualRequest.getFeaturesList());
Assert.assertEquals(videoContext, actualRequest.getVideoContext());
Assert.assertEquals(outputUri, actualRequest.getOutputUri());
Assert.assertEquals(locationId, actualRequest.getLocationId());
}
Aggregations