testCloseHandleIOException() tags: [] uniqueId: [engine:junit-jupiter]/[class:org.apache.commons.io.input.ThrottledInputStreamTest]/[method:testCloseHandleIOException()] parent: [engine:junit-jupiter]/[class:org.apache.commons.io.input.ThrottledInputStreamTest] source: MethodSource [className = 'org.apache.commons.io.input.ThrottledInputStreamTest', methodName = 'testCloseHandleIOException', methodParameterTypes = ''] caught: org.mockito.exceptions.base.MockitoException: Cannot mock/spy class org.apache.commons.io.input.ThrottledInputStream Mockito cannot mock/spy because : - final class at org.apache.commons.io.input.ProxyInputStreamTest.testCloseHandleIOException(ProxyInputStreamTest.java:86) at org.apache.commons.io.input.ProxyInputStreamTest.testCloseHandleIOException(ProxyInputStreamTest.java:80) at org.apache.commons.io.input.ThrottledInputStreamTest.testCloseHandleIOException(ThrottledInputStreamTest.java:175) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) duration: 2 ms status: ✘ FAILED --- a/src/test/java/org/apache/commons/io/input/ThrottledInputStreamTest.java +++ b/src/test/java/org/apache/commons/io/input/ThrottledInputStreamTest.java @@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.ThrottledInputStream.Builder; import org.apache.commons.io.test.CustomIOException; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -170,6 +171,7 @@ class ThrottledInputStreamTest extends ProxyInputStreamTest