@Test
public void checkOnLoadConfigMethod()
        throws Exception {

    ISectionStrategy strategy = new OnFeatureLoadingSectionProcessingStrategy();
    IObject config = new DSObject("{\"onFeatureLoading\": [\n" +
            "    {\n" +
            "      \"chain\": \"chain1\",\n" +
            "      \"messages\": [\n" +
            "        {\n" +
            "          \"key\": \"value1\"\n" +
            "        }\n" +
            "      ]\n" +
            "    },\n" +
            "    {\n" +
            "      \"chain\": \"chain2\",\n" +
            "      \"messages\": [\n" +
            "        {\n" +
            "          \"key\": \"value2\"\n" +
            "        },\n" +
            "        {\n" +
            "          \"key\": \"value3\"\n" +
            "        }\n" +
            "      ]\n" +
            "    }\n" +
            "  ]}");
    List<IObject> onFeatureLoadingConfigSection = (List<IObject>) config.getValue(new FieldName("onFeatureLoading"));
    IObject message11 = ((List<IObject>)onFeatureLoadingConfigSection.get(0).getValue(new FieldName("messages"))).get(0);
    IObject message21 = ((List<IObject>)onFeatureLoadingConfigSection.get(1).getValue(new FieldName("messages"))).get(0);
    IObject message22 = ((List<IObject>)onFeatureLoadingConfigSection.get(1).getValue(new FieldName("messages"))).get(1);
    this.chainMapIdResolveStrategy = mock(IResolveDependencyStrategy.class);
    Object mapId1 = mock(Object.class);
    Object mapId2 = mock(Object.class);
    IReceiverChain chain1 = mock(IReceiverChain.class);
    IReceiverChain chain2 = mock(IReceiverChain.class);
    when(this.chainMapIdResolveStrategy.resolve("chain1")).thenReturn(mapId1);
    when(this.chainMapIdResolveStrategy.resolve("chain2")).thenReturn(mapId2);
    IKey chainIdFromMapNameKey = Keys.getOrAdd("chain_id_from_map_name");
    IOC.register(chainIdFromMapNameKey,
            this.chainMapIdResolveStrategy);
    when(this.chainStorage.resolve(mapId1)).thenReturn(chain1);
    when(this.chainStorage.resolve(mapId2)).thenReturn(chain2);
    this.sequenceResolveStrategy = mock(IResolveDependencyStrategy.class);
    IKey sequenceKey = Keys.getOrAdd("info.smart_tools.smartactors.message_processing_interfaces.message_processing.IMessageProcessingSequence");
    this.sequence = mock(IMessageProcessingSequence.class);
    IOC.register(sequenceKey, this.sequenceResolveStrategy);
    when(this.sequenceResolveStrategy.resolve(this.stackDepth, chain1)).thenReturn(sequence);
    when(this.sequenceResolveStrategy.resolve(this.stackDepth, chain2)).thenReturn(sequence);
    strategy.onLoadConfig(config);
    verify(this.chainMapIdResolveStrategy, times(1)).resolve("chain1");
    verify(this.chainMapIdResolveStrategy, times(1)).resolve("chain2");
    verify(this.chainStorage, times(1)).resolve(mapId1);
    verify(this.chainStorage, times(1)).resolve(mapId2);
    verify(this.sequenceResolveStrategy, times(1)).resolve(this.stackDepth, chain1);
    verify(this.sequenceResolveStrategy, times(2)).resolve(this.stackDepth, chain2);
    verify(this.messageProcessor, times(1)).process(message11, this.context);
    verify(this.messageProcessor, times(1)).process(message21, this.context);
    verify(this.messageProcessor, times(1)).process(message22, this.context);
}