use of com.google.protobuf.Empty 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.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteMetric.
@Test
public void testDeleteMetric() {
DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder().setMetricName(METRIC_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.deleteMetric(METRIC_NAME));
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteMetric_Null.
@Test
public void testDeleteMetric_Null() {
DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder().setMetricName(METRIC_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.deleteMetric(METRIC_NAME));
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteLog.
@Test
public void testDeleteLog() {
DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(LOG_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.deleteLog(LOG_NAME));
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteLogAync.
@Test
public void testDeleteLogAync() throws ExecutionException, InterruptedException {
DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(LOG_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.deleteLogAsync(LOG_NAME).get());
}
Aggregations