diff --git a/src/test/java/com/fasterxml/jackson/core/constraints/StreamReadConstraintsDefaultsTest.java b/src/test/java/com/fasterxml/jackson/core/constraints/StreamReadConstraintsDefaultsTest.java index 0b9040f5a4..0cad3ec03a 100644 --- a/src/test/java/com/fasterxml/jackson/core/constraints/StreamReadConstraintsDefaultsTest.java +++ b/src/test/java/com/fasterxml/jackson/core/constraints/StreamReadConstraintsDefaultsTest.java @@ -6,24 +6,30 @@ import static org.junit.Assert.assertEquals; -public class StreamReadConstraintsDefaultsTest { +public class StreamReadConstraintsDefaultsTest +{ @Test public void testOverride() { + final long maxDocLen = 10_000_000L; final int numLen = 1234; final int strLen = 12345; final int depth = 123; StreamReadConstraints constraints = StreamReadConstraints.builder() + .maxDocumentLength(maxDocLen) .maxNumberLength(numLen) .maxStringLength(strLen) .maxNestingDepth(depth) .build(); try { StreamReadConstraints.overrideDefaultStreamReadConstraints(constraints); + assertEquals(maxDocLen, StreamReadConstraints.defaults().getMaxDocumentLength()); assertEquals(depth, StreamReadConstraints.defaults().getMaxNestingDepth()); assertEquals(strLen, StreamReadConstraints.defaults().getMaxStringLength()); assertEquals(numLen, StreamReadConstraints.defaults().getMaxNumberLength()); } finally { StreamReadConstraints.overrideDefaultStreamReadConstraints(null); + assertEquals(StreamReadConstraints.DEFAULT_MAX_DOC_LEN, + StreamReadConstraints.defaults().getMaxDocumentLength()); assertEquals(StreamReadConstraints.DEFAULT_MAX_DEPTH, StreamReadConstraints.defaults().getMaxNestingDepth()); assertEquals(StreamReadConstraints.DEFAULT_MAX_STRING_LEN,