garydgregory commented on a change in pull request #327:
URL: https://github.com/apache/commons-io/pull/327#discussion_r807841780
##########
File path:
src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTest.java
##########
@@ -350,6 +353,31 @@ public void testWriteZero(final String baosName, final
BAOSFactory<?> baosFactor
}
}
+ @ParameterizedTest(name = "[{index}] {0}")
+ @ValueSource(ints = {1024, 64})
+ public void testPrivateFieldOfCurrentBufferIndex(int size) throws
NoSuchFieldException, IllegalAccessException {
+ // Use the default size and custom size.
+ final ByteArrayOutputStream os = new ByteArrayOutputStream(size);
+
+ // Get private field object.
+ final Field field =
AbstractByteArrayOutputStream.class.getDeclaredField("currentBufferIndex");
Review comment:
@code-ferry
Thank you for your update .
You'll want to use Mockito for this kind of testing, it is already a
dependency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]