@Test
public void MustCorrectPrepare() throws ResolutionException, ReadValueException, InvalidArgumentException, TaskPrepareException, ChangeValueException {

    IObject query = mock(IObject.class);
    IObject queryForNestedTask  = mock(IObject.class);
    IObject filterObject = mock(IObject.class);
    IObject eqKeyObject = mock(IObject.class);
    IKey iObjectKey = mock(IKey.class);
    when(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject")).thenReturn(iObjectKey);
    when(IOC.resolve(iObjectKey)).thenReturn(queryForNestedTask).thenReturn(filterObject).thenReturn(eqKeyObject);
    String token = "token";
    when(tokenField.in(query)).thenReturn(token);
    String collectionName = "collectionName";
    when(collectionNameField.in(query)).thenReturn(collectionName);
    Object callback = mock(Object.class);
    when(callbackField.in(query)).thenReturn(callback);
    IKey searchTaskKey = mock(IKey.class);
    when(Keys.getOrAdd("db.collection.search")).thenReturn(searchTaskKey);
    when(IOC.resolve(searchTaskKey, connection, collectionName, queryForNestedTask, callback)).thenReturn(targetTask);
    testTask.prepare(query);
    verifyStatic(times(3));
    Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject");
    verifyStatic(times(3));
    IOC.resolve(iObjectKey);
    verify(tokenField).in(query);
    verify(equalsField).out(eqKeyObject, token);
    verify(tokenField).out(filterObject, eqKeyObject);
    verify(filterField).out(queryForNestedTask, filterObject);
    verifyStatic();
    Keys.getOrAdd("db.collection.search");
    verifyStatic();
    IOC.resolve(searchTaskKey, connection, collectionName, queryForNestedTask, callback);
}