use of com.google.api.server.spi.response.InternalServerErrorException in project endpoints-java by cloudendpoints.
the class CachingDiscoveryProviderTest method getRpcDocument_internalServerError.
@Test
public void getRpcDocument_internalServerError() throws Exception {
CachingDiscoveryProvider provider = createNonExpiringProvider();
when(delegate.getRpcDocument(ROOT, NAME, VERSION)).thenThrow(new InternalServerErrorException(""));
try {
provider.getRpcDocument(ROOT, NAME, VERSION);
fail("expected InternalServerErrorException");
} catch (InternalServerErrorException e) {
// expected
}
}
use of com.google.api.server.spi.response.InternalServerErrorException in project endpoints-java by cloudendpoints.
the class ProxyingDiscoveryServiceTest method getApiList_internalServerError.
@Test
public void getApiList_internalServerError() throws Exception {
ProxyingDiscoveryService discoveryService = createDiscoveryService(true);
when(provider.getDirectory(SERVER_ROOT)).thenThrow(new InternalServerErrorException(""));
try {
discoveryService.getApiList(createRequest("discovery/v1/apis"));
fail("expected InternalServerErrorException");
} catch (InternalServerErrorException e) {
// expected
}
}
Aggregations