File tree 1 file changed +19
-1
lines changed
src/test/java/com/fasterxml/jackson/databind/filter
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,13 @@ static class NonEmptyDouble {
118
118
119
119
public NonEmptyDouble (double v ) { value = v ; }
120
120
}
121
-
121
+
122
+ @ JsonInclude (JsonInclude .Include .NON_EMPTY )
123
+ public static class Issues1327Bean {
124
+ public String myString = "stuff" ;
125
+ public List <String > myList = new ArrayList <String >();
126
+ }
127
+
122
128
/*
123
129
/**********************************************************
124
130
/* Unit tests
@@ -231,4 +237,16 @@ public void testEmptyInclusionScalars() throws IOException
231
237
assertEquals ("{\" i\" :0}" , defMapper .writeValueAsString (zero ));
232
238
assertEquals ("{\" i\" :0}" , inclMapper .writeValueAsString (zero ));
233
239
}
240
+
241
+ public void testIssue1327 () throws Exception {
242
+ ObjectMapper om = new ObjectMapper ();
243
+ om .setSerializationInclusion (JsonInclude .Include .NON_NULL );
244
+
245
+ final Issues1327Bean input = new Issues1327Bean ();
246
+ final String jsonString = om .writeValueAsString (input );
247
+
248
+ if (jsonString .contains ("myList" )) {
249
+ fail ("Should not contain `myList`: " +jsonString );
250
+ }
251
+ }
234
252
}
You can’t perform that action at this time.
0 commit comments