diff --git a/src/test/java/tools/jackson/core/testsupport/TestSupport.java b/src/test/java/tools/jackson/core/testsupport/TestSupport.java index 1925938fd2..0eec1b3dc9 100644 --- a/src/test/java/tools/jackson/core/testsupport/TestSupport.java +++ b/src/test/java/tools/jackson/core/testsupport/TestSupport.java @@ -7,8 +7,6 @@ /** * Container for various factories needed by (unit) tests. - * - * @since 2.16 */ public class TestSupport { @@ -16,18 +14,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, - JsonEncoding.UTF8); + 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, JsonEncoding.UTF8); }