Search in sources :

Example 1 with ReportErrorEventResponse

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());
}
Also used : ReportErrorEventRequest(com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest) ProjectName(com.google.devtools.clouderrorreporting.v1beta1.ProjectName) ReportedErrorEvent(com.google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent) ReportErrorEventResponse(com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventResponse) GeneratedMessageV3(com.google.protobuf.GeneratedMessageV3) Test(org.junit.Test)

Aggregations

ProjectName (com.google.devtools.clouderrorreporting.v1beta1.ProjectName)1 ReportErrorEventRequest (com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest)1 ReportErrorEventResponse (com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventResponse)1 ReportedErrorEvent (com.google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1 Test (org.junit.Test)1