@Test
public void Should_createNewEntryForNewEnteringMessage()
        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 message = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            "{'theUniqueAndVeryImportantField':'42'}".replace('\'','"'));
    when(enteringMessageMock.getCheckpointId()).thenReturn("thisCp");
    when(enteringMessageMock.getCheckpointStatus()).thenReturn(null);
    when(enteringMessageMock.getMessage()).thenReturn(message);
    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(newEntryStrategyMock).resolve(any(), any());
    assertSame(storageMock, objectsArgumentCaptor.getAllValues().get(1));
    IObject entryArgs = (IObject) objectsArgumentCaptor.getAllValues().get(0);
    assertSame(enteringMessageMock.getRecoverConfiguration(),
            entryArgs.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "recover")));
    assertSame(enteringMessageMock.getSchedulingConfiguration(),
            entryArgs.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "scheduling")));
    assertEquals("checkpoint scheduler action",
            entryArgs.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "action")));
    assertEquals("42",
            ((IObject) entryArgs.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "message")))
                .getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "theUniqueAndVeryImportantField")));
    assertNotSame(message, entryArgs.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "message")));
    assertSame(messageProcessorMock, entryArgs.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "processor")));
    verify(enteringMessageMock).setCheckpointStatus(iObjectArgumentCaptor.capture());
    IObject newCS = iObjectArgumentCaptor.getValue();
    assertEquals("thisCp", newCS.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "responsibleCheckpointId")));
    assertEquals("entry0", newCS.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "checkpointEntryId")));
}