Skip to content

Commit

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

// [databind#4626]
@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 2096c42

Please sign in to comment.