Search in sources :

Example 1 with IndexingFinishedEvent

use of org.kie.workbench.common.services.refactoring.model.index.events.IndexingFinishedEvent in project kie-wb-common by kiegroup.

the class AddProjectPopUpPresenterTest method createProjectCallbackBeforeProjectIndexedEventTest.

@Test
public void createProjectCallbackBeforeProjectIndexedEventTest() {
    final WorkspaceProject project = mock(WorkspaceProject.class);
    final Path projectRootPath = mock(Path.class);
    doReturn(projectRootPath).when(project).getRootPath();
    doReturn(project).when(projectService).resolveProject(any(Path.class));
    doReturn(project).when(libraryService).createProject(any(), any(), any(), Mockito.<String>any());
    doReturn("test").when(view).getName();
    doReturn("description").when(view).getDescription();
    presenter.add();
    presenter.onProjectIndexingFinishedEvent(new IndexingFinishedEvent("kClusterId", projectRootPath));
    verify(view).setAddButtonEnabled(false);
    verify(view).showBusyIndicator(Mockito.<String>any());
    verify(view).setAddButtonEnabled(true);
    verify(view).hide();
    verify(notificationEvent).fire(any(NotificationEvent.class));
    verify(libraryPlaces).goToProject(project);
}
Also used : Path(org.uberfire.backend.vfs.Path) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) IndexingFinishedEvent(org.kie.workbench.common.services.refactoring.model.index.events.IndexingFinishedEvent) Test(org.junit.Test)

Example 2 with IndexingFinishedEvent

use of org.kie.workbench.common.services.refactoring.model.index.events.IndexingFinishedEvent in project kie-wb-common by kiegroup.

the class AddProjectPopUpPresenterTest method createProjectCallbackAfterProjectIndexedEventTest.

@Test
public void createProjectCallbackAfterProjectIndexedEventTest() {
    final WorkspaceProject project = mock(WorkspaceProject.class);
    final Path projectRootPath = mock(Path.class);
    doReturn(projectRootPath).when(project).getRootPath();
    doReturn(project).when(projectService).resolveProject(any(Path.class));
    doReturn(project).when(libraryService).createProject(any(), any(), any(), Mockito.<String>any());
    doReturn("test").when(view).getName();
    doReturn("description").when(view).getDescription();
    presenter.onProjectIndexingFinishedEvent(new IndexingFinishedEvent("kClusterId", projectRootPath));
    presenter.add();
    verify(view).setAddButtonEnabled(false);
    verify(view).showBusyIndicator(Mockito.<String>any());
    verify(view).setAddButtonEnabled(true);
    verify(view).hide();
    verify(notificationEvent).fire(any(NotificationEvent.class));
    verify(libraryPlaces).goToProject(project);
}
Also used : Path(org.uberfire.backend.vfs.Path) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) IndexingFinishedEvent(org.kie.workbench.common.services.refactoring.model.index.events.IndexingFinishedEvent) Test(org.junit.Test)

Aggregations

WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)2 Test (org.junit.Test)2 IndexingFinishedEvent (org.kie.workbench.common.services.refactoring.model.index.events.IndexingFinishedEvent)2 Path (org.uberfire.backend.vfs.Path)2 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)2