use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteSink.
@Test
public void testDeleteSink() {
DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).build();
ApiFuture<Empty> response = ApiFutures.immediateFuture(Empty.getDefaultInstance());
EasyMock.expect(loggingRpcMock.delete(request)).andReturn(response);
EasyMock.replay(rpcFactoryMock, loggingRpcMock);
logging = options.getService();
assertTrue(logging.deleteSink(SINK_NAME));
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class TraceServiceClientTest method patchTracesTest.
@Test
@SuppressWarnings("all")
public void patchTracesTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockTraceService.addResponse(expectedResponse);
String projectId = "projectId-1969970175";
Traces traces = Traces.newBuilder().build();
client.patchTraces(projectId, traces);
List<GeneratedMessageV3> actualRequests = mockTraceService.getRequests();
Assert.assertEquals(1, actualRequests.size());
PatchTracesRequest actualRequest = (PatchTracesRequest) actualRequests.get(0);
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(traces, actualRequest.getTraces());
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class GroupServiceClientTest method deleteGroupTest.
@Test
@SuppressWarnings("all")
public void deleteGroupTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockGroupService.addResponse(expectedResponse);
GroupName name = GroupName.create("[PROJECT]", "[GROUP]");
client.deleteGroup(name);
List<GeneratedMessageV3> actualRequests = mockGroupService.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteGroupRequest actualRequest = (DeleteGroupRequest) actualRequests.get(0);
Assert.assertEquals(name, actualRequest.getNameAsGroupName());
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteSink_Null.
@Test
public void testDeleteSink_Null() {
DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).build();
ApiFuture<Empty> response = ApiFutures.immediateFuture(null);
EasyMock.expect(loggingRpcMock.delete(request)).andReturn(response);
EasyMock.replay(rpcFactoryMock, loggingRpcMock);
logging = options.getService();
assertFalse(logging.deleteSink(SINK_NAME));
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteSinkAsync.
@Test
public void testDeleteSinkAsync() throws ExecutionException, InterruptedException {
DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).build();
ApiFuture<Empty> response = ApiFutures.immediateFuture(Empty.getDefaultInstance());
EasyMock.expect(loggingRpcMock.delete(request)).andReturn(response);
EasyMock.replay(rpcFactoryMock, loggingRpcMock);
logging = options.getService();
assertTrue(logging.deleteSinkAsync(SINK_NAME).get());
}
Aggregations