@Test
public void Should_sendMessageWhenTaskExecuted()
        throws Exception {

    IObject state = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"),
            "{'entryId':'trust-methis-isa-guid', 'message':{'this is':'the message'}}".replace('\'','"'));
    ISchedulerEntry entry = new EntryImpl(state, strategy, storage, action, false);
    entry.scheduleNext(0);
    ArgumentCaptor<ITask> taskArgumentCaptor = ArgumentCaptor.forClass(ITask.class);
    ArgumentCaptor<IObject> iObjectArgumentCaptor = ArgumentCaptor.forClass(IObject.class);
    verify(timer).schedule(taskArgumentCaptor.capture(), eq(0L));
    IMessageBusHandler messageBusHandler = mock(IMessageBusHandler.class);
    ScopeProvider.getCurrentScope().setValue(MessageBus.getMessageBusKey(), messageBusHandler);
    taskArgumentCaptor.getValue().execute();
    verify(messageBusHandler).handle(iObjectArgumentCaptor.capture());
    verify(strategy).postProcess(same(entry));
    assertEquals("{'this is':'the message'}".replace('\'','"'), iObjectArgumentCaptor.getValue().serialize());
}