Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into 3838
  • Loading branch information
JooHyukKim committed Apr 12, 2023
2 parents 6b9149c + 00cb4b7 commit 1f3d11a
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ public void testUnresolvedForwardReference()
}
}


// [databind#299]: Allow unresolved ids to become nulls
public void testUnresolvableAsNull() throws Exception
{
Expand All @@ -352,6 +353,24 @@ public void testUnresolvableAsNull() throws Exception
assertNull(w.node);
}

public void testUnresolvableIdShouldFail() throws Exception
{
IdWrapper w = MAPPER.readerFor(IdWrapper.class)
.with(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS)
.readValue(a2q("{'node':123}"));
assertNotNull(w);
assertNull(w.node);
}

public void testUnresolvableIdShouldFail2() throws Exception
{
IdWrapper w = MAPPER.readerFor(IdWrapper.class)
.with(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS)
.readValue(a2q("{}"));
assertNotNull(w);
assertNull(w.node);
}

public void testKeepCollectionOrdering() throws Exception
{
String json = "{\"employees\":[2,1,"
Expand Down

0 comments on commit 1f3d11a

Please sign in to comment.