use of com.google.logging.v2.DeleteSinkRequest in project google-cloud-java by GoogleCloudPlatform.
the class ConfigClientTest method deleteSinkTest.
@Test
@SuppressWarnings("all")
public void deleteSinkTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockConfigServiceV2.addResponse(expectedResponse);
SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
client.deleteSink(sinkName);
List<GeneratedMessageV3> actualRequests = mockConfigServiceV2.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteSinkRequest actualRequest = (DeleteSinkRequest) actualRequests.get(0);
Assert.assertEquals(sinkName, actualRequest.getSinkNameAsSinkNameOneof());
}
use of com.google.logging.v2.DeleteSinkRequest in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteSinkAsync_Null.
@Test
public void testDeleteSinkAsync_Null() throws ExecutionException, InterruptedException {
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.deleteSinkAsync(SINK_NAME).get());
}
use of com.google.logging.v2.DeleteSinkRequest 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.logging.v2.DeleteSinkRequest 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.logging.v2.DeleteSinkRequest 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