File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/io/input Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
2020import static org .junit .jupiter .api .Assertions .assertEquals ;
2121import static org .junit .jupiter .api .Assertions .assertThrows ;
22+ import static org .junit .jupiter .api .Assertions .assertTrue ;
2223
2324import java .io .ByteArrayInputStream ;
2425import java .io .IOException ;
3334 */
3435public class ChecksumInputStreamTest {
3536
37+ @ SuppressWarnings ("resource" )
38+ @ Test
39+ public void testAvailable () throws Exception {
40+ final InputStream shadow ;
41+ try (InputStream in = ChecksumInputStream .builder ().setCharSequence ("Hi" ).get ()) {
42+ assertTrue (in .available () > 0 );
43+ shadow = in ;
44+ }
45+ assertEquals (0 , shadow .available ());
46+ }
47+
3648 @ Test
3749 public void testDefaultThresholdFailure () throws IOException {
3850 final byte [] byteArray = new byte [3 ];
You can’t perform that action at this time.
0 commit comments