use of com.google.devtools.cloudtrace.v1.GetTraceRequest in project google-cloud-java by GoogleCloudPlatform.
the class TraceServiceClientTest method getTraceTest.
@Test
@SuppressWarnings("all")
public void getTraceTest() {
String projectId2 = "projectId2939242356";
String traceId2 = "traceId2987826376";
Trace expectedResponse = Trace.newBuilder().setProjectId(projectId2).setTraceId(traceId2).build();
mockTraceService.addResponse(expectedResponse);
String projectId = "projectId-1969970175";
String traceId = "traceId1270300245";
Trace actualResponse = client.getTrace(projectId, traceId);
Assert.assertEquals(expectedResponse, actualResponse);
List<GeneratedMessageV3> actualRequests = mockTraceService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetTraceRequest actualRequest = (GetTraceRequest) actualRequests.get(0);
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(traceId, actualRequest.getTraceId());
}
Aggregations