use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteMetricAsync_Null.
@Test
public void testDeleteMetricAsync_Null() throws ExecutionException, InterruptedException {
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.deleteMetricAsync(METRIC_NAME).get());
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class LoggingImplTest method testDeleteMetricAsync.
@Test
public void testDeleteMetricAsync() throws ExecutionException, InterruptedException {
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.deleteMetricAsync(METRIC_NAME).get());
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class SubscriptionAdminClientTest method modifyPushConfigTest.
@Test
@SuppressWarnings("all")
public void modifyPushConfigTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockSubscriber.addResponse(expectedResponse);
SubscriptionName subscription = SubscriptionName.create("[PROJECT]", "[SUBSCRIPTION]");
PushConfig pushConfig = PushConfig.newBuilder().build();
client.modifyPushConfig(subscription, pushConfig);
List<GeneratedMessageV3> actualRequests = mockSubscriber.getRequests();
Assert.assertEquals(1, actualRequests.size());
ModifyPushConfigRequest actualRequest = (ModifyPushConfigRequest) actualRequests.get(0);
Assert.assertEquals(subscription, actualRequest.getSubscriptionAsSubscriptionName());
Assert.assertEquals(pushConfig, actualRequest.getPushConfig());
}
use of com.google.protobuf.Empty in project google-cloud-java by GoogleCloudPlatform.
the class TopicAdminClientTest method deleteTopicTest.
@Test
@SuppressWarnings("all")
public void deleteTopicTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockPublisher.addResponse(expectedResponse);
TopicName topic = TopicName.create("[PROJECT]", "[TOPIC]");
client.deleteTopic(topic);
List<GeneratedMessageV3> actualRequests = mockPublisher.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteTopicRequest actualRequest = (DeleteTopicRequest) actualRequests.get(0);
Assert.assertEquals(topic, actualRequest.getTopicAsTopicName());
}
Aggregations