• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Swagger2MarkupConfigBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder的典型用法代码示例。如果您正苦于以下问题:Java Swagger2MarkupConfigBuilder类的具体用法?Java Swagger2MarkupConfigBuilder怎么用?Java Swagger2MarkupConfigBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Swagger2MarkupConfigBuilder类属于io.github.swagger2markup.builder包,在下文中一共展示了Swagger2MarkupConfigBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: test

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void test() throws URISyntaxException {
    //Given
    Path file = Paths.get(SwaggerToAsciiDocMarkdownConfluence.class.getResource(resource).toURI());
    Path outputDirectory = Paths.get(BUILD_SWAGGER_2_MARKUP_PATH + outputPath);
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withPathsGroupedBy(GroupBy.TAGS)
            .withOutputLanguage(Language.EN)
            .withMarkupLanguage(markupLanguage)
            .build();

    Swagger2MarkupConverter.from(file)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);
}
 
开发者ID:tsypuk,项目名称:springrestdoc,代码行数:20,代码来源:SwaggerToAsciiDocMarkdownConfluence.java


示例2: testOrderByAsIs

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testOrderByAsIs() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_ordering.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/ordering_asis");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withTagOrdering(OrderBy.AS_IS)
            .withParameterOrdering(OrderBy.AS_IS)
            .withOperationOrdering(OrderBy.AS_IS)
            .withDefinitionOrdering(OrderBy.AS_IS)
            .withPathsGroupedBy(GroupBy.TAGS)
            .build();

    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/ordering_asis").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testOrderingAsIs.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:27,代码来源:AsciidocConverterTest.java


示例3: testOrderByNatural

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testOrderByNatural() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_ordering.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/ordering_natural");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withTagOrdering(OrderBy.NATURAL)
            .withParameterOrdering(OrderBy.NATURAL)
            .withOperationOrdering(OrderBy.NATURAL)
            .withPathsGroupedBy(GroupBy.TAGS)
            .build();

    //When
    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/ordering_natural").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testOrderingNatural.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:26,代码来源:AsciidocConverterTest.java


示例4: testOrderByRegex

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testOrderByRegex() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_ordering_regex.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/ordering_regex");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withTagOrdering(OrderBy.NATURAL)
            .withParameterOrdering(OrderBy.NATURAL)
            .withOperationOrdering(OrderBy.NATURAL)
            .withPathsGroupedBy(GroupBy.REGEX)
            .withHeaderRegex("\\/(\\w+)(\\/|\\w)*$")
            .build();

    //When
    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/ordering_regex").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testOrderingRegex.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:27,代码来源:AsciidocConverterTest.java


示例5: testMarkupRenderingInInstagram

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testMarkupRenderingInInstagram() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_instagram.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/instagram");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withTagOrdering(OrderBy.AS_IS)
            .build();

    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/instagram").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testMarkupRenderingInInstagram.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:23,代码来源:AsciidocConverterTest.java


示例6: testInterDocumentCrossReferences

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testInterDocumentCrossReferences() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_petstore.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/idxref");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withInterDocumentCrossReferences()
            .build();

    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/idxref").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testInterDocumentCrossReferences.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:23,代码来源:AsciidocConverterTest.java


示例7: testWithBasePathPrefix

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithBasePathPrefix() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/json/swagger_examples.json").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/basepathprefix");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withBasePathPrefix()
            .withGeneratedExamples()
            .build();

    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/basepathprefix").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithBasePathPrefix.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:24,代码来源:AsciidocConverterTest.java


示例8: testWithExamples

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithExamples() throws IOException, URISyntaxException {
    //Given
    String swaggerJsonString = IOUtils.toString(getClass().getResourceAsStream("/json/swagger_examples.json"));
    Path outputDirectory = Paths.get("build/test/asciidoc/examples");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .build();

    Swagger2MarkupConverter.from(swaggerJsonString)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);
    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/examples").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithExamples.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:23,代码来源:AsciidocConverterTest.java


示例9: testWithGeneratedExamples

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithGeneratedExamples() throws IOException, URISyntaxException {
    //Given
    String swaggerJsonString = IOUtils.toString(getClass().getResourceAsStream("/json/swagger_examples.json"));
    Path outputDirectory = Paths.get("build/test/asciidoc/generated_examples");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withGeneratedExamples()
            .build();

    Swagger2MarkupConverter.from(swaggerJsonString)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);
    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/generated_examples").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithGeneratedExamples.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:24,代码来源:AsciidocConverterTest.java


示例10: testWithGeneratedRecursiveExamples

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithGeneratedRecursiveExamples() throws IOException, URISyntaxException {
    // Given
    String swaggerJsonString = IOUtils.toString(getClass().getResourceAsStream("/json/swagger_recursion.json"));
    Path outputDirectory = Paths.get("build/test/asciidoc/generated_recursion_examples");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    // When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder().withoutInlineSchema().withGeneratedExamples().build();

    Swagger2MarkupConverter.from(swaggerJsonString).withConfig(config).build().toFolder(outputDirectory);

    // Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);
    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/generated_recursion_examples").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithGeneratedRecursiveExamples.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:19,代码来源:AsciidocConverterTest.java


示例11: testWithInlineSchema

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithInlineSchema() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_inlineSchema.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/inline_schema");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .build();
    Swagger2MarkupConverter.from(file)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);
    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/inline_schema").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithInlineSchema.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:22,代码来源:AsciidocConverterTest.java


示例12: testWithInlineSchemaAndFlatBody

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithInlineSchemaAndFlatBody() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_inlineSchema.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/inline_schema_flat_body");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withFlatBody()
            .build();
    Swagger2MarkupConverter.from(file)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);
    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/inline_schema_flat_body").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithInlineSchemaAndFlatBody.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:23,代码来源:AsciidocConverterTest.java


示例13: testGroupedByTags

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testGroupedByTags() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_petstore.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/group_by_tags");
    FileUtils.deleteQuietly(outputDirectory.toFile());
    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withPathsGroupedBy(GroupBy.TAGS)
            .build();
    Swagger2MarkupConverter.from(file)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);
    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/group_by_tags").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testGroupedByTags.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:22,代码来源:AsciidocConverterTest.java


示例14: testByTagsWithMissingTag

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testByTagsWithMissingTag() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/json/swagger_missing_tag.json").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/generated");
    FileUtils.deleteQuietly(outputDirectory.toFile());
    //When
    try {
        Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
                .withPathsGroupedBy(GroupBy.TAGS)
                .build();

        Swagger2MarkupConverter.from(file)
                .withConfig(config)
                .build()
                .toFolder(outputDirectory);
        // If NullPointerException was not thrown, test would fail the specified message
        failBecauseExceptionWasNotThrown(NullPointerException.class);
    } catch (Exception e) {
        assertThat(e).hasMessage("Can't GroupBy.TAGS. Operation 'updatePet' has no tags");
    }
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:23,代码来源:AsciidocConverterTest.java


示例15: testWithSeparatedDefinitions

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithSeparatedDefinitions() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_petstore.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/generated");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withSeparatedDefinitions()
            .build();
    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    expectedFiles.add("definitions");
    assertThat(files).hasSize(5).containsAll(expectedFiles);

    Path definitionsDirectory = outputDirectory.resolve("definitions");
    String[] definitions = definitionsDirectory.toFile().list();
    assertThat(definitions).hasSize(5).containsAll(
            asList("Category.adoc", "Order.adoc", "Pet.adoc", "Tag.adoc", "User.adoc"));
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:25,代码来源:AsciidocConverterTest.java


示例16: testWithSeparatedOperations

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithSeparatedOperations() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_petstore.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/generated");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withSeparatedOperations()
            .build();
    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    expectedFiles.add("operations");
    assertThat(files).hasSize(5).containsAll(expectedFiles);

    Path pathsDirectory = outputDirectory.resolve("operations");
    String[] paths = pathsDirectory.toFile().list();
    assertThat(paths).hasSize(18);
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:24,代码来源:AsciidocConverterTest.java


示例17: testWithAsciidocContentInTables

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithAsciidocContentInTables() throws URISyntaxException {

    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_petstore_with_adoc_content.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/generated");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withSwaggerMarkupLanguage(MarkupLanguage.ASCIIDOC)
            .build();

    Swagger2MarkupConverter.from(file).withConfig(config).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:22,代码来源:AsciidocConverterTest.java


示例18: testWithOutputLanguage

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
private void testWithOutputLanguage(Language language, String outputFilename, String expected) throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_petstore.yaml").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/language");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withOutputLanguage(language)
            .build();
    Swagger2MarkupConverter.from(file)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    assertThat(new String(Files.readAllBytes(outputDirectory.resolve(outputFilename)), Charset.forName("UTF-8")))
            .contains(expected);
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:20,代码来源:AsciidocConverterTest.java


示例19: testWithMaps

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithMaps() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/json/swagger_maps.json").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/maps");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .withTagOrdering(OrderBy.AS_IS)
            .build();
    Swagger2MarkupConverter.from(file)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/maps").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithMaps.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:24,代码来源:AsciidocConverterTest.java


示例20: testWithEnums

import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder; //导入依赖的package包/类
@Test
public void testWithEnums() throws IOException, URISyntaxException {
    //Given
    Path file = Paths.get(AsciidocConverterTest.class.getResource("/json/swagger_enums.json").toURI());
    Path outputDirectory = Paths.get("build/test/asciidoc/enums");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
            .build();
    Swagger2MarkupConverter.from(file)
            .withConfig(config)
            .build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);

    Path expectedFilesDirectory = Paths.get(AsciidocConverterTest.class.getResource("/expected/asciidoc/enums").toURI());
    DiffUtils.assertThatAllFilesAreEqual(expectedFilesDirectory, outputDirectory, "testWithEnums.html");
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:23,代码来源:AsciidocConverterTest.java



注:本文中的io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FormEngine类代码示例发布时间:2022-05-22
下一篇:
Java AutolinkExtension类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap