Search in sources :

Example 6 with SwaggerContext

use of com.google.api.server.spi.swagger.SwaggerGenerator.SwaggerContext in project endpoints-java by cloudendpoints.

the class SwaggerGeneratorTest method testWriteSwagger_AbsolutePathEndpoint.

@Test
public void testWriteSwagger_AbsolutePathEndpoint() throws Exception {
    Swagger swagger = getSwagger(AbsolutePathEndpoint.class, new SwaggerContext(), true);
    Swagger expected = readExpectedAsSwagger("absolute_path_endpoint.swagger");
    compareSwagger(expected, swagger);
}
Also used : SwaggerContext(com.google.api.server.spi.swagger.SwaggerGenerator.SwaggerContext) Swagger(io.swagger.models.Swagger) Test(org.junit.Test)

Example 7 with SwaggerContext

use of com.google.api.server.spi.swagger.SwaggerGenerator.SwaggerContext in project endpoints-java by cloudendpoints.

the class SwaggerGeneratorTest method testWriteSwagger_EnumEndpoint.

@Test
public void testWriteSwagger_EnumEndpoint() throws Exception {
    Swagger swagger = getSwagger(EnumEndpoint.class, new SwaggerContext(), true);
    Swagger expected = readExpectedAsSwagger("enum_endpoint.swagger");
    compareSwagger(expected, swagger);
}
Also used : SwaggerContext(com.google.api.server.spi.swagger.SwaggerGenerator.SwaggerContext) Swagger(io.swagger.models.Swagger) Test(org.junit.Test)

Example 8 with SwaggerContext

use of com.google.api.server.spi.swagger.SwaggerGenerator.SwaggerContext in project endpoints-java by cloudendpoints.

the class SwaggerGeneratorTest method testWriteSwagger_FooEndpointDefaultContext.

@Test
public void testWriteSwagger_FooEndpointDefaultContext() throws Exception {
    ApiConfig config = configLoader.loadConfiguration(ServiceContext.create(), FooEndpoint.class);
    Swagger swagger = generator.writeSwagger(ImmutableList.of(config), false, new SwaggerContext());
    Swagger expected = readExpectedAsSwagger("foo_endpoint_default_context.swagger");
    compareSwagger(expected, swagger);
}
Also used : SwaggerContext(com.google.api.server.spi.swagger.SwaggerGenerator.SwaggerContext) Swagger(io.swagger.models.Swagger) ApiConfig(com.google.api.server.spi.config.model.ApiConfig) Test(org.junit.Test)

Aggregations

SwaggerContext (com.google.api.server.spi.swagger.SwaggerGenerator.SwaggerContext)8 Swagger (io.swagger.models.Swagger)8 Test (org.junit.Test)7 ApiConfig (com.google.api.server.spi.config.model.ApiConfig)2 ServiceContext (com.google.api.server.spi.ServiceContext)1 TypeLoader (com.google.api.server.spi.TypeLoader)1 ApiConfigLoader (com.google.api.server.spi.config.ApiConfigLoader)1 ApiConfigAnnotationReader (com.google.api.server.spi.config.annotationreader.ApiConfigAnnotationReader)1 EndpointsPrettyPrinter (com.google.api.server.spi.response.EndpointsPrettyPrinter)1 SwaggerGenerator (com.google.api.server.spi.swagger.SwaggerGenerator)1 File (java.io.File)1 URLClassLoader (java.net.URLClassLoader)1