11package com .fasterxml .jackson .databind .records ;
22
33import com .fasterxml .jackson .annotation .JsonProperty ;
4-
54import com .fasterxml .jackson .databind .*;
65
76public class RecordFailingSetter3938Test extends BaseMapTest
@@ -19,8 +18,7 @@ default void setOptions(JsonNode value) {
1918 }
2019 }
2120
22- public record Command3938 (int id , String filter ) implements NoOptionsCommand {
23- }
21+ public record Command3938 (int id , String filter ) implements NoOptionsCommand { }
2422
2523 private final ObjectMapper MAPPER = newJsonMapper ();
2624
@@ -29,13 +27,13 @@ public void testFailingSetter3939() throws Exception
2927 {
3028 final ObjectReader R = MAPPER .readerFor (Command3938 .class );
3129
32- // First, missing value and `null` are fine
30+ // First, missing value and `null` are fine, as long as we have all fields
3331 assertNotNull (R .readValue (a2q ("{'id':1, 'filter':'abc'}" )));
34- assertNotNull (R .readValue (a2q ("{'id':2, 'filter':'def ', 'options':null}" )));
32+ assertNotNull (R .readValue (a2q ("{'id':2, 'filter':'abc ', 'options':null}" )));
3533
3634 // But then failure for non-empty Array (f.ex)
3735 try {
38- R .readValue (a2q ("{'id':3, 'filter':'xyz', ' options':[ 123 ] }" ));
36+ R .readValue (a2q ("{'id':2,' options':[123]} }" ));
3937 fail ("Should not pass" );
4038 } catch (DatabindException e ) {
4139 verifyException (e , ERROR_3938_PREFIX );
0 commit comments