@Test
public void ShouldDeleteObject() throws Exception {

    IObject query = mock(IObject.class);
    IObject deleteQuery = mock(IObject.class);
    IKey keyIObject = mock(IKey.class);
    when(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject")).thenReturn(keyIObject);
    when(IOC.resolve(keyIObject)).thenReturn(deleteQuery);
    IDatabaseTask deleteTask = mock(IDatabaseTask.class);
    IKey keyTask = mock(IKey.class);
    when(Keys.getOrAdd("db.cached_collection.delete")).thenReturn(keyTask);
    when(IOC.resolve(eq(keyTask), any(), eq(collectionName), eq(query))).thenReturn(deleteTask);
    when(specificKeyNameField.in(query)).thenReturn("key");
    collection.delete(query);
    verify(deleteTask).execute();
}