public void refresh(boolean shouldRefresh, boolean shouldDisable) { refreshDocks(shouldRefresh, shouldDisable); } }
protected TestWorkbenchDocksHandler createNewWorkbenchDocksHandler() { List<UberfireDock> docks = new ArrayList<>(); docks.add(new UberfireDock(UberfireDockPosition.EAST, "RANDOM", placeRequest, AUTHORING_PERSPECTIVE)); docks.add(new UberfireDock(UberfireDockPosition.EAST, "RANDOM", placeRequest, AUTHORING_PERSPECTIVE)); return new TestWorkbenchDocksHandler(docks); }
@Test public void testLoadHandler() { handler.refresh(true, false); verify(uberfireDocks, times(1)).hide(any(UberfireDockPosition.class), anyString()); //no other docks operations should have been invoked. verify(uberfireDocks).show(any(UberfireDockPosition.class), anyString()); verify(uberfireDocks, times(1)).add(any(), any()); }
@Test public void testLoadHandlerReloadingDocks() { testLoadHandler(); handler.refresh(true, false); verify(uberfireDocks).hide(UberfireDockPosition.EAST, "authoring"); }
@Test public void testLoadHandlerDisablingDocks() { testLoadHandler(); handler.refresh(true, true); verify(uberfireDocks, never()).remove(any(), any()); verify(uberfireDocks, times(1)).show(any(), any()); verify(uberfireDocks, times(1)).add(any(), any()); verify(uberfireDocks).show(UberfireDockPosition.EAST, "authoring"); // it's also disabled on setup! verify(uberfireDocks, times(2)).hide(any(), any()); }