use of io.grafeas.v1beta1.BatchCreateNotesRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1ClientTest method batchCreateNotesTest.
@Test
@SuppressWarnings("all")
public void batchCreateNotesTest() {
BatchCreateNotesResponse expectedResponse = BatchCreateNotesResponse.newBuilder().build();
mockGrafeasV1Beta1.addResponse(expectedResponse);
ProjectName parent = ProjectName.of("[PROJECT]");
Map<String, Note> notes = new HashMap<>();
BatchCreateNotesResponse actualResponse = client.batchCreateNotes(parent, notes);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockGrafeasV1Beta1.getRequests();
Assert.assertEquals(1, actualRequests.size());
BatchCreateNotesRequest actualRequest = (BatchCreateNotesRequest) actualRequests.get(0);
Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent()));
Assert.assertEquals(notes, actualRequest.getNotesMap());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations