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) {
100
100
}
101
101
}
102
102
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
+
103
116
static class NonEmptyString {
104
117
@ JsonInclude (JsonInclude .Include .NON_EMPTY )
105
118
public String value ;
@@ -318,6 +331,15 @@ public void testIssue1351() throws Exception
318
331
mapper .writeValueAsString (new Issue1351NonBean (0 )));
319
332
}
320
333
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
+
321
343
// [databind#1550]
322
344
public void testInclusionOfDate () throws Exception
323
345
{
You can’t perform that action at this time.
0 commit comments