use of io.grafeas.v1beta1.CreateNoteRequest in project java-containeranalysis by googleapis.
the class GrafeasV1Beta1ClientTest method createNoteTest.
@Test
@SuppressWarnings("all")
public void createNoteTest() {
String name = "name3373707";
String shortDescription = "shortDescription-235369287";
String longDescription = "longDescription-1747792199";
Note expectedResponse = Note.newBuilder().setName(name).setShortDescription(shortDescription).setLongDescription(longDescription).build();
mockGrafeasV1Beta1.addResponse(expectedResponse);
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "noteId2129224840";
Note note = Note.newBuilder().build();
Note actualResponse = client.createNote(parent, noteId, note);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockGrafeasV1Beta1.getRequests();
Assert.assertEquals(1, actualRequests.size());
CreateNoteRequest actualRequest = (CreateNoteRequest) actualRequests.get(0);
Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent()));
Assert.assertEquals(noteId, actualRequest.getNoteId());
Assert.assertEquals(note, actualRequest.getNote());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations