From 99c3d2b0c0587663101f1c9179c7d3a4fe03931b Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Wed, 6 Sep 2023 21:00:41 -0700 Subject: [PATCH] ... --- .../jackson/core/constraints/LargeDocReadTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/fasterxml/jackson/core/constraints/LargeDocReadTest.java b/src/test/java/com/fasterxml/jackson/core/constraints/LargeDocReadTest.java index e24ed8928c..8a7ad2971c 100644 --- a/src/test/java/com/fasterxml/jackson/core/constraints/LargeDocReadTest.java +++ b/src/test/java/com/fasterxml/jackson/core/constraints/LargeDocReadTest.java @@ -57,8 +57,16 @@ public void testLargeNameWithSmallLimitAsync() throws Exception { final byte[] doc = utf8Bytes(generateJSON(25_000)); - AsyncReaderWrapper p = asyncForBytes(JSON_F_DOC_10K, 1000, doc, 1); - try { + // first with byte[] backend + try (AsyncReaderWrapper p = asyncForBytes(JSON_F_DOC_10K, 1000, doc, 1)) { + consumeAsync(p); + fail("expected StreamConstraintsException"); + } catch (StreamConstraintsException e) { + verifyMaxDocLen(JSON_F_DOC_10K, e); + } + + // then with byte buffer + try (AsyncReaderWrapper p = asyncForByteBuffer(JSON_F_DOC_10K, 1000, doc, 1)) { consumeAsync(p); fail("expected StreamConstraintsException"); } catch (StreamConstraintsException e) {