@Test
public void Should_interruptMessageProcessingWhenEntryIsPresent()
        throws Exception {

    IObject args = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            ("{" +
                    "'connectionOptionsDependency':'the connection options'," +
                    "'connectionPoolDependency':'the connection pool'," +
                    "'collectionName':'" + collectionName + "'" +
                    "}").replace('\'','"'));
    CheckpointActor actor = new CheckpointActor(args);
    IObject status = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            ("{" +
                    "'responsibleCheckpointId':'prevCp'," +
                    "'checkpointEntryId':'prevId'" +
                    "}").replace('\'','"'));
    ISchedulerEntry oldEntry = entryMock[2];
    when(oldEntry.getId()).thenReturn("newIdPresent");
    when(oldEntry.getState()).thenReturn(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            ("{" +
                    "'prevCheckpointId':'prevCp'," +
                    "'prevCheckpointEntryId':'prevId'" +
                    "}").replace('\'','"')));
    observer.onUpdateEntry(oldEntry);
    when(enteringMessageMock.getCheckpointId()).thenReturn("thisCp");
    when(enteringMessageMock.getCheckpointStatus()).thenReturn(status);
    when(enteringMessageMock.getMessage()).thenReturn(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject")));
    when(enteringMessageMock.getProcessor()).thenReturn(messageProcessorMock);
    when(enteringMessageMock.getRecoverConfiguration()).thenReturn(mock(IObject.class));
    when(enteringMessageMock.getSchedulingConfiguration()).thenReturn(mock(IObject.class));
    when(newEntryStrategyMock.resolve(objectsArgumentCaptor.capture())).thenReturn(entryMock[0]);
    when(entryMock[0].getId()).thenReturn("entry0");
    actor.enter(enteringMessageMock);
    verify(messageProcessingSequenceMock).end();
}