Skip to content

Commit 99c3d2b

Browse files
committed
...
1 parent ac4adfe commit 99c3d2b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/test/java/com/fasterxml/jackson/core/constraints/LargeDocReadTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,16 @@ public void testLargeNameWithSmallLimitAsync() throws Exception
5757
{
5858
final byte[] doc = utf8Bytes(generateJSON(25_000));
5959

60-
AsyncReaderWrapper p = asyncForBytes(JSON_F_DOC_10K, 1000, doc, 1);
61-
try {
60+
// first with byte[] backend
61+
try (AsyncReaderWrapper p = asyncForBytes(JSON_F_DOC_10K, 1000, doc, 1)) {
62+
consumeAsync(p);
63+
fail("expected StreamConstraintsException");
64+
} catch (StreamConstraintsException e) {
65+
verifyMaxDocLen(JSON_F_DOC_10K, e);
66+
}
67+
68+
// then with byte buffer
69+
try (AsyncReaderWrapper p = asyncForByteBuffer(JSON_F_DOC_10K, 1000, doc, 1)) {
6270
consumeAsync(p);
6371
fail("expected StreamConstraintsException");
6472
} catch (StreamConstraintsException e) {

0 commit comments

Comments
 (0)