@Test
public void Should_recoverMessageProcessingSequence()
        throws Exception {

    IObject state = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            ("{" +
                    "'responsibleCheckpointId':'rcid'," +
                    "'entryId':'eid'," +
                    "'prevCheckpointEntryId':'pceid'," +
                    "'prevCheckpointId':'pcid'," +
                    "'sequenceDump':'This is a sequence dump. Trust me I am IObject.'," +
                    "'message':{'is-a-message':true}" +
                    "}").replace('\'','"'));
    IResolveDependencyStrategy recoverSequenceStrategy = mock(IResolveDependencyStrategy.class);
    IResolveDependencyStrategy messageProcessorStrategy = mock(IResolveDependencyStrategy.class);
    IMessageProcessingSequence sequenceMock = mock(IMessageProcessingSequence.class);
    IMessageProcessor processorMock = mock(IMessageProcessor.class);
    Object taskQueue = new Object();
    IOC.register(Keys.getOrAdd("recover message processing sequence"), recoverSequenceStrategy);
    IOC.register(Keys.getOrAdd("info.smart_tools.smartactors.message_processing_interfaces.message_processing.IMessageProcessor"), messageProcessorStrategy);
    IOC.register(Keys.getOrAdd("task_queue"), new SingletonStrategy(taskQueue));
    when(recoverSequenceStrategy.resolve(eq("This is a sequence dump. Trust me I am IObject."))).thenReturn(sequenceMock);
    when(messageProcessorStrategy.resolve(same(taskQueue), same(sequenceMock))).thenReturn(processorMock);
    new ReSendRestoringSequenceRecoverStrategy().reSend(state);
    ArgumentCaptor<IObject> mc = ArgumentCaptor.forClass(IObject.class);
    verify(processorMock).process(mc.capture(), any());
    assertNotNull(mc.getValue());
    assertEquals(true, mc.getValue().getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "is-a-message")));
    IObject checkpointStatus =
            (IObject) mc.getValue().getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "checkpointStatus"));
    assertNotNull(checkpointStatus);
    assertEquals("rcid",
            checkpointStatus.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "responsibleCheckpointId")));
    assertEquals("eid",
            checkpointStatus.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "checkpointEntryId")));
    assertEquals("pceid",
            checkpointStatus.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "prevCheckpointEntryId")));
    assertEquals("pcid",
            checkpointStatus.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "prevCheckpointId")));
}