@Test
public void testCancelSlicing() throws IOException {

    doReturn(1).when(mockInputStream).read(any(byte[].class));
    final MessageSlicer slicer = newMessageSlicer("testCloseAllSlicedMessageState", 1);
    slicer.slice(SliceOptions.builder().identifier(IDENTIFIER).fileBackedOutputStream(mockFiledBackedStream)
            .sendTo(testProbe.ref()).replyTo(testProbe.ref()).onFailureCallback(mockOnFailureCallback).build());
    final FileBackedOutputStream mockFiledBackedStream2 = mock(FileBackedOutputStream.class);
    setupMockFiledBackedStream(mockFiledBackedStream2);
    slicer.slice(SliceOptions.builder().identifier(new StringIdentifier("test2"))
            .fileBackedOutputStream(mockFiledBackedStream2).sendTo(testProbe.ref()).replyTo(testProbe.ref())
            .onFailureCallback(mockOnFailureCallback).build());
    slicer.cancelSlicing(id -> id.equals(IDENTIFIER));
    verify(mockFiledBackedStream).cleanup();
    verify(mockFiledBackedStream2, never()).cleanup();
    verifyNoMoreInteractions(mockOnFailureCallback);
}