Skip to content

Commit 9af381d

Browse files
committed
Minor test cleanup
1 parent a1ec178 commit 9af381d

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/test/java/com/fasterxml/jackson/databind/ObjectMapperTest.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,28 @@ public void testProps()
289289
@Test
290290
public void testConfigForPropertySorting() throws Exception
291291
{
292-
ObjectMapper m = new ObjectMapper();
292+
ObjectMapper m = newJsonMapper();
293+
294+
assertEquals(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY.enabledByDefault(),
295+
m.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
296+
assertEquals(MapperFeature.SORT_CREATOR_PROPERTIES_FIRST.enabledByDefault(),
297+
m.isEnabled(MapperFeature.SORT_CREATOR_PROPERTIES_FIRST));
293298

294-
// sort-alphabetically is disabled by default:
295-
assertFalse(m.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
296299
SerializationConfig sc = m.getSerializationConfig();
297-
assertFalse(sc.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
298-
assertFalse(sc.shouldSortPropertiesAlphabetically());
300+
assertEquals(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY.enabledByDefault(),
301+
sc.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
302+
assertEquals(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY.enabledByDefault(),
303+
sc.shouldSortPropertiesAlphabetically());
304+
assertEquals(MapperFeature.SORT_CREATOR_PROPERTIES_FIRST.enabledByDefault(),
305+
sc.isEnabled(MapperFeature.SORT_CREATOR_PROPERTIES_FIRST));
306+
299307
DeserializationConfig dc = m.getDeserializationConfig();
300-
assertFalse(dc.shouldSortPropertiesAlphabetically());
308+
assertEquals(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY.enabledByDefault(),
309+
dc.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
310+
assertEquals(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY.enabledByDefault(),
311+
dc.shouldSortPropertiesAlphabetically());
312+
assertEquals(MapperFeature.SORT_CREATOR_PROPERTIES_FIRST.enabledByDefault(),
313+
dc.isEnabled(MapperFeature.SORT_CREATOR_PROPERTIES_FIRST));
301314

302315
// but when enabled, should be visible:
303316
m = jsonMapperBuilder()

0 commit comments

Comments
 (0)