use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class ExampleImportPresenterTest method filterProjectsTest.
@Test
public void filterProjectsTest() {
Set<ExampleProject> projects = new HashSet<>();
projects.add(new ExampleProject(mock(Path.class), "p1a", "p1a description", null));
projects.add(new ExampleProject(mock(Path.class), "p3b", "p3b description", null));
projects.add(new ExampleProject(mock(Path.class), "p2a", "p2a description", null));
doReturn(projects).when(libraryService).getExampleProjects();
Map<String, String> params = new HashMap<>();
params.put("repositoryUrl", "repoUrl");
importPresenter.onStartup(new DefaultPlaceRequest(LibraryPlaces.PROJECT_SCREEN, params));
final List<TileWidget> filteredProjects = importPresenter.filterProjects("a");
assertEquals(2, filteredProjects.size());
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class ExampleImportPresenterTest method onStartupWithoutProjectsTest.
@Test
public void onStartupWithoutProjectsTest() {
Map<String, String> params = new HashMap<>();
params.put("repositoryUrl", "repoUrl");
importPresenter.onStartup(new DefaultPlaceRequest(LibraryPlaces.PROJECT_SCREEN, params));
verify(view).hideBusyIndicator();
verify(notificationEvent).fire(any());
verify(libraryPlaces).goToLibrary();
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method goToLibraryFromOrganizationalUnitsScreenTest.
@Test
public void goToLibraryFromOrganizationalUnitsScreenTest() {
doReturn(Optional.of(activeOrganizationalUnit)).when(projectContext).getActiveOrganizationalUnit();
doReturn(Optional.empty()).when(projectContext).getActiveWorkspaceProject();
doReturn(Optional.empty()).when(projectContext).getActiveModule();
final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
libraryPlaces.goToLibrary();
verify(libraryPlaces).closeLibraryPlaces();
verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
verify(projectContextChangeEvent, times(1)).fire(any(WorkspaceProjectContextChangeEvent.class));
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method goToProjectMetricsTest.
@Test
public void goToProjectMetricsTest() {
final PlaceRequest projectScreen = new DefaultPlaceRequest(LibraryPlaces.PROJECT_METRICS_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(projectScreen);
part.setSelectable(false);
libraryPlaces.goToProjectMetrics();
verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
verify(projectMetricsEvent).fire(any(WorkbenchProjectMetricsEvent.class));
verify(libraryPlaces).setupLibraryBreadCrumbsForProjectMetrics();
}
use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method onSelectProjectTest.
@Test
public void onSelectProjectTest() {
doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
final DefaultPlaceRequest projectSettingsPlaceRequest = new DefaultPlaceRequest(LibraryPlaces.PROJECT_SCREEN);
final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
doReturn(projectSettingsPlaceRequest).when(placeGainFocusEvent).getPlace();
libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
verify(libraryPlaces).hideDocks();
verify(libraryPlaces).setupLibraryBreadCrumbs();
}
Aggregations