From e5bdcfb31771c1e35ed69b1fc49e84ab5d1ac023 Mon Sep 17 00:00:00 2001 From: "Kim, Joo Hyuk" Date: Mon, 15 May 2023 09:06:35 +0900 Subject: [PATCH] Remove hard-coded `StreamReadConstraints` test variables to isolate change in `jackson-core` itself (#3930) --- .../jackson/databind/deser/dos/DeepJsonNodeDeser3397Test.java | 2 +- .../jackson/databind/deser/dos/DeepNestingUntypedDeserTest.java | 2 +- .../databind/deser/dos/StreamReadStringConstraintsTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepJsonNodeDeser3397Test.java b/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepJsonNodeDeser3397Test.java index f846453282..adbf3e051d 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepJsonNodeDeser3397Test.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepJsonNodeDeser3397Test.java @@ -13,7 +13,7 @@ public class DeepJsonNodeDeser3397Test extends BaseMapTest // ... currently gets a bit slow at 1M but passes. // But test with 100k as practical limit, to guard against regression // private final static int TOO_DEEP_NESTING = 1_000_000; - private final static int TOO_DEEP_NESTING = 10_000; + private final static int TOO_DEEP_NESTING = StreamReadConstraints.DEFAULT_MAX_DEPTH * 10; private final JsonFactory jsonFactory = JsonFactory.builder() .streamReadConstraints(StreamReadConstraints.builder().maxNestingDepth(Integer.MAX_VALUE).build()) diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepNestingUntypedDeserTest.java b/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepNestingUntypedDeserTest.java index 963040b9af..6389da8841 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepNestingUntypedDeserTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/dos/DeepNestingUntypedDeserTest.java @@ -18,7 +18,7 @@ public class DeepNestingUntypedDeserTest extends BaseMapTest // 31-May-2022, tatu: But no more! Can handle much much larger // nesting levels, bounded by memory usage not stack. Tested with // 1 million (!) nesting levels, but to keep tests fast use 100k - private final static int TOO_DEEP_NESTING = 100_000; + private final static int TOO_DEEP_NESTING = StreamReadConstraints.DEFAULT_MAX_DEPTH * 100; private final JsonFactory jsonFactory = JsonFactory.builder() .streamReadConstraints(StreamReadConstraints.builder().maxNestingDepth(Integer.MAX_VALUE).build()) diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/dos/StreamReadStringConstraintsTest.java b/src/test/java/com/fasterxml/jackson/databind/deser/dos/StreamReadStringConstraintsTest.java index ebc572f6ed..5224c0b57d 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/dos/StreamReadStringConstraintsTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/dos/StreamReadStringConstraintsTest.java @@ -32,7 +32,7 @@ void setString(String string) { /********************************************************************** */ - private final static int TOO_LONG_STRING_VALUE = 20_100_000; + private final static int TOO_LONG_STRING_VALUE = StreamReadConstraints.DEFAULT_MAX_STRING_LEN + 100; private final ObjectMapper MAPPER = newJsonMapper();