Skip to content

Commit

Permalink
Partial parsing test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszGaweda committed Jun 27, 2024
1 parent e929271 commit 65071f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions jr-record-test/src/test-jdk17/java/jr/Java17RecordTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ public void testNullAndRecord() throws IOException {
assertNull(jsonParser.beanFrom(Cow.class, "null"));
}

public void testPartialParsing() throws IOException {
var json = """
{ "message":"MOO"}""";

Cow expectedObject = new Cow("MOO", null);
Cow object = jsonParser.beanFrom(Cow.class, json);
assertEquals(expectedObject, object);
}

public void testWhenInsideObject() throws IOException {
var cowJson = """
{"object": null, "message":"MOO"}""";
Expand Down

0 comments on commit 65071f5

Please sign in to comment.