Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ private String getString(MyModelRoot myModelInstance, ObjectMapper myObjectMappe
private ObjectMapper defaultMapper()
{
return jsonMapperBuilder()
.defaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY,
JsonInclude.Include.NON_EMPTY))
.defaultPropertyInclusion(JsonInclude.Value.ALL_NON_EMPTY)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ static class Car
CAR.properties = CAR_PROPERTIES;
}

private final JsonInclude.Value BOTH_NON_NULL = JsonInclude.Value.construct(JsonInclude.Include.NON_NULL,
JsonInclude.Include.NON_NULL);

// final private ObjectMapper MAPPER = newJsonMapper();

// [databind#2572]
Expand All @@ -51,7 +48,7 @@ public void test2572MapDefault() throws Exception
{

ObjectMapper mapper = JsonMapper.builder()
.defaultPropertyInclusion(BOTH_NON_NULL)
.defaultPropertyInclusion(JsonInclude.Value.ALL_NON_NULL)
.build();
assertEquals(a2q("{'Speed':100}"),
mapper.writeValueAsString(CAR_PROPERTIES));
Expand All @@ -64,7 +61,7 @@ public void test2572MapDefault() throws Exception
public void test2572MapOverrideUseDefaults() throws Exception
{
ObjectMapper mapper = JsonMapper.builder()
.defaultPropertyInclusion(BOTH_NON_NULL)
.defaultPropertyInclusion(JsonInclude.Value.ALL_NON_NULL)
.build();
mapper.configOverride(Map.class)
.setInclude(JsonInclude.Value.construct(JsonInclude.Include.USE_DEFAULTS,
Expand All @@ -80,7 +77,7 @@ public void test2572MapOverrideUseDefaults() throws Exception
public void test2572MapOverrideInclAlways() throws Exception
{
ObjectMapper mapper = JsonMapper.builder()
.defaultPropertyInclusion(BOTH_NON_NULL)
.defaultPropertyInclusion(JsonInclude.Value.ALL_NON_NULL)
.build();
mapper.configOverride(Map.class)
.setInclude(JsonInclude.Value.construct(JsonInclude.Include.ALWAYS,
Expand Down
Loading