}
@Test
public void testNegative() throws Exception
{
DependencyItem dependencyItem = createDependencyItem();
JavaEEModule module = mock(JavaEEModule.class);
when(module.getApplication()).thenReturn(null);
ControllerContext installedContext = mock(ControllerContext.class);
String name = JavaEEComponentHelper.createObjectName(module, "SomeUnit", "Test2");
when(installedContext.getName()).thenReturn(name);
Set<ControllerContext> installedContexts = new HashSet<ControllerContext>();
installedContexts.add(installedContext);
Controller controller = mock(Controller.class);
when(controller.getContextsByState(ControllerState.INSTALLED)).thenReturn(installedContexts);
boolean resolved = dependencyItem.resolve(controller);
assertFalse(resolved);
assertFalse(dependencyItem.isResolved());
}