Search in sources :

Example 1 with Named

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

the class ServletRequestParamReaderTest method testReadEnumCollectionParameters.

@Test
public void testReadEnumCollectionParameters() throws Exception {
    class Test {

        @SuppressWarnings("unused")
        public void collection(@Named("collection") Collection<Outcome> outcomes) {
        }
    }
    Method method = Test.class.getDeclaredMethod("collection", Collection.class);
    doTestReadCollectionEnumParameter("collection", EndpointMethod.create(Test.class, method));
}
Also used : Named(com.google.api.server.spi.config.Named) Test(org.junit.Test) Collection(java.util.Collection) Method(java.lang.reflect.Method) EndpointMethod(com.google.api.server.spi.EndpointMethod) Test(org.junit.Test)

Example 2 with Named

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

the class ServletRequestParamReaderTest method testReadDateArrayParameters.

@Test
public void testReadDateArrayParameters() throws Exception {
    class Test {

        @SuppressWarnings("unused")
        public void array(@Named("array") Date[] dates) {
        }
    }
    Method method = Test.class.getDeclaredMethod("array", Date[].class);
    doTestReadArrayDateParameter("array", EndpointMethod.create(Test.class, method));
}
Also used : Named(com.google.api.server.spi.config.Named) Test(org.junit.Test) Method(java.lang.reflect.Method) EndpointMethod(com.google.api.server.spi.EndpointMethod) Date(java.util.Date) SimpleDate(com.google.api.server.spi.types.SimpleDate) Test(org.junit.Test)

Example 3 with Named

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

the class ServletRequestParamReaderTest method testReadSetParameters.

@Test
public void testReadSetParameters() throws Exception {
    class Test {

        @SuppressWarnings("unused")
        public void collection(@Named("set") Set<Integer> integers) {
        }
    }
    Method method = Test.class.getDeclaredMethod("collection", Set.class);
    doTestSetParameter("set", EndpointMethod.create(Test.class, method));
}
Also used : Named(com.google.api.server.spi.config.Named) Set(java.util.Set) Test(org.junit.Test) Method(java.lang.reflect.Method) EndpointMethod(com.google.api.server.spi.EndpointMethod) Test(org.junit.Test)

Example 4 with Named

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

the class ServletRequestParamReaderTest method testReadArrayParameters.

@Test
public void testReadArrayParameters() throws Exception {
    class Test {

        @SuppressWarnings("unused")
        public void array(@Named("array") Integer[] integers) {
        }
    }
    Method method = Test.class.getDeclaredMethod("array", Integer[].class);
    doTestReadArrayParameter("array", EndpointMethod.create(Test.class, method));
}
Also used : Named(com.google.api.server.spi.config.Named) Test(org.junit.Test) Method(java.lang.reflect.Method) EndpointMethod(com.google.api.server.spi.EndpointMethod) Test(org.junit.Test)

Example 5 with Named

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

the class ServletRequestParamReaderTest method testReadListParameters.

@Test
public void testReadListParameters() throws Exception {
    class Test {

        @SuppressWarnings("unused")
        public void collection(@Named("list") List<Integer> integers) {
        }
    }
    Method method = Test.class.getDeclaredMethod("collection", List.class);
    doTestCollectionParameter("list", EndpointMethod.create(Test.class, method));
}
Also used : Named(com.google.api.server.spi.config.Named) Test(org.junit.Test) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) Method(java.lang.reflect.Method) EndpointMethod(com.google.api.server.spi.EndpointMethod) Test(org.junit.Test)

Aggregations

Named (com.google.api.server.spi.config.Named)15 Test (org.junit.Test)15 EndpointMethod (com.google.api.server.spi.EndpointMethod)13 Method (java.lang.reflect.Method)13 Nullable (com.google.api.server.spi.config.Nullable)5 Collection (java.util.Collection)4 Api (com.google.api.server.spi.config.Api)2 ApiConfig (com.google.api.server.spi.config.model.ApiConfig)2 ApiMethodConfig (com.google.api.server.spi.config.model.ApiMethodConfig)2 SimpleLevelOverridingApi (com.google.api.server.spi.testing.SimpleLevelOverridingApi)2 SimpleLevelOverridingInheritedApi (com.google.api.server.spi.testing.SimpleLevelOverridingInheritedApi)2 ImmutableList (com.google.common.collect.ImmutableList)2 List (java.util.List)2 DefaultValue (com.google.api.server.spi.config.DefaultValue)1 ApiParameterConfig (com.google.api.server.spi.config.model.ApiParameterConfig)1 Request (com.google.api.server.spi.testing.TestEndpoint.Request)1 SimpleDate (com.google.api.server.spi.types.SimpleDate)1 Date (java.util.Date)1 Set (java.util.Set)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1