@Test
public void MustInCorrectResolveWhenNewCloseAsyncOperationActorThrowException() throws Exception {

    BootstrapItem bootstrapItem = mock(BootstrapItem.class);
    whenNew(BootstrapItem.class).withArguments("CloseAsyncOperationActorPlugin").thenReturn(bootstrapItem);
    when(bootstrapItem.after(anyString())).thenReturn(bootstrapItem);
    when(bootstrapItem.before(anyString())).thenReturn(bootstrapItem);
    plugin.load();
    verifyNew(BootstrapItem.class).withArguments("CloseAsyncOperationActorPlugin");
    ArgumentCaptor<IPoorAction> actionArgumentCaptor = ArgumentCaptor.forClass(IPoorAction.class);
    //verify(bootstrapItem).after("IOC");
    verify(bootstrapItem).process(actionArgumentCaptor.capture());
    verify(bootstrap).add(bootstrapItem);
    IKey checkUserByEmailActorKey = mock(IKey.class);
    when(Keys.getOrAdd(CloseAsyncOperationActor.class.getCanonicalName())).thenReturn(checkUserByEmailActorKey);
    ArgumentCaptor<Function> targetFuncArgumentCaptor = ArgumentCaptor.forClass((Class) Function.class);
    CreateNewInstanceStrategy createNewInstanceStrategy = mock(CreateNewInstanceStrategy.class);
    whenNew(CreateNewInstanceStrategy.class)
            .withArguments(targetFuncArgumentCaptor.capture())
            .thenReturn(createNewInstanceStrategy);
    actionArgumentCaptor.getValue().execute();
    verifyStatic();
    Keys.getOrAdd(CloseAsyncOperationActor.class.getCanonicalName());
    verifyStatic();
    IOC.register(checkUserByEmailActorKey, createNewInstanceStrategy);
    IObject actorParams = mock(IObject.class);
    whenNew(CloseAsyncOperationActor.class).withArguments(actorParams).thenThrow(new InvalidArgumentException(""));
    try {
        targetFuncArgumentCaptor.getValue().apply(new Object[]{actorParams});
    } catch (RuntimeException e) {
        verifyNew(CloseAsyncOperationActor.class).withArguments(actorParams);
        return;
    }
    assertTrue("Must throw exception", false);
}