File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
src/test/java/com/fasterxml/jackson/databind/views Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,11 @@ public static class Foo {
8080 /**********************************************************
8181 */
8282
83- private final ObjectMapper MAPPER = newJsonMapper ();
83+ // Ensure `MapperFeature.DEFAULT_VIEW_INCLUSION` is enabled
84+ // (its default differs b/w Jackson 2.x and 3.x)
85+ private final ObjectMapper MAPPER = jsonMapperBuilder ()
86+ .enable (MapperFeature .DEFAULT_VIEW_INCLUSION )
87+ .build ();
8488
8589 @ SuppressWarnings ("unchecked" )
8690 @ Test
Original file line number Diff line number Diff line change 44
55import com .fasterxml .jackson .annotation .*;
66
7- import com .fasterxml .jackson .databind .ObjectMapper ;
8- import com .fasterxml .jackson .databind .ObjectReader ;
7+ import com .fasterxml .jackson .databind .*;
98import com .fasterxml .jackson .databind .testutil .DatabindTestUtil ;
109
1110import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -74,7 +73,11 @@ public String toString() {
7473 }
7574 }
7675
77- private final ObjectMapper MAPPER = newJsonMapper ();
76+ // Ensure `MapperFeature.DEFAULT_VIEW_INCLUSION` is enabled
77+ // (its default differs b/w Jackson 2.x and 3.x)
78+ private final ObjectMapper MAPPER = jsonMapperBuilder ()
79+ .enable (MapperFeature .DEFAULT_VIEW_INCLUSION )
80+ .build ();
7881
7982 // [databind#1172]
8083 @ Test
You can’t perform that action at this time.
0 commit comments