@Test
public void MustInCorrectPrepareWhenIOCResolveThrowException() throws ResolutionException, ReadValueException, InvalidArgumentException {

    IObject query = mock(IObject.class);
    String collectionName = "examplecn";
    Object document = mock(Object.class);
    when(collectionNameField.in(query)).thenReturn(collectionName);
    when(documentField.in(query)).thenReturn(document);
    IKey upsertTaskKey = mock(IKey.class);
    when(Keys.getOrAdd("db.collection.upsert")).thenReturn(upsertTaskKey);
    when(IOC.resolve(upsertTaskKey, connection, collectionName, document)).thenThrow(new ResolutionException(""));
    try {
        testTask.prepare(query);
    } catch (TaskPrepareException e) {
        verifyStatic();
        Keys.getOrAdd("db.collection.upsert");
        verify(collectionNameField).in(query);
        verify(documentField).in(query);
        verifyStatic();
        IOC.resolve(upsertTaskKey, connection, collectionName, document);
        return;
    }
    assertTrue(false);
}