@Test
public void checkCreationAndExecution()
        throws Exception {

    IOC.register(
            IOC.resolve(IOC.getKeyForKeyStorage(), "info.smart_tools.smartactors.iobject.ifield_name.IFieldName"),
            new ResolveByNameIocStrategy(
                    (a) -> {
                        try {
                            return new FieldName((String) a[0]);
                        } catch (Throwable e) {
                            throw new RuntimeException("Could not create new instance of FieldName", e);
                        }
                    }
            )
    );
    IField field = mock(IField.class);
    IOC.register(
            IOC.resolve(IOC.getKeyForKeyStorage(), IField.class.getCanonicalName()),
            new ResolveByNameIocStrategy(
                    (a) -> {
                        return field;
                    }
            )
    );
    // register receiver generator
    IResolveDependencyStrategy rgs = mock(IResolveDependencyStrategy.class);
    IReceiverGenerator rg = mock(IReceiverGenerator.class);
    IOC.register(Keys.getOrAdd(IReceiverGenerator.class.getCanonicalName()), rgs);
    when(rgs.resolve()).thenReturn(rg);
    IMessageReceiver mr = mock(IMessageReceiver.class);
    when(rg.generate(any(CustomActor.class), any(IResolveDependencyStrategy.class), any(String.class))).thenReturn(mr);
    IObject objectSection = mock(IObject.class);
    when(objectSection.getValue(new FieldName("name"))).thenReturn("actorID");
    when(objectSection.getValue(new FieldName("dependency"))).thenReturn("createSampleActorStrategy");
    IResolveDependencyStrategy createSampleActorStrategy = mock(IResolveDependencyStrategy.class);
    IOC.register(Keys.getOrAdd("createSampleActorStrategy"), createSampleActorStrategy);
    ConstructorWrapperImpl wrapperImpl = new ConstructorWrapperImpl();
    CustomActor a = new CustomActor(wrapperImpl);
    when(createSampleActorStrategy.resolve(objectSection))
            .thenReturn(a);
    ActorReceiverCreator arc = new ActorReceiverCreator();
    IRouter router = new Router();
    arc.createObject(router, objectSection);
    assertEquals(((Router) router).map.size(), 1);
    IMessageReceiver actorReceiver = router.route("actorID");
    assertSame(actorReceiver.getClass(), ActorReceiver.class);
    // mock IMessageProcessor, IMessageProcessingSequence, IObject as current sequence
    IMessageProcessor processor = mock(IMessageProcessor.class);
    IMessageProcessingSequence sequence = mock(IMessageProcessingSequence.class);
    IObject currentSequence = mock(IObject.class);
    IObject env = mock(IObject.class);
    when(processor.getEnvironment()).thenReturn(env);
    when(processor.getSequence()).thenReturn(sequence);
    when(sequence.getCurrentReceiverArguments()).thenReturn(currentSequence);
    // configure mock of field
    when(field.in(currentSequence)).thenReturn("getSomeValue");
    // configure handler message receiver mock
    doNothing().when(mr).receive(processor);
    actorReceiver.receive(processor);
    verify(mr, times(1)).receive(processor);
    verify(createSampleActorStrategy, times(1)).resolve(objectSection);
    verify(rg, times(1)).generate(
            any(CustomActor.class),
            any(IResolveDependencyStrategy.class),
            any(String.class)
    );
    verify(objectSection, times(1)).getValue(new FieldName("name"));
    verify(objectSection, times(1)).getValue(new FieldName("dependency"));
}