@Test
public void exportApiToSwaggerJSON() {

    Set<Resource> resources = api.getResources();
    Resource resource = resources.iterator().next();
    String path = resource.getOperations().get(0).getPath();
    Swagger swagger = swaggerService.exportApiToSwaggerJSON(api);
    String basePath = swagger.getBasePath();
    String host = swagger.getHost();
    List<Tag> tags = swagger.getTags();
    Tag tag = tags.get(0);
    String tagName = tag.getName();
    Map<String, Path> paths = swagger.getPaths();
    Path pathSwagger = paths.get(path);
    assertNotNull(pathSwagger);
    io.swagger.models.Operation get = pathSwagger.getGet();
    assertEquals(api.getBasePath(), basePath);
    assertEquals(api.getEnvironments().get(0).getInboundURL(), host);
    assertEquals(tagName, resource.getName());
    assertTrue(get.getTags().contains(tagName));
}