use of org.uberfire.mocks.SessionInfoMock in project kie-wb-common by kiegroup.
the class SpacesScreenServiceImplTest method before.
@Before
public void before() {
sessionInfo = new SessionInfoMock();
spacesScreenService = spy(new SpacesScreenServiceImpl(organizationalUnitService, sessionInfo));
}
use of org.uberfire.mocks.SessionInfoMock in project kie-wb-common by kiegroup.
the class SpaceContributorsListServiceImplTest method setup.
@Before
public void setup() {
promises = new SyncPromises();
sessionInfo = new SessionInfoMock("owner");
organizationalUnitServiceCaller = new CallerMock<>(organizationalUnitService);
libraryServiceCaller = new CallerMock<>(libraryService);
final OrganizationalUnit activeSpace = mock(OrganizationalUnit.class);
doReturn(mock(Space.class)).when(activeSpace).getSpace();
doReturn(activeSpace).when(libraryPlaces).getActiveSpace();
service = new SpaceContributorsListServiceImpl(libraryPlaces, organizationalUnitServiceCaller, afterEditOrganizationalUnitEvent, libraryServiceCaller, sessionInfo, organizationalUnitController, contributorsSecurityUtils, promises);
}
use of org.uberfire.mocks.SessionInfoMock in project kie-wb-common by kiegroup.
the class AddProjectPopUpPresenterTest method setup.
@Before
public void setup() {
libraryServiceCaller = new CallerMock<>(libraryService);
validationServiceCaller = new CallerMock<>(validationService);
projectServiceCaller = new CallerMock<>(projectService);
sessionInfo = new SessionInfoMock();
selectedOrganizationalUnit = mock(OrganizationalUnit.class);
doReturn("selectedOrganizationalUnit").when(selectedOrganizationalUnit).getIdentifier();
when(projectContext.getActiveOrganizationalUnit()).thenReturn(Optional.of(selectedOrganizationalUnit));
when(projectContext.getActiveWorkspaceProject()).thenReturn(Optional.empty());
when(projectContext.getActiveModule()).thenReturn(Optional.empty());
when(projectContext.getActiveRepositoryRoot()).thenReturn(Optional.empty());
when(projectContext.getActivePackage()).thenReturn(Optional.empty());
presenter = spy(new AddProjectPopUpPresenter(libraryServiceCaller, busyIndicatorView, notificationEvent, libraryPlaces, projectContext, view, sessionInfo, newProjectEvent, libraryPreferences, conflictingRepositoriesPopup, validationServiceCaller, errorPopup, translationService, projectServiceCaller, logger, archetypePreferences, spaceScopedResolutionStrategySupplier));
doReturn("baseUrl").when(presenter).getBaseURL();
doReturn("emptyNameMessage").when(view).getEmptyNameMessage();
doReturn("invalidNameMessage").when(view).getInvalidNameMessage();
doReturn("duplicatedProjectMessage").when(view).getDuplicatedProjectMessage();
libraryInfo = new LibraryInfo(new ArrayList<>());
doReturn(libraryInfo).when(libraryService).getLibraryInfo(selectedOrganizationalUnit);
doReturn(true).when(validationService).isProjectNameValid(any());
doReturn(true).when(validationService).validateGroupId(any());
doReturn(true).when(validationService).validateArtifactId(any());
doReturn(true).when(validationService).validateGAVVersion(any());
doReturn(mock(WorkspaceProject.class)).when(libraryService).createProject(any(), any(), any(), Mockito.<String>any());
presenter.setup();
}
use of org.uberfire.mocks.SessionInfoMock in project kie-wb-common by kiegroup.
the class ProjectContributorsListServiceImplTest method setup.
@Before
public void setup() {
promises = new SyncPromises();
sessionInfo = new SessionInfoMock("owner");
repositoryServiceCaller = new CallerMock<>(repositoryService);
final OrganizationalUnit activeSpace = mock(OrganizationalUnit.class);
doReturn(mock(Space.class)).when(activeSpace).getSpace();
doReturn(activeSpace).when(libraryPlaces).getActiveSpace();
final WorkspaceProject activeProject = mock(WorkspaceProject.class);
final Repository activeRepository = mock(Repository.class);
doReturn("alias").when(activeRepository).getAlias();
doReturn(activeRepository).when(activeProject).getRepository();
doReturn(activeProject).when(libraryPlaces).getActiveWorkspace();
service = new ProjectContributorsListServiceImpl(libraryPlaces, repositoryServiceCaller, spaceContributorsListService, sessionInfo, projectController, contributorsSecurityUtils, promises);
}
Aggregations