Skip to content

Commit

Permalink
Resolve 2 unit test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 6, 2023
1 parent dfee4f0 commit dfc8bfd
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.core.io.ContentReference;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.TokenBuffer;

Expand Down Expand Up @@ -118,8 +119,11 @@ public void testTokenBufferWithSequence() throws Exception
// [databind#2398]
public void testDeeplyNestedArrays() throws Exception
{
try (JsonParser p = MAPPER.createParser(_createNested(RECURSION_2398 * 2,
"[", " 123 ", "]"))) {
JsonFactory jsonFactory = JsonFactory.builder()
.streamReadConstraints(StreamReadConstraints.builder().maxNestingDepth(Integer.MAX_VALUE).build())
.build();
try (JsonParser p = JsonMapper.builder(jsonFactory).build().createParser(
_createNested(RECURSION_2398 * 2, "[", " 123 ", "]"))) {
p.nextToken();
TokenBuffer b = new TokenBuffer(p);
b.copyCurrentStructure(p);
Expand All @@ -129,7 +133,11 @@ public void testDeeplyNestedArrays() throws Exception

public void testDeeplyNestedObjects() throws Exception
{
try (JsonParser p = MAPPER.createParser(_createNested(RECURSION_2398,
JsonFactory jsonFactory = JsonFactory.builder()
.streamReadConstraints(StreamReadConstraints.builder().maxNestingDepth(Integer.MAX_VALUE).build())
.build();
try (JsonParser p = JsonMapper.builder(jsonFactory).build().createParser(
_createNested(RECURSION_2398,
"{\"a\":", "42", "}"))) {
p.nextToken();
TokenBuffer b = new TokenBuffer(p);
Expand Down

0 comments on commit dfc8bfd

Please sign in to comment.