File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/test/java/com/fasterxml/jackson/databind/ser/filter Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,19 @@ public DefaultIntBean(int i1, Integer i2) {
100100 }
101101 }
102102
103+ @ JsonInclude (JsonInclude .Include .NON_DEFAULT )
104+ static class NonDefaultBean4741 {
105+ private String value = null ;
106+
107+ public String getValue () {
108+ return value ;
109+ }
110+
111+ public void setValue (String value ) {
112+ this .value = value ;
113+ }
114+ }
115+
103116 static class NonEmptyString {
104117 @ JsonInclude (JsonInclude .Include .NON_EMPTY )
105118 public String value ;
@@ -318,6 +331,15 @@ public void testIssue1351() throws Exception
318331 mapper .writeValueAsString (new Issue1351NonBean (0 )));
319332 }
320333
334+ // [databind#4741]
335+ public void testSerialization4741 () throws Exception
336+ {
337+ ObjectMapper mapper = new ObjectMapper ();
338+ NonDefaultBean4741 bean = new NonDefaultBean4741 ();
339+ bean .setValue ("" );
340+ assertEquals (a2q ("{'value':''}" ), mapper .writeValueAsString (bean ));
341+ }
342+
321343 // [databind#1550]
322344 public void testInclusionOfDate () throws Exception
323345 {
You can’t perform that action at this time.
0 commit comments