Skip to content

Commit be7c8e1

Browse files
committed
Update stream constraints test wrt jackson-core changes to allow longer String values
1 parent acb3143 commit be7c8e1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/java/com/fasterxml/jackson/databind/deser/dos/StreamReadStringConstraintsTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,31 @@ private ObjectMapper newJsonMapperWithUnlimitedStringSizeSupport() {
4444
public void testBigString() throws Exception
4545
{
4646
try {
47-
MAPPER.readValue(generateJson("string", 1001000), StringWrapper.class);
47+
MAPPER.readValue(generateJson("string", 5001000), StringWrapper.class);
4848
fail("expected JsonMappingException");
4949
} catch (DatabindException e) {
5050
assertTrue("unexpected exception message: " + e.getMessage(),
51-
e.getMessage().startsWith("String length (1001000) exceeds the maximum length (1000000)"));
51+
e.getMessage().startsWith("String length (5001000) exceeds the maximum length (5000000)"));
5252
}
5353
}
5454

5555
public void testBiggerString() throws Exception
5656
{
5757
try {
58-
MAPPER.readValue(generateJson("string", 2_000_000), StringWrapper.class);
58+
MAPPER.readValue(generateJson("string", 6_000_000), StringWrapper.class);
5959
fail("expected JsonMappingException");
6060
} catch (DatabindException e) {
6161
final String message = e.getMessage();
6262
// this test fails when the TextBuffer is being resized, so we don't yet know just how big the string is
63-
// so best not to assert that the String length value in the message is the full 2000000 value
63+
// so best not to assert that the String length value in the message is the full 6000000 value
6464
assertTrue("unexpected exception message: " + message, message.startsWith("String length"));
65-
assertTrue("unexpected exception message: " + message, message.contains("exceeds the maximum length (1000000)"));
65+
assertTrue("unexpected exception message: " + message, message.contains("exceeds the maximum length (5000000)"));
6666
}
6767
}
6868

6969
public void testUnlimitedString() throws Exception
7070
{
71-
final int len = 1_001_000;
71+
final int len = 5_001_000;
7272
StringWrapper sw = newJsonMapperWithUnlimitedStringSizeSupport()
7373
.readValue(generateJson("string", len), StringWrapper.class);
7474
assertEquals(len, sw.string.length());

0 commit comments

Comments
 (0)