@Test
public void testSliceWithInputStreamFailure() throws IOException {

    doReturn(0).when(mockInputStream).read(any(byte[].class));
    try (MessageSlicer slicer = newMessageSlicer("testSliceWithInputStreamFailure", 2)) {
        final boolean wasSliced = slice(slicer, IDENTIFIER, new BytesMessage(new byte[]{}), testProbe.ref(),
                testProbe.ref(), mockOnFailureCallback);
        assertFalse(wasSliced);
        assertFailureCallback(IOException.class);
        verify(mockFiledBackedStream).cleanup();
    }
}