use of com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventResponse in project google-cloud-java by GoogleCloudPlatform.
the class ReportErrorsServiceClientTest method reportErrorEventTest.
@Test
@SuppressWarnings("all")
public void reportErrorEventTest() {
ReportErrorEventResponse expectedResponse = ReportErrorEventResponse.newBuilder().build();
mockReportErrorsService.addResponse(expectedResponse);
ProjectName projectName = ProjectName.create("[PROJECT]");
ReportedErrorEvent event = ReportedErrorEvent.newBuilder().build();
ReportErrorEventResponse actualResponse = client.reportErrorEvent(projectName, event);
Assert.assertEquals(expectedResponse, actualResponse);
List<GeneratedMessageV3> actualRequests = mockReportErrorsService.getRequests();
Assert.assertEquals(1, actualRequests.size());
ReportErrorEventRequest actualRequest = (ReportErrorEventRequest) actualRequests.get(0);
Assert.assertEquals(projectName, actualRequest.getProjectNameAsProjectName());
Assert.assertEquals(event, actualRequest.getEvent());
}
Aggregations