ExternalDocsComponent extends MarkupComponent<ExternalDocsComponent.Parameters> { public ExternalDocsComponent(Swagger2MarkupConverter.SwaggerContext context) { super(context); } ExternalDocsComponent(Swagger2MarkupConverter.SwaggerContext context); static ExternalDocsComponent.Parameters parameters(ExternalDocs externalDocs, int titleLevel); @Override MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, Parameters params);  }
@Test public void testExternalDocsComponent() throws URISyntaxException { Path file = Paths.get(DefinitionComponentTest.class.getResource("/yaml/swagger_petstore_20160612.yaml").toURI()); Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(file).build(); Swagger swagger = converter.getContext().getSchema(); ExternalDocs externalDocs = swagger.getExternalDocs(); Assert.assertNotNull(externalDocs); Swagger2MarkupConverter.SwaggerContext context = converter.getContext(); MarkupDocBuilder markupDocBuilder = context.createMarkupDocBuilder(); markupDocBuilder = new ExternalDocsComponent(context).apply(markupDocBuilder, ExternalDocsComponent.parameters(externalDocs, OverviewDocument.SECTION_TITLE_LEVEL)); markupDocBuilder.writeToFileWithoutExtension(outputDirectory, StandardCharsets.UTF_8); Path expectedFile = getExpectedFile(COMPONENT_NAME); DiffUtils.assertThatFileIsEqual(expectedFile, outputDirectory, getReportName(COMPONENT_NAME)); }