Source:
public void testAddAllDraggableGroups() { presenter.addDraggableGroups(Arrays.asList(new Group1LayoutComponentPaletteGroupProvider(true), new Group2LayoutComponentPaletteGroupProvider(), new Group3LayoutComponentPaletteGroupProvider())); verify(dragComponentGroupPresenter, times(3)).init(any()); verify(dragComponentGroupPresenter, times(3)).getView(); verify(dragComponentGroupView, times(1)).setExpanded(true); verify(dragComponentGroupView, times(2)).setExpanded(false); verify(view, times(3)).addDraggableComponentGroup(any()); assertEquals(3, presenter.getLayoutDragComponentGroups().size()); assertNotNull(presenter.getLayoutDragComponentGroups().get(Group1LayoutComponentPaletteGroupProvider.ID)); assertTrue(presenter.hasDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, Group1LayoutDragComponent1.ID)); assertTrue(presenter.hasDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, Group1LayoutDragComponent2.ID)); assertTrue(presenter.hasDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, Group1LayoutDragComponent3.ID)); assertNotNull(presenter.getLayoutDragComponentGroups().get(Group2LayoutComponentPaletteGroupProvider.ID)); assertTrue(presenter.hasDraggableComponent(Group2LayoutComponentPaletteGroupProvider.ID, Group2LayoutDragComponent1.ID)); assertTrue(presenter.hasDraggableComponent(Group2LayoutComponentPaletteGroupProvider.ID, Group2LayoutDragComponent2.ID)); assertNotNull(presenter.getLayoutDragComponentGroups().get(Group3LayoutComponentPaletteGroupProvider.ID)); assertTrue(presenter.hasDraggableComponent(Group3LayoutComponentPaletteGroupProvider.ID, Group3LayoutDragComponent1.ID)); LayoutDragComponent dragComponent = mock(LayoutDragComponent.class); presenter.addDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, DRAGGABLE_COMPONENT_NAME, dragComponent); verify(dragComponentGroupPresenter).addComponent(DRAGGABLE_COMPONENT_NAME, dragComponent); presenter.removeDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, DRAGGABLE_COMPONENT_NAME); verify(dragComponentGroupPresenter).removeComponent(DRAGGABLE_COMPONENT_NAME); }

Target:
public void testAddAllDraggableGroups() { presenter.addDraggableGroups(Arrays.asList(new Group1LayoutComponentPaletteGroupProvider(true), new Group2LayoutComponentPaletteGroupProvider(), new Group3LayoutComponentPaletteGroupProvider())); verify(dragComponentGroupPresenter, times(3)).init(any()); verify(dragComponentGroupPresenter, times(3)).getView(); verify(dragComponentGroupView).setExpanded(true); verify(dragComponentGroupView, times(2)).setExpanded(false); verify(view, times(3)).addDraggableComponentGroup(any()); assertEquals(3, presenter.getLayoutDragComponentGroups().size()); assertNotNull(presenter.getLayoutDragComponentGroups().get(Group1LayoutComponentPaletteGroupProvider.ID)); assertTrue(presenter.hasDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, Group1LayoutDragComponent1.ID)); assertTrue(presenter.hasDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, Group1LayoutDragComponent2.ID)); assertTrue(presenter.hasDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, Group1LayoutDragComponent3.ID)); assertNotNull(presenter.getLayoutDragComponentGroups().get(Group2LayoutComponentPaletteGroupProvider.ID)); assertTrue(presenter.hasDraggableComponent(Group2LayoutComponentPaletteGroupProvider.ID, Group2LayoutDragComponent1.ID)); assertTrue(presenter.hasDraggableComponent(Group2LayoutComponentPaletteGroupProvider.ID, Group2LayoutDragComponent2.ID)); assertNotNull(presenter.getLayoutDragComponentGroups().get(Group3LayoutComponentPaletteGroupProvider.ID)); assertTrue(presenter.hasDraggableComponent(Group3LayoutComponentPaletteGroupProvider.ID, Group3LayoutDragComponent1.ID)); LayoutDragComponent dragComponent = mock(LayoutDragComponent.class); presenter.addDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, DRAGGABLE_COMPONENT_NAME, dragComponent); verify(dragComponentGroupPresenter).addComponent(DRAGGABLE_COMPONENT_NAME, dragComponent); presenter.removeDraggableComponent(Group1LayoutComponentPaletteGroupProvider.ID, DRAGGABLE_COMPONENT_NAME); verify(dragComponentGroupPresenter).removeComponent(DRAGGABLE_COMPONENT_NAME); }