Skip to content

Commit 10c506d

Browse files
committed
Refactor test
1 parent 1a2cfc8 commit 10c506d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ protected T createFixture() throws IOException {
8282
return (T) new ProxyInputStreamFixture(createOriginInputStream());
8383
}
8484

85+
@SuppressWarnings("unchecked")
86+
protected T createFixture(final InputStream proxy) {
87+
return (T) new ProxyInputStreamFixture(proxy);
88+
}
89+
8590
protected InputStream createOriginInputStream() {
8691
return CharSequenceInputStream.builder().setCharSequence("abc").get();
8792
}
@@ -114,7 +119,7 @@ public void testAvailableAll() throws IOException {
114119

115120
@Test
116121
public void testAvailableNull() throws IOException {
117-
try (ProxyInputStreamFixture inputStream = new ProxyInputStreamFixture(null)) {
122+
try (T inputStream = createFixture(null)) {
118123
assertEquals(0, inputStream.available());
119124
inputStream.setIn(createFixture());
120125
assertEquals(3, inputStream.available());

0 commit comments

Comments
 (0)