Search in sources :

Example 1 with SocialFileSelectedEvent

use of org.ext.uberfire.social.activities.model.SocialFileSelectedEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method testOnSocialFileSelected_Repository.

@Test
public void testOnSocialFileSelected_Repository() {
    doReturn(mock(WorkspaceProject.class)).when(projectService).resolveProject(any(Path.class));
    doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
    final SocialFileSelectedEvent event = new SocialFileSelectedEvent(ExtendedTypes.NEW_REPOSITORY_EVENT.name(), null);
    libraryPlaces.onSocialFileSelected(event);
    verify(placeManager).goTo(LibraryPlaces.REPOSITORY_STRUCTURE_SCREEN);
}
Also used : ObservablePath(org.uberfire.backend.vfs.ObservablePath) Path(org.uberfire.backend.vfs.Path) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) SocialFileSelectedEvent(org.ext.uberfire.social.activities.model.SocialFileSelectedEvent) Test(org.junit.Test)

Example 2 with SocialFileSelectedEvent

use of org.ext.uberfire.social.activities.model.SocialFileSelectedEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method testOnSocialFileSelected_Module.

@Test
public void testOnSocialFileSelected_Module() {
    doReturn(mock(WorkspaceProject.class)).when(projectService).resolveProject(any(Path.class));
    doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
    final PlaceRequest libraryPerspective = libraryPlaces.getLibraryPlaceRequestWithoutRefresh();
    final SocialFileSelectedEvent event = new SocialFileSelectedEvent(ModuleEventType.NEW_MODULE.name(), null);
    libraryPlaces.onSocialFileSelected(event);
    verify(placeManager).goTo(libraryPerspective);
    verify(libraryPlaces).goToProject();
}
Also used : ObservablePath(org.uberfire.backend.vfs.ObservablePath) Path(org.uberfire.backend.vfs.Path) PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) SocialFileSelectedEvent(org.ext.uberfire.social.activities.model.SocialFileSelectedEvent) Test(org.junit.Test)

Example 3 with SocialFileSelectedEvent

use of org.ext.uberfire.social.activities.model.SocialFileSelectedEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method testOnSocialFileSelected_Asset.

@Test
public void testOnSocialFileSelected_Asset() {
    doReturn(mock(WorkspaceProject.class)).when(projectService).resolveProject(any(Path.class));
    doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
    final PlaceRequest libraryPerspective = libraryPlaces.getLibraryPlaceRequestWithoutRefresh();
    final SocialFileSelectedEvent event = new SocialFileSelectedEvent("any", "uri");
    libraryPlaces.onSocialFileSelected(event);
    verify(placeManager).goTo(libraryPerspective);
    verify(libraryPlaces).goToAsset(any(Path.class));
}
Also used : ObservablePath(org.uberfire.backend.vfs.ObservablePath) Path(org.uberfire.backend.vfs.Path) PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) SocialFileSelectedEvent(org.ext.uberfire.social.activities.model.SocialFileSelectedEvent) Test(org.junit.Test)

Aggregations

SocialFileSelectedEvent (org.ext.uberfire.social.activities.model.SocialFileSelectedEvent)3 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)3 Test (org.junit.Test)3 ObservablePath (org.uberfire.backend.vfs.ObservablePath)3 Path (org.uberfire.backend.vfs.Path)3 PlaceRequest (org.uberfire.mvp.PlaceRequest)2 DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)2 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)2