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