Search in sources :

Example 1 with BatchCreateNotesRequest

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()));
}
Also used : BatchCreateNotesRequest(io.grafeas.v1beta1.BatchCreateNotesRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ProjectName(com.google.containeranalysis.v1beta1.ProjectName) HashMap(java.util.HashMap) Note(io.grafeas.v1beta1.Note) BatchCreateNotesResponse(io.grafeas.v1beta1.BatchCreateNotesResponse) Test(org.junit.Test)

Aggregations

ProjectName (com.google.containeranalysis.v1beta1.ProjectName)1 AbstractMessage (com.google.protobuf.AbstractMessage)1 BatchCreateNotesRequest (io.grafeas.v1beta1.BatchCreateNotesRequest)1 BatchCreateNotesResponse (io.grafeas.v1beta1.BatchCreateNotesResponse)1 Note (io.grafeas.v1beta1.Note)1 HashMap (java.util.HashMap)1 Test (org.junit.Test)1