@Test
public void MustInCorrectResolveDependencyWhenNewFieldNameThrowException() throws Exception {

    BootstrapItem item = mock(BootstrapItem.class);
    whenNew(BootstrapItem.class).withArguments(bootstrapArgument).thenReturn(item);
    when(item.after(anyString())).thenReturn(item);
    plugin.load();
    verifyNew(BootstrapItem.class).withArguments(bootstrapArgument);
    verify(item).after("IOC");
    ArgumentCaptor<IPoorAction> iPoorActionArgumentCaptor = ArgumentCaptor.forClass(IPoorAction.class);
    verify(item).process(iPoorActionArgumentCaptor.capture());
    verify(bootstrap).add(item);
    IKey fieldNameKey = mock(IKey.class);
    when(Keys.getOrAdd(FieldName.class.getCanonicalName())).thenReturn(fieldNameKey);
    ResolveByNameIocStrategy createNewInstanceStrategy = mock(ResolveByNameIocStrategy.class);
    ArgumentCaptor<Function<Object[], Object>> targetFuncArgumentCaptor = ArgumentCaptor.forClass((Class) Function.class);
    whenNew(ResolveByNameIocStrategy.class).withArguments(targetFuncArgumentCaptor.capture()).thenReturn(createNewInstanceStrategy);
    iPoorActionArgumentCaptor.getValue().execute();
    verifyStatic();
    Keys.getOrAdd(FieldName.class.getCanonicalName());
    verifyNew(ResolveByNameIocStrategy.class).withArguments(targetFuncArgumentCaptor.getValue());
    verifyStatic();
    IOC.register(fieldNameKey, createNewInstanceStrategy);
    String fieldNameName = "asd";
    whenNew(FieldName.class).withArguments(fieldNameName).thenThrow(new InvalidArgumentException(""));
    try {
        targetFuncArgumentCaptor.getValue().apply(new Object[]{fieldNameName});
    } catch (RuntimeException e) {
        verifyNew(FieldName.class).withArguments(fieldNameName);
    }
}