@Test public void registerAndUnregisterDropControllers() { wrapper.registerDropController(workbenchPanelView, dropController); assertEquals(wrapper.dropControllerMap.get(workbenchPanelView), dropController); WorkbenchPanelView workbenchPanelView2 = GWT.create(WorkbenchPanelView.class); DropController dropController2 = GWT.create(DropController.class); wrapper.registerDropController(workbenchPanelView2, dropController2); assertEquals(wrapper.dropControllerMap.get(workbenchPanelView2), dropController2); wrapper.unregisterDropControllers(); verify(factory, Mockito.times(1)).destroy(dropController); verify(factory, Mockito.times(1)).destroy(dropController2); verify(dragController).unregisterDropController(dropController); verify(dragController).unregisterDropController(dropController2); assertTrue(wrapper.dropControllerMap.isEmpty()); } }
@Test public void registerAndUnregisterDropControllers() { wrapper.registerDropController(workbenchPanelView, dropController); assertEquals(wrapper.dropControllerMap.get(workbenchPanelView), dropController); WorkbenchPanelView workbenchPanelView2 = GWT.create(WorkbenchPanelView.class); DropController dropController2 = GWT.create(DropController.class); wrapper.registerDropController(workbenchPanelView2, dropController2); assertEquals(wrapper.dropControllerMap.get(workbenchPanelView2), dropController2); wrapper.unregisterDropControllers(); verify(factory, Mockito.times(1)).destroy(dropController); verify(factory, Mockito.times(1)).destroy(dropController2); verify(dragController).unregisterDropController(dropController); verify(dragController).unregisterDropController(dropController2); assertTrue(wrapper.dropControllerMap.isEmpty()); } }