Skip to content

Commit 39045d0

Browse files
committed
Use LinkedHashMap instead of HashMap
HashMap is not stable beetween 'Java 8' and 'Java 11'
1 parent 6f1bdc9 commit 39045d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.testng.annotations.Test;
2020

2121
import java.util.Arrays;
22+
import java.util.LinkedHashMap;
2223

2324
public class SerializerUtilsTest {
2425

@@ -44,6 +45,7 @@ public void testToYamlStringCompleteExample() throws Exception {
4445
.operationId("pingOp")
4546
.responses(new ApiResponses().addApiResponse("200", new ApiResponse().description("Ok")))));
4647
openAPI.components(new Components().addSchemas("SomeObject", new ObjectSchema().description("An Obj").addProperties("id", new StringSchema())));
48+
openAPI.setExtensions(new LinkedHashMap<>()); // required because swagger-core is using HashMap instead of LinkedHashMap internally.
4749
openAPI.addExtension("x-custom", "value1");
4850
openAPI.addExtension("x-other", "value2");
4951

@@ -87,8 +89,8 @@ public void testToYamlStringCompleteExample() throws Exception {
8789
" id:\n" +
8890
" type: string\n" +
8991
" type: object\n" +
90-
"x-other: value2\n" +
91-
"x-custom: value1\n";
92+
"x-custom: value1\n" +
93+
"x-other: value2\n";
9294
assertEquals(content, expected);
9395
}
9496

0 commit comments

Comments
 (0)