use of com.google.logging.v2.DeleteLogRequest in project google-cloud-java by GoogleCloudPlatform.
the class LoggingClientTest method deleteLogTest.
@Test
@SuppressWarnings("all")
public void deleteLogTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockLoggingServiceV2.addResponse(expectedResponse);
LogNameOneof logName = LogNameOneof.from(LogName.create("[PROJECT]", "[LOG]"));
client.deleteLog(logName);
List<GeneratedMessageV3> actualRequests = mockLoggingServiceV2.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteLogRequest actualRequest = (DeleteLogRequest) actualRequests.get(0);
Assert.assertEquals(logName, actualRequest.getLogNameAsLogNameOneof());
}
use of com.google.logging.v2.DeleteLogRequest 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.logging.v2.DeleteLogRequest 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());
}
use of com.google.logging.v2.DeleteLogRequest in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteLog_Null.
@Test
public void testDeleteLog_Null() {
DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(LOG_NAME_PB).build();
EasyMock.expect(loggingRpcMock.delete(request)).andReturn(ApiFutures.<Empty>immediateFuture(null));
EasyMock.replay(rpcFactoryMock, loggingRpcMock);
logging = options.getService();
assertFalse(logging.deleteLog(LOG_NAME));
}
use of com.google.logging.v2.DeleteLogRequest in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteLogAsync_Null.
@Test
public void testDeleteLogAsync_Null() throws ExecutionException, InterruptedException {
DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(LOG_NAME_PB).build();
EasyMock.expect(loggingRpcMock.delete(request)).andReturn(ApiFutures.<Empty>immediateFuture(null));
EasyMock.replay(rpcFactoryMock, loggingRpcMock);
logging = options.getService();
assertFalse(logging.deleteLogAsync(LOG_NAME).get());
}
Aggregations