use of com.google.api.server.spi.ServiceContext in project endpoints-java by cloudendpoints.
the class RestServletRequestParamReaderTest method setUp.
@Before
public void setUp() throws Exception {
endpointMethod = EndpointMethod.create(TestApi.class, TestApi.class.getMethod("test", Long.TYPE, List.class, SimpleDate.class, TestResource.class));
request = new MockHttpServletRequest();
ServiceContext serviceContext = ServiceContext.create();
serializationConfig = new ApiSerializationConfig();
TypeLoader typeLoader = new TypeLoader();
apiConfig = new ApiConfig.Factory().create(serviceContext, typeLoader, TestApi.class);
ApiConfigAnnotationReader annotationReader = new ApiConfigAnnotationReader();
annotationReader.loadEndpointClass(serviceContext, TestApi.class, apiConfig);
annotationReader.loadEndpointMethods(serviceContext, TestApi.class, apiConfig.getApiClassConfig().getMethods());
methodConfig = apiConfig.getApiClassConfig().getMethods().get(endpointMethod);
}
use of com.google.api.server.spi.ServiceContext in project endpoints-java by cloudendpoints.
the class TypesTest method setUp.
@Before
public void setUp() throws Exception {
ServiceContext serviceContext = ServiceContext.create();
TypeLoader typeLoader = new TypeLoader();
apiConfig = new ApiConfig.Factory().create(serviceContext, typeLoader, TestEndpoint.class);
apiConfig.getSerializationConfig().addSerializationConfig(IntegerToStringSerializer.class);
apiConfig.getSerializationConfig().addSerializationConfig(LongToStringSerializer.class);
apiConfig.getSerializationConfig().addSerializationConfig(FloatToStringSerializer.class);
}
Aggregations