Search in sources :

Example 1 with GetTraceRequest

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());
}
Also used : Trace(com.google.devtools.cloudtrace.v1.Trace) GetTraceRequest(com.google.devtools.cloudtrace.v1.GetTraceRequest) GeneratedMessageV3(com.google.protobuf.GeneratedMessageV3) Test(org.junit.Test)

Aggregations

GetTraceRequest (com.google.devtools.cloudtrace.v1.GetTraceRequest)1 Trace (com.google.devtools.cloudtrace.v1.Trace)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1 Test (org.junit.Test)1