From 51acb5abe367cd4d54c574c1fbbc82badfc70677 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sat, 26 Aug 2023 15:04:41 -0700 Subject: [PATCH] More test improvements --- .../jackson/core/testsupport/TestSupport.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/fasterxml/jackson/core/testsupport/TestSupport.java b/src/test/java/com/fasterxml/jackson/core/testsupport/TestSupport.java index 0f5355896f..e1a9e74dcc 100644 --- a/src/test/java/com/fasterxml/jackson/core/testsupport/TestSupport.java +++ b/src/test/java/com/fasterxml/jackson/core/testsupport/TestSupport.java @@ -18,17 +18,33 @@ public class TestSupport * Factory method for creating {@link IOContext}s for tests */ public static IOContext testIOContext() { - return new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(), - ErrorReportConfiguration.defaults(), - new BufferRecycler(), ContentReference.unknown(), false); + return testIOContext(StreamReadConstraints.defaults(), + StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults()); + } + + /** + * Factory method for creating {@link IOContext}s for tests + */ + public static IOContext testIOContext(StreamReadConstraints src) { + return testIOContext(src, + StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults()); } /** * Factory method for creating {@link IOContext}s for tests */ public static IOContext testIOContext(StreamWriteConstraints swc) { - return new IOContext(StreamReadConstraints.defaults(), swc, - ErrorReportConfiguration.defaults(), + return testIOContext(StreamReadConstraints.defaults(), + swc, + ErrorReportConfiguration.defaults()); + } + + private static IOContext testIOContext(StreamReadConstraints src, + StreamWriteConstraints swc, + ErrorReportConfiguration erc) { + return new IOContext(src, swc, erc, new BufferRecycler(), ContentReference.unknown(), false); } }