use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.
the class KieEditorTest method testShowDiagramEditorDocks.
@Test
public void testShowDiagramEditorDocks() {
doReturn(Optional.of(mock(WorkspaceProject.class))).when(workbenchContext).getActiveWorkspaceProject();
PlaceRequest placeRequest = mock(PlaceRequest.class);
when(placeRequest.getIdentifier()).thenReturn(KieEditorFake.EDITOR_ID);
presenter.init(mock(ObservablePath.class), placeRequest, mock(ClientResourceType.class));
when(docks.isSetup()).thenReturn(false);
PerspectiveActivity perspectiveActivity = mock(PerspectiveActivity.class);
when(perspectiveActivity.getIdentifier()).thenReturn("perspectiveId");
when(perspectiveManager.getCurrentPerspective()).thenReturn(perspectiveActivity);
presenter.onShowDiagramEditorDocks(new PlaceGainFocusEvent(placeRequest));
verify(docks).setup(eq("perspectiveId"), placeRequestArgumentCaptor.capture());
assertEquals("org.kie.guvnor.explorer", placeRequestArgumentCaptor.getValue().getIdentifier());
verify(docks).show();
}
use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.
the class KieEditorTest method testShowDiagramEditorDocksInitDone.
@Test
public void testShowDiagramEditorDocksInitDone() {
doReturn(Optional.of(mock(WorkspaceProject.class))).when(workbenchContext).getActiveWorkspaceProject();
PlaceRequest placeRequest = mock(PlaceRequest.class);
when(placeRequest.getIdentifier()).thenReturn(KieEditorFake.EDITOR_ID);
presenter.init(mock(ObservablePath.class), placeRequest, mock(ClientResourceType.class));
when(docks.isSetup()).thenReturn(true);
PerspectiveActivity perspectiveActivity = mock(PerspectiveActivity.class);
when(perspectiveActivity.getIdentifier()).thenReturn("perspectiveId");
when(perspectiveManager.getCurrentPerspective()).thenReturn(perspectiveActivity);
presenter.onShowDiagramEditorDocks(new PlaceGainFocusEvent(placeRequest));
verify(docks, never()).setup(anyString(), any());
verify(docks).show();
}
use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project drools-wb by kiegroup.
the class BaseGuidedDecisionTableEditorPresenterTest method setupTheDocks.
@Test
public void setupTheDocks() {
final ObservablePath path = mock(ObservablePath.class);
final PlaceRequest placeRequest = mock(PlaceRequest.class);
doReturn(GuidedDecisionTableEditorPresenter.IDENTIFIER).when(placeRequest).getIdentifier();
final GuidedDecisionTableEditorContent content = makeDecisionTableContent();
makeDecisionTable(path, path, placeRequest, content);
doReturn("perspectiveId").when(currentPerspective).getIdentifier();
doReturn(false).when(docks).isSetup();
final GuidedDecisionTableView.Presenter activeDtable = mock(GuidedDecisionTableView.Presenter.class);
when(modeller.getActiveDecisionTable()).thenReturn(Optional.of(activeDtable));
presenter.onStartup(path, placeRequest);
presenter.onShowDiagramEditorDocks(new PlaceGainFocusEvent(placeRequest));
verify(docks).setup(eq("perspectiveId"), placeRequestArgumentCaptor.capture());
assertEquals("org.kie.guvnor.explorer", placeRequestArgumentCaptor.getValue().getIdentifier());
}
Aggregations