use of com.google.pubsub.v1.ProjectName in project google-cloud-java by GoogleCloudPlatform.
the class SubscriptionAdminClientTest method listSubscriptionsExceptionTest.
@Test
@SuppressWarnings("all")
public void listSubscriptionsExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockSubscriber.addException(exception);
try {
ProjectName project = ProjectName.create("[PROJECT]");
client.listSubscriptions(project);
Assert.fail("No exception raised");
} catch (ApiException e) {
Assert.assertEquals(Status.INVALID_ARGUMENT.getCode(), e.getStatusCode());
}
}
Aggregations