@Test
public void whenEnvironmentHandlerReceiveEnvironment_ItShouldProcessMessageProcessor()
        throws Exception {

    messageProcessor = mock(IMessageProcessor.class);
    IKey keyIMessageProcessor = Keys.getOrAdd("info.smart_tools.smartactors.message_processing_interfaces.message_processing.IMessageProcessor");
    IOC.register(
            keyIMessageProcessor,
            new SingletonStrategy(messageProcessor)
    );
    IObject iObject = IOC.resolve(Keys.getOrAdd("IObjectByString"), "{}");
    IKey keyIObject = Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject");
    IOC.register(
            keyIObject,
            new SingletonStrategy(iObject)
    );
    IObject environment = IOC.resolve(Keys.getOrAdd("IObjectByString"), "{\"message\": {\"hello\": \"world\"}, \"context\": {}}");
    Map<Class<? extends Throwable>, IObject> exceptionalChainsAndEnv = new HashMap<>();
      exceptionalChainsAndEnv.put(InvalidArgumentException.class, null);
    IMessageReceiver messageReceivers[] = new IMessageReceiver[1];
    IObject iObjects[] = new IObject[1];
    messageReceivers[0] = null;
    iObjects[0] = null;
    IReceiverChain chain = new ImmutableReceiverChain("name", mock(IObject.class), messageReceivers, iObjects, exceptionalChainsAndEnv);
    IQueue<ITask> queue = new BlockingQueue(null);
    IEnvironmentHandler handler = new EnvironmentHandler(queue, 1);
    handler.handle(environment, chain, null);
    try {
        verify(messageProcessor, times(1)).process(
                (IObject) environment.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "message")),
                (IObject) environment.getValue(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "context")));
    } catch (ReadValueException e) {
        e.printStackTrace();
    }
    Assert.assertTrue(((boolean) ((IObject)environment.getValue(new FieldName("context"))).getValue(new FieldName("fromExternal"))));
}