Skip to content

Commit

Permalink
Add (failing) test cases to demonstrate that deserialization is not i…
Browse files Browse the repository at this point in the history
…gnoring a property when a Record's component has @JsonIgnore + the corresponding accessor method is overridden without @JsonIgnore.
  • Loading branch information
yihtserns committed Jul 20, 2024
1 parent f1b1078 commit 62e2893
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,13 @@ public void testHelloRecord() throws Exception {
HelloRecord result = MAPPER.readValue(json, HelloRecord.class);
assertNotNull(result);
}

@Test
public void testDeserialize() throws Exception {
HelloRecord expected = new HelloRecord("hello", null);

assertEquals(expected, MAPPER.readValue(a2q("{'text':'hello'}"), HelloRecord.class));
assertEquals(expected, MAPPER.readValue(a2q("{'text':'hello','hidden':null}"), HelloRecord.class));
assertEquals(expected, MAPPER.readValue(a2q("{'text':'hello','hidden':{'all': []}}"), HelloRecord.class));
}
}

0 comments on commit 62e2893

Please sign in to comment.