use of org.guvnor.structure.organizationalunit.OrganizationalUnit in project kie-wb-common by kiegroup.
the class ContributorsListPresenterTest method editWithPermissionTest.
@Test
public void editWithPermissionTest() {
final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
doReturn(Optional.of(organizationalUnit)).when(projectContext).getActiveOrganizationalUnit();
presenter.edit();
verify(editContributorsPopUpPresenter).show(organizationalUnit);
}
use of org.guvnor.structure.organizationalunit.OrganizationalUnit in project kie-wb-common by kiegroup.
the class ContributorsManagementPresenterTest method setupTest.
@Test
public void setupTest() {
final List<SocialUser> users = new ArrayList<>();
users.add(userA);
users.add(userB);
final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
doReturn(users.stream().map(SocialUser::getUserName).collect(Collectors.toList())).when(organizationalUnit).getContributors();
doReturn(userB.getUserName()).when(organizationalUnit).getOwner();
presenter.setup(organizationalUnit);
verify(view).init(presenter);
verify(view).clearFilter();
verify(contributorsManagementListItemPresenter).setup(userA);
verify(contributorsManagementListItemPresenter).setup(userB);
verify(contributorsManagementListItemPresenter).setup(userC);
verify(contributorsManagementListItemPresenter, times(3)).setSelected(true);
verify(contributorsManagementListItemPresenter, times(2)).setEnabled(true);
verify(contributorsManagementListItemPresenter).setEnabled(false);
verify(view).clearUsers();
verify(view, times(3)).addUser(contributorsManagementListItemPresenter);
}
use of org.guvnor.structure.organizationalunit.OrganizationalUnit in project kie-wb-common by kiegroup.
the class DeleteOrganizationalUnitPopUpPresenterTest method showWithPermissionTest.
@Test
public void showWithPermissionTest() {
final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
doReturn("ou-name").when(organizationalUnit).getName();
presenter.show(organizationalUnit);
verify(view).show(organizationalUnit.getName());
assertEquals(organizationalUnit, presenter.organizationalUnit);
}
use of org.guvnor.structure.organizationalunit.OrganizationalUnit in project kie-wb-common by kiegroup.
the class DeleteOrganizationalUnitPopUpPresenterTest method showWithoutPermissionTest.
@Test
public void showWithoutPermissionTest() {
final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
doReturn("ou-name").when(organizationalUnit).getName();
doReturn(false).when(organizationalUnitController).canDeleteOrgUnit(organizationalUnit);
presenter.show(organizationalUnit);
verify(view, never()).show(organizationalUnit.getName());
assertNull(presenter.organizationalUnit);
}
use of org.guvnor.structure.organizationalunit.OrganizationalUnit in project kie-wb-common by kiegroup.
the class AddProjectPopUpPresenterTest method newProjectIsCreated.
@Test
public void newProjectIsCreated() throws Exception {
final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class);
when(projectContext.getActiveOrganizationalUnit()).thenReturn(Optional.of(organizationalUnit));
doReturn("test").when(view).getName();
doReturn("description").when(view).getDescription();
presenter.add();
verify(libraryService).createProject("test", organizationalUnit, "description", DeploymentMode.VALIDATED);
}
Aggregations