use of com.wordnik.swagger.config.SwaggerConfig in project camel by apache.
the class RestSwaggerReaderTest method testReaderRead.
@Test
public void testReaderRead() throws Exception {
RestDefinition rest = context.getRestDefinitions().get(0);
assertNotNull(rest);
SwaggerConfig config = new SwaggerConfig();
config.setBasePath("http://localhost:8080/api");
RestSwaggerReader reader = new RestSwaggerReader();
Option<ApiListing> option = reader.read(rest, config);
assertNotNull(option);
ApiListing listing = option.get();
assertNotNull(listing);
String json = JsonSerializer.asJson(listing);
log.info(json);
assertTrue(json.contains("\"basePath\":\"http://localhost:8080/api\""));
assertTrue(json.contains("\"resourcePath\":\"/hello\""));
assertTrue(json.contains("\"method\":\"GET\""));
assertTrue(json.contains("\"nickname\":\"getHelloHi\""));
context.stop();
}
Aggregations