use of com.google.api.server.spi.config.DefaultValue in project endpoints-java by cloudendpoints.
the class ApiConfigAnnotationReaderTest method testParameterAnnotations.
@Test
public void testParameterAnnotations() throws Exception {
@Api
class Endpoint {
@SuppressWarnings("unused")
public void method(@Named("foo") @Nullable @DefaultValue("4") 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, "foo", true, "4", int.class, null, int.class);
}
Aggregations