Search in sources :

Example 11 with NotFoundException

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
    }
}
Also used : NotFoundException(com.google.api.server.spi.response.NotFoundException) Test(org.junit.Test)

Example 12 with NotFoundException

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
    }
}
Also used : NotFoundException(com.google.api.server.spi.response.NotFoundException) Test(org.junit.Test)

Example 13 with NotFoundException

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
    }
}
Also used : NotFoundException(com.google.api.server.spi.response.NotFoundException) Test(org.junit.Test)

Aggregations

NotFoundException (com.google.api.server.spi.response.NotFoundException)13 ApiMethod (com.google.api.server.spi.config.ApiMethod)7 BadRequestException (com.google.api.server.spi.response.BadRequestException)5 Test (org.junit.Test)4 Gson (com.google.gson.Gson)3 ApiKey (com.google.api.server.spi.config.model.ApiKey)2 Queue (com.google.appengine.api.taskqueue.Queue)2 CryptonomicaUser (net.cryptonomica.entities.CryptonomicaUser)2 Verification (net.cryptonomica.entities.Verification)2 VerificationGeneralView (net.cryptonomica.returns.VerificationGeneralView)2 ApiConfig (com.google.api.server.spi.config.model.ApiConfig)1 UnauthorizedException (com.google.api.server.spi.response.UnauthorizedException)1 RestDescription (com.google.api.services.discovery.model.RestDescription)1 GsonBuilder (com.google.gson.GsonBuilder)1 Device (com.google.samples.apps.iosched.server.gcm.db.models.Device)1 MessageSender (com.google.samples.apps.iosched.server.gcm.device.MessageSender)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 BooleanWrapperObject (net.cryptonomica.returns.BooleanWrapperObject)1 OnlineVerificationView (net.cryptonomica.returns.OnlineVerificationView)1