@Test
public void testSliceWithByteSourceFailure() throws IOException {

    IOException mockFailure = new IOException("mock IOException");
    doThrow(mockFailure).when(mockByteSource).openStream();
    doThrow(mockFailure).when(mockByteSource).openBufferedStream();
    try (MessageSlicer slicer = newMessageSlicer("testSliceWithByteSourceFailure", 100)) {
        final boolean wasSliced = slice(slicer, IDENTIFIER, new BytesMessage(new byte[]{}), testProbe.ref(),
                testProbe.ref(), mockOnFailureCallback);
        assertFalse(wasSliced);
        assertFailureCallback(IOException.class);
        verify(mockFiledBackedStream).cleanup();
    }
}