Always close the returned InputStream in ResponseDecoderTest#shouldDecodeValidTwoChunksGetBlobResponses
@@ -92,9 +92,11 @@ public class ResponseDecoderTest {
GetBlobResponse response = (GetBlobResponse) channel.readInbound();
assertEquals("blobId", response.getBlobId());
assertEquals(blobData.length, response.getLength());
- byte[] receivedData = IOUtils.toByteArray(response.getInputStream());
+ try (InputStream is = response.getInputStream()) {
+ byte[] receivedData = IOUtils.toByteArray(is);
assertArrayEquals(blobData, receivedData);
}
+ }
@Test
public void shouldDropInvalidGetBlobResponses() throws Exception {
