Skip to content

Commit b86f514

Browse files
committed
Merge branch '2.17' into 2.18
2 parents 3da3da8 + c8e577d commit b86f514

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/test/java/com/fasterxml/jackson/databind/ser/filter/JsonIncludeTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ public DefaultIntBean(int i1, Integer i2) {
105105
}
106106
}
107107

108+
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
109+
static class NonDefaultBean4741 {
110+
private String value = null;
111+
112+
public String getValue() {
113+
return value;
114+
}
115+
116+
public void setValue(String value) {
117+
this.value = value;
118+
}
119+
}
120+
108121
static class NonEmptyString {
109122
@JsonInclude(JsonInclude.Include.NON_EMPTY)
110123
public String value;
@@ -333,6 +346,15 @@ public void testIssue1351() throws Exception
333346
mapper.writeValueAsString(new Issue1351NonBean(0)));
334347
}
335348

349+
// [databind#4741]
350+
public void testSerialization4741() throws Exception
351+
{
352+
ObjectMapper mapper = new ObjectMapper();
353+
NonDefaultBean4741 bean = new NonDefaultBean4741();
354+
bean.setValue("");
355+
assertEquals(a2q("{'value':''}"), mapper.writeValueAsString(bean));
356+
}
357+
336358
// [databind#1550]
337359
@Test
338360
public void testInclusionOfDate() throws Exception

0 commit comments

Comments
 (0)