Skip to content

Commit bddc773

Browse files
authored
Merge pull request #145 from NanaOkada/fix-flaky4
Fix flaky test in TestUnwrapping
2 parents 9c6a229 + 3773d18 commit bddc773

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/test/java/com/fasterxml/jackson/module/jsonSchema/TestUnwrapping.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.fasterxml.jackson.module.jsonSchema;
22

33
import com.fasterxml.jackson.annotation.JsonUnwrapped;
4+
import com.fasterxml.jackson.databind.MapperFeature;
45
import com.fasterxml.jackson.databind.ObjectMapper;
56

67
public class TestUnwrapping extends SchemaTestBase
@@ -27,12 +28,13 @@ static class Name {
2728

2829
public void testUnwrapping() throws Exception
2930
{
30-
JsonSchemaGenerator generator = new JsonSchemaGenerator(MAPPER);
31+
ObjectMapper mapper = new ObjectMapper();
32+
mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
33+
JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
3134
JsonSchema schema = generator.generateSchema(UnwrappingRoot.class);
3235

33-
String json = MAPPER.writeValueAsString(schema).replace('"', '\'');
36+
String json = mapper.writeValueAsString(schema).replace('"', '\'');
3437

35-
//System.err.println("JSON -> "+MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(schema));
3638
String EXP = "{'type':'object'," +
3739
"'id':'urn:jsonschema:com:fasterxml:jackson:module:jsonSchema:TestUnwrapping:UnwrappingRoot'," +
3840
"'properties':{'age':{'type':'integer'},'name.first':{'type':'string'},'name.last':{'type':'string'}}}";

0 commit comments

Comments
 (0)