Skip to content

Commit 665cf31

Browse files
committed
Add ReadAheadInputStreamTest.testAvailableAfterOpen()
1 parent bd706ae commit 665cf31

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/input/ReadAheadInputStreamTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
*/
1717
package org.apache.commons.io.input;
1818

19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
1921
import java.io.IOException;
2022
import java.io.InputStream;
2123
import java.nio.file.StandardOpenOption;
2224

2325
import org.junit.jupiter.api.BeforeEach;
26+
import org.junit.jupiter.api.Test;
2427

2528
/**
2629
* Tests {@link ReadAheadInputStream}.
@@ -58,4 +61,12 @@ public void setUp() throws IOException {
5861
ReadAheadInputStream.builder().setInputStream(new BufferedFileChannelInputStream(inputFile, 123)).setBufferSize(321).get(),
5962
ReadAheadInputStream.builder().setPath(inputFile).setOpenOptions(StandardOpenOption.READ).get() };
6063
}
64+
65+
@Test
66+
public void testAvailableAfterOpen() throws Exception {
67+
for (final InputStream inputStream : inputStreams) {
68+
assertEquals(0, inputStream.available());
69+
}
70+
}
71+
6172
}

0 commit comments

Comments
 (0)