diff --git a/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/stream/BufferedChannelImageInputStreamTest.java b/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/stream/BufferedChannelImageInputStreamTest.java index 579f13e6..417e0ce4 100755 --- a/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/stream/BufferedChannelImageInputStreamTest.java +++ b/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/stream/BufferedChannelImageInputStreamTest.java @@ -46,7 +46,9 @@ import java.util.Random; import static com.twelvemonkeys.imageio.stream.BufferedImageInputStreamTest.rangeEquals; import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.only; +import static org.mockito.Mockito.verify; /** * BufferedFileImageInputStreamTestCase @@ -399,19 +401,11 @@ public class BufferedChannelImageInputStreamTest { } } - @Test - public void testCloseStream() throws IOException { - // Create wrapper stream - FileInputStream input = spy(new FileInputStream(randomDataToFile(new byte[0]))); - ImageInputStream stream = new BufferedChannelImageInputStream(input); - reset(input); - - stream.close(); - verify(input, only()).close(); - } - @Test public void testCloseChannel() throws IOException { + // NOTE: As the stream-based constructor is chained to the channel-based one, + // we'll rely on the fact that closing the channel will close the stream. + SeekableByteChannel mock = mock(SeekableByteChannel.class); ImageInputStream stream = new BufferedChannelImageInputStream(mock);