File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/test/java/com/fasterxml/jackson/databind/deser/jdk Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 66import com .fasterxml .jackson .core .type .TypeReference ;
77import com .fasterxml .jackson .databind .ObjectMapper ;
88import com .fasterxml .jackson .databind .exc .InvalidNullException ;
9+ import com .fasterxml .jackson .databind .json .JsonMapper ;
910import org .junit .jupiter .api .Test ;
1011
1112import java .util .List ;
@@ -28,8 +29,9 @@ public void setList(List<Integer> list) {
2829
2930 @ Test
3031 public void nullsFailTest () {
31- ObjectMapper mapper = new ObjectMapper ();
32- mapper .configOverride (List .class ).setSetterInfo (JsonSetter .Value .forContentNulls (Nulls .FAIL ));
32+ ObjectMapper mapper = JsonMapper .builder ()
33+ .defaultSetterInfo (JsonSetter .Value .forContentNulls (Nulls .FAIL ))
34+ .build ();
3335
3436 assertThrows (
3537 InvalidNullException .class ,
@@ -39,8 +41,9 @@ public void nullsFailTest() {
3941
4042 @ Test
4143 public void nullsSkipTest () throws JsonProcessingException {
42- ObjectMapper mapper = new ObjectMapper ();
43- mapper .configOverride (List .class ).setSetterInfo (JsonSetter .Value .forContentNulls (Nulls .SKIP ));
44+ ObjectMapper mapper = JsonMapper .builder ()
45+ .defaultSetterInfo (JsonSetter .Value .forContentNulls (Nulls .FAIL ))
46+ .build ();
4447
4548 Dst dst = mapper .readValue ("{\" list\" :[\" \" ]}" , new TypeReference <Dst >() {});
4649
You can’t perform that action at this time.
0 commit comments