@Test
public void checkMessageHandleWithSpecificChainAndReply()
        throws Exception {

    IResolveDependencyStrategy sequenceStrategy = mock(IResolveDependencyStrategy.class);
    IOC.register(
            IOC.resolve(IOC.getKeyForKeyStorage(), "info.smart_tools.smartactors.message_processing_interfaces.message_processing.IMessageProcessingSequence"),
            sequenceStrategy
    );
    IResolveDependencyStrategy messageProcessorStrategy = mock(IResolveDependencyStrategy.class);
    IOC.register(
            IOC.resolve(IOC.getKeyForKeyStorage(), "info.smart_tools.smartactors.message_processing_interfaces.message_processing.IMessageProcessor"),
            messageProcessorStrategy
    );
    IResolveDependencyStrategy iobjectStrategy = mock(IResolveDependencyStrategy.class);
    IOC.register(
            IOC.resolve(IOC.getKeyForKeyStorage(), "info.smart_tools.smartactors.iobject.iobject.IObject"),
            iobjectStrategy
    );
    IResolveDependencyStrategy chainIdStrategy = mock(IResolveDependencyStrategy.class);
    IOC.register(
            IOC.resolve(IOC.getKeyForKeyStorage(), "chain_id_from_map_name"),
            chainIdStrategy
    );
    IResolveDependencyStrategy chainStorageStrategy = mock(IResolveDependencyStrategy.class);
    IOC.register(
            IOC.resolve(IOC.getKeyForKeyStorage(), IChainStorage.class.getCanonicalName()),
            chainStorageStrategy
    );
    IReceiverChain chain = mock(IReceiverChain.class);
    IMessageProcessingSequence sequence = mock(IMessageProcessingSequence.class);
    when(sequenceStrategy.resolve(1, chain)).thenReturn(sequence);
    IMessageProcessor processor = mock(IMessageProcessor.class);
    when(messageProcessorStrategy.resolve(this.queue, sequence)).thenReturn(processor);
    IObject context = mock(IObject.class);
    when(iobjectStrategy.resolve()).thenReturn(context);
    IObject message = mock(IObject.class);
    IAction finalAction = mock(IAction.class);
    Object replyToChainName = mock(Object.class);
    Object chainName = mock(Object.class);
    Object replyToChainId = mock(Object.class);
    Object chainId = mock(Object.class);
    IChainStorage storage = mock(IChainStorage.class);
    IReceiverChain replyToChain = mock(IReceiverChain.class);
    when(chainIdStrategy.resolve(replyToChainName)).thenReturn(replyToChainId);
    when(chainIdStrategy.resolve(chainName)).thenReturn(chainId);
    when(chainStorageStrategy.resolve()).thenReturn(storage);
    when(storage.resolve(replyToChainId)).thenReturn(replyToChain);
    when(storage.resolve(chainId)).thenReturn(chain);
    IMessageBusHandler handler = new MessageBusHandler(this.queue, 1, this.chain, finalAction);
    handler.handleForReply(message, chainName, replyToChainName);
    verify(sequenceStrategy, times(1)).resolve(1, chain);
    verify(messageProcessorStrategy, times(1)).resolve(this.queue, sequence);
    verify(iobjectStrategy, times(1)).resolve();
    verify(processor, times(1)).process(message, context);
    verify(context, times(1)).setValue(eq(new FieldName("finalActions")), any(List.class));
    verify(context, times(1)).setValue(new FieldName("messageBusReplyTo"), replyToChainName);
}