Search in sources :

Example 56 with Api

use of com.google.api.server.spi.config.Api in project endpoints-java by cloudendpoints.

the class ApiConfigValidatorTest method testApiMethodConfigWithApiMethodNameContainingEndingDot.

@Test
public void testApiMethodConfigWithApiMethodNameContainingEndingDot() throws Exception {
    @Api(name = "testApi", version = "v1", resource = "bar")
    final class Test {

        @ApiMethod(name = "Api.TestMethod.")
        public void test() {
        }
    }
    ApiConfig config = configLoader.loadConfiguration(ServiceContext.create(), Test.class);
    try {
        validator.validate(config);
        fail("Expected InvalidMethodNameException.");
    } catch (InvalidMethodNameException expected) {
    }
}
Also used : ApiConfig(com.google.api.server.spi.config.model.ApiConfig) Api(com.google.api.server.spi.config.Api) Test(org.junit.Test)

Aggregations

Api (com.google.api.server.spi.config.Api)56 Test (org.junit.Test)55 SimpleLevelOverridingApi (com.google.api.server.spi.testing.SimpleLevelOverridingApi)45 ApiConfig (com.google.api.server.spi.config.model.ApiConfig)29 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)27 SimpleLevelOverridingInheritedApi (com.google.api.server.spi.testing.SimpleLevelOverridingInheritedApi)18 JsonNode (com.fasterxml.jackson.databind.JsonNode)16 Named (javax.inject.Named)15 ApiMethodConfig (com.google.api.server.spi.config.model.ApiMethodConfig)8 ApiParameterConfig (com.google.api.server.spi.config.model.ApiParameterConfig)7 DefaultValueSerializer (com.google.api.server.spi.testing.DefaultValueSerializer)4 Collection (java.util.Collection)4 Foo (com.google.api.server.spi.testing.Foo)3 List (java.util.List)3 TypeLoader (com.google.api.server.spi.TypeLoader)2 ApiFrontendLimits (com.google.api.server.spi.config.ApiFrontendLimits)2 Named (com.google.api.server.spi.config.Named)2 ApiKey (com.google.api.server.spi.config.model.ApiKey)2 ApiConfigValidator (com.google.api.server.spi.config.validation.ApiConfigValidator)2 Date (java.util.Date)2