@Test
public void Should_reSendMessageToChainChosenByIRCCS()
        throws Exception {

    IObject state = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            ("{" +
                    "'responsibleCheckpointId':'rcid'," +
                    "'entryId':'eid'," +
                    "'prevCheckpointEntryId':'pceid'," +
                    "'prevCheckpointId':'pcid'," +
                    "'message':{'is-a-message':true}" +
                    "}").replace('\'','"'));
    IMessageBusHandler messageBusHandler = mock(IMessageBusHandler.class);
    ScopeProvider.getCurrentScope().setValue(MessageBus.getMessageBusKey(), messageBusHandler);
    Object chainId = new Object();
    when(recoveryChainChoiceStrategy.chooseRecoveryChain(same(state))).thenReturn(chainId);
    new ReSendToChainRecoverStrategy(recoveryChainChoiceStrategy).reSend(state);
    ArgumentCaptor<IObject> mc = ArgumentCaptor.forClass(IObject.class);
    verify(messageBusHandler).handle(mc.capture(), same(chainId));
    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")));
}