diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/partial_header.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/partial_header.mustache index 79ae090e31a6..038e725751a7 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/partial_header.mustache @@ -7,7 +7,13 @@ {{{.}}} {{/appDescription}} - {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} - {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + {{#version}} + The version of the OpenAPI document: {{{.}}} + + {{/version}} + {{#infoEmail}} + Contact: {{{.}}} + + {{/infoEmail}} Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java index 43b19edb55a0..db8a5b29cd0e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/markdown/MarkdownSampleGeneratorTest.java @@ -8,7 +8,6 @@ import java.util.List; import org.apache.commons.io.FileUtils; - import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.config.CodegenConfigurator; import org.testng.Assert; @@ -21,6 +20,8 @@ public class MarkdownSampleGeneratorTest { @BeforeClass public void beforeClassGenerateTestMarkup() throws Exception { + // set line break to \n across all platforms + System.setProperty("line.separator", "\n"); this.outputTempDirectory = Files.createTempDirectory("test-markdown-sample-generator.").toFile(); @@ -44,8 +45,8 @@ public void testSampleMarkdownGeneration() throws IOException { Assert.assertTrue(expected.exists(), "Could not find " + expected.toString()); - Assert.assertEquals(FileUtils.readFileToString(generated), - FileUtils.readFileToString(expected, StandardCharsets.UTF_8)); + Assert.assertEquals(FileUtils.readFileToString(generated, StandardCharsets.UTF_8).replace("\n", "").replace("\r", ""), + FileUtils.readFileToString(expected, StandardCharsets.UTF_8).replace("\n", "").replace("\r", "")); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java index db3f06e3c80f..3b30f96b2e35 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java @@ -49,6 +49,9 @@ public void testFeatureSet() { @Test public void testCodeGenWithAllOf() throws IOException { + // set line break to \n across all platforms + System.setProperty("line.separator", "\n"); + File output = Files.createTempDirectory("test").toFile(); final CodegenConfigurator configurator = new CodegenConfigurator() @@ -69,9 +72,11 @@ public void testCodeGenWithAllOf() throws IOException { } private void assertFileEquals(Path generatedFilePath, Path expectedFilePath) throws IOException { - String generatedFile = new String(Files.readAllBytes(generatedFilePath), StandardCharsets.UTF_8); - String expectedFile = new String(Files.readAllBytes(expectedFilePath), StandardCharsets.UTF_8); + String generatedFile = new String(Files.readAllBytes(generatedFilePath), StandardCharsets.UTF_8) + .replace("\n", "").replace("\r", ""); + String expectedFile = new String(Files.readAllBytes(expectedFilePath), StandardCharsets.UTF_8) + .replace("\n", "").replace("\r", ""); assertEquals(generatedFile, expectedFile); } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto b/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto index 86da6922f5e3..7ba4adc282a1 100644 --- a/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto +++ b/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/pom.xml b/pom.xml index 8bf0f19b74c9..1f73af69c71e 100644 --- a/pom.xml +++ b/pom.xml @@ -226,10 +226,14 @@ ${surefire-version} true + 120 false none:none org.testng:testng @{argLine} -XX:+StartAttachListener + 3 + true + -Xmx1024m -XX:MaxPermSize=256m 1000 5000 @@ -1616,7 +1620,7 @@ 1.14 4.1.2 7.1.0 - 3.0.0-M3 + 3.0.0-M5 0.9.10 3.6.28 0.8.5 diff --git a/samples/config/petstore/protobuf-schema/models/api_response.proto b/samples/config/petstore/protobuf-schema/models/api_response.proto index 9ab4d12e1703..96f876529132 100644 --- a/samples/config/petstore/protobuf-schema/models/api_response.proto +++ b/samples/config/petstore/protobuf-schema/models/api_response.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/models/category.proto b/samples/config/petstore/protobuf-schema/models/category.proto index 824ce32ac595..7c05a10a8f63 100644 --- a/samples/config/petstore/protobuf-schema/models/category.proto +++ b/samples/config/petstore/protobuf-schema/models/category.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/models/order.proto b/samples/config/petstore/protobuf-schema/models/order.proto index 5d46dfd9beea..27cded1f00e1 100644 --- a/samples/config/petstore/protobuf-schema/models/order.proto +++ b/samples/config/petstore/protobuf-schema/models/order.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/models/pet.proto b/samples/config/petstore/protobuf-schema/models/pet.proto index 725dfa0818a6..41ed4b7a9fc5 100644 --- a/samples/config/petstore/protobuf-schema/models/pet.proto +++ b/samples/config/petstore/protobuf-schema/models/pet.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/models/tag.proto b/samples/config/petstore/protobuf-schema/models/tag.proto index 9f2a6343955e..bd7a99341664 100644 --- a/samples/config/petstore/protobuf-schema/models/tag.proto +++ b/samples/config/petstore/protobuf-schema/models/tag.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/models/user.proto b/samples/config/petstore/protobuf-schema/models/user.proto index 5dcba10582f5..eb6f727b876e 100644 --- a/samples/config/petstore/protobuf-schema/models/user.proto +++ b/samples/config/petstore/protobuf-schema/models/user.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/services/pet_service.proto b/samples/config/petstore/protobuf-schema/services/pet_service.proto index 9c694f6e8388..6ac05f1deeb6 100644 --- a/samples/config/petstore/protobuf-schema/services/pet_service.proto +++ b/samples/config/petstore/protobuf-schema/services/pet_service.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/services/store_service.proto b/samples/config/petstore/protobuf-schema/services/store_service.proto index f1b1e90d9092..e30382ad502a 100644 --- a/samples/config/petstore/protobuf-schema/services/store_service.proto +++ b/samples/config/petstore/protobuf-schema/services/store_service.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/samples/config/petstore/protobuf-schema/services/user_service.proto b/samples/config/petstore/protobuf-schema/services/user_service.proto index 639867b4fe26..8130b04aadd2 100644 --- a/samples/config/petstore/protobuf-schema/services/user_service.proto +++ b/samples/config/petstore/protobuf-schema/services/user_service.proto @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. The version of the OpenAPI document: 1.0.0 - + Generated by OpenAPI Generator: https://openapi-generator.tech */