### Question:
CaseManagementDiagramEditor extends AbstractProjectDiagramEditor<CaseManagementDiagramResourceType> { @OnOpen public void onOpen() { String currentPerspectiveIdentifier = perspectiveManager.getCurrentPerspective().getIdentifier(); Collection<UberfireDock> stunnerDocks = stunnerDocksHandler.provideDocks(currentPerspectiveIdentifier); stunnerDocks.stream() .filter(dock -> dock.getPlaceRequest().getIdentifier().compareTo(DiagramEditorPropertiesScreen.SCREEN_ID) == 0) .forEach(uberfireDocks::open); super.doOpen(); } @Inject  CaseManagementDiagramEditor(final AbstractProjectDiagramEditor.View view,
                                       final TextEditorView xmlEditorView,
                                       final ManagedInstance<SessionEditorPresenter<EditorSession>> editorSessionPresenterInstances,
                                       final ManagedInstance<SessionViewerPresenter<ViewerSession>> viewerSessionPresenterInstances,
                                       final Event<OnDiagramFocusEvent> onDiagramFocusEvent,
                                       final Event<OnDiagramLoseFocusEvent> onDiagramLostFocusEvent,
                                       final Event<NotificationEvent> notificationEvent,
                                       final ErrorPopupPresenter errorPopupPresenter,
                                       final DiagramClientErrorHandler diagramClientErrorHandler,
                                       final DocumentationView documentationView,
                                       final CaseManagementDiagramResourceType resourceType,
                                       final CaseManagementProjectEditorMenuSessionItems menuSessionItems,
                                       final ProjectMessagesListener projectMessagesListener,
                                       final ClientTranslationService translationService,
                                       final ClientProjectDiagramService projectDiagramServices,
                                       final Caller<ProjectDiagramResourceService> projectDiagramResourceServiceCaller,
                                       final Caller<CaseManagementSwitchViewService> caseManagementSwitchViewService,
                                       final UberfireDocks uberfireDocks,
                                       final StunnerDocksHandler stunnerDocksHandler); @Override void init(); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @Override String getEditorIdentifier(); @OnOpen void onOpen(); @OnClose @Override void onClose(); @OnFocus void onFocus(); @OnLostFocus void onLostFocus(); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @WorkbenchPartView IsWidget getWidget(); @OnMayClose boolean onMayClose(); @Override SessionEditorPresenter<EditorSession> newSessionEditorPresenter(); @Override void initialiseKieEditorForSession(ProjectDiagram diagram); static final String EDITOR_ID; }### Answer:
@Test public void testOnOpen() { Collection<UberfireDock> stunnerDocks = new ArrayList<>(); stunnerDocks.add(propertiesDock); stunnerDocks.add(explorerDock); String perspectiveIdentifier = "Test Perspective ID"; when(perspectiveManagerMock.getCurrentPerspective()).thenReturn(currentPerspective); when(currentPerspective.getIdentifier()).thenReturn(perspectiveIdentifier); when(stunnerDocksHandler.provideDocks(perspectiveIdentifier)).thenReturn(stunnerDocks); when(propertiesDock.getPlaceRequest()).thenReturn(propertiesPlace); when(propertiesPlace.getIdentifier()).thenReturn(DiagramEditorPropertiesScreen.SCREEN_ID); when(explorerDock.getPlaceRequest()).thenReturn(explorerPlace); when(explorerPlace.getIdentifier()).thenReturn(DiagramEditorExplorerScreen.SCREEN_ID); tested.onOpen(); verify(uberfireDocks, times(1)).open(propertiesDock); }