Skip to content

Commit f376f3b

Browse files
committed
org.apache.commons.io.input.BoundedInputStreamTest.testBuilderGet()
1 parent a4619d8 commit f376f3b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static org.junit.jupiter.api.Assertions.assertEquals;
2020
import static org.junit.jupiter.api.Assertions.assertFalse;
21+
import static org.junit.jupiter.api.Assertions.assertThrows;
2122
import static org.junit.jupiter.api.Assertions.assertTrue;
2223

2324
import java.io.ByteArrayInputStream;
@@ -39,16 +40,21 @@ private void compare(final String msg, final byte[] expected, final byte[] actua
3940
}
4041
}
4142

43+
@Test
44+
public void testBuilderGet() {
45+
// java.lang.IllegalStateException: origin == null
46+
assertThrows(IllegalStateException.class, () -> BoundedInputStream.builder().get());
47+
}
48+
4249
@SuppressWarnings("deprecation")
4350
@Test
4451
public void testOnMaxLength() throws Exception {
45-
BoundedInputStream bounded;
4652
final byte[] helloWorld = "Hello World".getBytes(StandardCharsets.UTF_8);
4753
final byte[] hello = "Hello".getBytes(StandardCharsets.UTF_8);
4854
final AtomicBoolean boolRef = new AtomicBoolean();
4955

5056
// limit = length
51-
bounded = new BoundedInputStream(new ByteArrayInputStream(helloWorld), helloWorld.length) {
57+
BoundedInputStream bounded = new BoundedInputStream(new ByteArrayInputStream(helloWorld), helloWorld.length) {
5258
@Override
5359
protected void onMaxLength(final long max, final long readCount) {
5460
boolRef.set(true);

0 commit comments

Comments
 (0)