Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 7, 2023
1 parent ac4adfe commit 99c3d2b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 99c3d2b

Please sign in to comment.