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);
}
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);
}
Aggregations