Skip to content

Commit

Permalink
Add TeeInputStreamTest.testCloseHandleIOException()
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 14, 2024
1 parent ab48680 commit 5477058
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ public void testCloseBranchIOException() throws Exception {
verify(goodIs, times(2)).close();
}

@SuppressWarnings({ "resource" })
@Test
public void testCloseHandleIOException() throws IOException {
ProxyInputStreamTest
.testCloseHandleIOException(new TeeInputStream(new BrokenInputStream((Throwable) new IOException()), new ByteArrayOutputStream(), false));
ProxyInputStreamTest
.testCloseHandleIOException(new TeeInputStream(new BrokenInputStream((Throwable) new IOException()), new ByteArrayOutputStream(), true));
}

/**
* Tests that the branch {@code OutputStream} is closed when closing the main {@code InputStream} throws an
* exception on {@link TeeInputStream#close()}, if specified to do so.
Expand Down

0 comments on commit 5477058

Please sign in to comment.