@Test
public void Should_createImmutableReceiverChains()
        throws Exception {

    IObject description = mock(IObject.class);
    List<IObject> steps = new LinkedList<>();
    List<IObject> exceptionals = new LinkedList<>();
    Object chainId = "chain";
    IReceiverChain exceptionalChain1 = mock(IReceiverChain.class);
    IReceiverChain exceptionalChain2 = mock(IReceiverChain.class);
    IMessageReceiver receiver1 = mock(IMessageReceiver.class);
    IMessageReceiver receiver2 = mock(IMessageReceiver.class);
    IObject step1 = mock(IObject.class);
    IObject step2 = mock(IObject.class);
    when(description.getValue(same(IOC.resolve(fieldNameKey, "steps")))).thenReturn(steps);
    when(description.getValue(same(IOC.resolve(fieldNameKey, "exceptional")))).thenReturn(exceptionals);
    steps.add(step1);
    steps.add(step2);
    IObject exceptional1 = mock(IObject.class);
    when(exceptional1.getValue(same(IOC.resolve(fieldNameKey, "class")))).thenReturn(Exception.class.getCanonicalName());
    when(exceptional1.getValue(same(IOC.resolve(fieldNameKey, "chain")))).thenReturn("ex_ch1");
    IObject exceptional2 = mock(IObject.class);
    when(exceptional2.getValue(same(IOC.resolve(fieldNameKey, "class")))).thenReturn(Error.class.getCanonicalName());
    when(exceptional2.getValue(same(IOC.resolve(fieldNameKey, "chain")))).thenReturn("ex_ch2");
    when(chainStorageMock.resolve("ex_ch_1id")).thenReturn(exceptionalChain1);
    when(chainStorageMock.resolve("ex_ch_2id")).thenReturn(exceptionalChain2);
    exceptionals.add(exceptional1);
    exceptionals.add(exceptional2);
    when(IOC.resolve(same(chainIdKey), eq("ex_ch1"))).thenReturn("ex_ch_1id");
    when(IOC.resolve(same(chainIdKey), eq("ex_ch2"))).thenReturn("ex_ch_2id");
    when(IOC.resolve(same(receiverIdKey), same(step1))).thenReturn("rec1");
    when(IOC.resolve(same(receiverIdKey), same(step2))).thenReturn("rec2");
    when(routerMock.route("rec1")).thenReturn(receiver1);
    when(routerMock.route("rec2")).thenReturn(receiver2);
    IReceiverChain chain = new ImmutableReceiverChainResolutionStrategy().resolve(chainId, description, chainStorageMock, routerMock);
    assertNotNull(chain);
}