UberfireDocksImpl implements UberfireDocks { public void perspectiveChangeEvent(@Observes PerspectiveChange perspectiveChange) { this.currentPerspective = perspectiveChange.getIdentifier(); updateAllDocks(); executeDelayedCommands(perspectiveChange.getIdentifier()); fireDockReadyEvent(); } @Inject  UberfireDocksImpl(DocksBars docksBars,
                             Event<UberfireDockReadyEvent> dockReadyEvent); @Override void add(UberfireDock... docks); void perspectiveChangeEvent(@Observes PerspectiveChange perspectiveChange); @Override void remove(UberfireDock... docks); @Override void open(UberfireDock dock); @Override void close(UberfireDock dock); @Override void toggle(UberfireDock dock); @Override void hide(UberfireDockPosition position,
                     String perspectiveName); @Override void show(UberfireDockPosition position,
                     String perspectiveName);  }
@Test public void perspectiveChangeEvent() { when(docksBars.isReady(any())).thenReturn(true); List<DocksBar> docksBars = generateDocksBars(); when(this.docksBars.getDocksBars()).thenReturn(docksBars); uberfireDocks.add(dock0, dock1); uberfireDocks.perspectiveChangeEvent(new PerspectiveChange(null, null, null, SOME_PERSPECTIVE)); assertEquals(SOME_PERSPECTIVE, uberfireDocks.currentPerspective); verify(this.docksBars, times(1)).clearAndHideAllDocks(); verify(this.docksBars, times(1)).addDock(dock0); verify(this.docksBars, times(1)).addDock(dock1); verify(this.docksBars, times(docksBars.size())).show(any(DocksBar.class)); }