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 @@ -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
You can’t perform that action at this time.
0 commit comments