Skip to content

Commit 9c6a229

Browse files
committed
minor post-merge clean up
1 parent f56c7ff commit 9c6a229

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.fasterxml.jackson.databind.JavaType;
77
import com.fasterxml.jackson.databind.MapperFeature;
88
import com.fasterxml.jackson.databind.ObjectMapper;
9+
import com.fasterxml.jackson.databind.json.JsonMapper;
910
import com.fasterxml.jackson.databind.ser.FilterProvider;
1011
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
1112
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
@@ -132,8 +133,13 @@ public void setProperty2(String property2) {
132133
/**********************************************************
133134
*/
134135

135-
private final ObjectMapper MAPPER = new ObjectMapper();
136+
private final ObjectMapper MAPPER = objectMapper();
136137

138+
private final ObjectMapper SORTED_MAPPER = JsonMapper.builder()
139+
.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY)
140+
.build();
141+
142+
137143
/**
138144
* Test simple generation
139145
*/
@@ -275,8 +281,7 @@ public void testSimpleMap() throws Exception {
275281
}
276282

277283
public void testSinglePropertyDependency() throws Exception {
278-
ObjectMapper mapper = new ObjectMapper();
279-
mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
284+
final ObjectMapper mapper = SORTED_MAPPER;
280285
JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
281286
JsonSchema jsonSchema = generator.generateSchema(SimpleBean.class);
282287
((ObjectSchema) jsonSchema).addSimpleDependency("property1", "property2");
@@ -296,8 +301,7 @@ public void testSinglePropertyDependency() throws Exception {
296301
}
297302

298303
public void testMultiplePropertyDependencies() throws Exception {
299-
ObjectMapper mapper = new ObjectMapper();
300-
mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
304+
final ObjectMapper mapper = SORTED_MAPPER;
301305
JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
302306
JsonSchema jsonSchema = generator.generateSchema(SimpleBean.class);
303307
((ObjectSchema) jsonSchema).addSimpleDependency("property1", "property2");
@@ -320,8 +324,7 @@ public void testMultiplePropertyDependencies() throws Exception {
320324
}
321325

322326
public void testSchemaPropertyDependency() throws Exception {
323-
ObjectMapper mapper = new ObjectMapper();
324-
mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
327+
final ObjectMapper mapper = SORTED_MAPPER;
325328
JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
326329

327330
// Given this dependency schema
@@ -347,8 +350,7 @@ public void testSchemaPropertyDependency() throws Exception {
347350
}
348351

349352
public void testSchemaPropertyDependencies() throws Exception {
350-
ObjectMapper mapper = new ObjectMapper();
351-
mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
353+
final ObjectMapper mapper = SORTED_MAPPER;
352354
JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
353355

354356
// Given this dependency schema

0 commit comments

Comments
 (0)