Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
Implement CountingServletOutputStream#close()
Browse files Browse the repository at this point in the history
  • Loading branch information
Trundle committed Oct 22, 2018
1 parent 0217d57 commit 5456078
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -50,6 +50,11 @@ public void write(final byte[] b, final int off, final int len) throws IOExcepti
outputStream.write(b, off, len);
}

@Override
public void close() throws IOException {
underlyingStream.close();
}

@Override
public void flush() throws IOException {
underlyingStream.flush();
Expand Down
Expand Up @@ -31,6 +31,13 @@ public void setUp() {
outputStream = new CountingServletOutputStream(delegate);
}

@Test
public void testThatCloseDelegates() throws IOException {
outputStream.close();

verify(delegate).close();
}

@Test
public void testThatFlushDelegates() throws IOException {
outputStream.flush();
Expand Down

0 comments on commit 5456078

Please sign in to comment.