use of com.google.api.server.spi.config.model.ApiParameterConfig in project endpoints-java by cloudendpoints.
the class ApiConfigAnnotationReaderTest method testGenericParameterTypes.
@Test
public void testGenericParameterTypes() throws Exception {
@Api
final class Test<T> {
@SuppressWarnings("unused")
public void setT(T t) {
}
}
ApiConfig config = createConfig(Test.class);
annotationReader.loadEndpointMethods(serviceContext, Test.class, config.getApiClassConfig().getMethods());
ApiParameterConfig parameter = config.getApiClassConfig().getMethods().get(methodToEndpointMethod(Test.class.getDeclaredMethod("setT", Object.class))).getParameterConfigs().get(0);
assertEquals(ApiParameterConfig.Classification.UNKNOWN, parameter.getClassification());
}
use of com.google.api.server.spi.config.model.ApiParameterConfig in project endpoints-java by cloudendpoints.
the class ApiConfigAnnotationReaderTest method testParameterAnnotations_none.
@Test
public void testParameterAnnotations_none() throws Exception {
@Api
class Endpoint {
@SuppressWarnings("unused")
public void method(int foo) {
}
}
ApiConfig config = createConfig(Endpoint.class);
annotationReader.loadEndpointClass(serviceContext, Endpoint.class, config);
annotationReader.loadEndpointMethods(serviceContext, Endpoint.class, config.getApiClassConfig().getMethods());
ApiMethodConfig methodConfig = Iterables.getOnlyElement(config.getApiClassConfig().getMethods().values());
ApiParameterConfig parameterConfig = Iterables.getOnlyElement(methodConfig.getParameterConfigs());
validateParameter(parameterConfig, null, false, null, int.class, null, int.class);
}
Aggregations