use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_user_facility_attribute_def_virt_UIDTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_user_facility_attribute_def_virt_UID();
attributeToCheck = new Attribute();
reqAttribute = new Attribute();
reqAttribute.setValue("namespace");
sess = mock(PerunSessionImpl.class);
PerunBl perunBl = mock(PerunBl.class);
when(sess.getPerunBl()).thenReturn(perunBl);
AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
when(sess.getPerunBl().getAttributesManagerBl()).thenReturn(attributesManagerBl);
when(attributesManagerBl.getAttribute(sess, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":uid-namespace")).thenReturn(reqAttribute);
when(attributesManagerBl.getAttribute(sess, user, AttributesManager.NS_USER_ATTR_DEF + ":uid-namespace:" + reqAttribute.getValue())).thenReturn(reqAttribute);
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_user_attribute_def_def_login_namespace_eduteams_nicknameTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_user_attribute_def_def_login_namespace_eduteams_nickname();
session = mock(PerunSessionImpl.class);
user = new User();
attributeToCheck = new Attribute();
attributeToCheck.setNamespace(AttributesManager.NS_USER_ATTR_DEF);
attributeToCheck.setFriendlyName("login-namespace:eduteams-nickname");
PerunBl perunBl = mock(PerunBl.class);
when(session.getPerunBl()).thenReturn(perunBl);
ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
when(perunBl.getModulesUtilsBl()).thenReturn(modulesUtilsBl);
UsersManagerBl usersManagerBl = mock(UsersManagerBl.class);
when(perunBl.getUsersManagerBl()).thenReturn(usersManagerBl);
PasswordManagerModule module = mock(GenericPasswordManagerModule.class);
when(session.getPerunBl().getUsersManagerBl().getPasswordManagerModule(session, "eduteams-nickname")).thenReturn(module);
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_user_attribute_def_def_login_namespace_fenix_nicknameTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_user_attribute_def_def_login_namespace_fenix_nickname();
session = mock(PerunSessionImpl.class);
user = new User();
attributeToCheck = new Attribute();
attributeToCheck.setNamespace(AttributesManager.NS_USER_ATTR_DEF);
attributeToCheck.setFriendlyName("login-namespace:fenix-nickname");
PerunBl perunBl = mock(PerunBl.class);
when(session.getPerunBl()).thenReturn(perunBl);
ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
when(perunBl.getModulesUtilsBl()).thenReturn(modulesUtilsBl);
UsersManagerBl usersManagerBl = mock(UsersManagerBl.class);
when(perunBl.getUsersManagerBl()).thenReturn(usersManagerBl);
PasswordManagerModule module = mock(GenericPasswordManagerModule.class);
when(session.getPerunBl().getUsersManagerBl().getPasswordManagerModule(session, "fenix-nickname")).thenReturn(module);
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_user_attribute_def_def_login_namespace_mu_admTest method setUp.
@Before
public void setUp() throws Exception {
// prepare core config for this test
CoreConfig cfNew = new CoreConfig();
cfNew.setInstanceId("test");
BeansUtils.setConfig(cfNew);
classInstance = new urn_perun_user_attribute_def_def_login_namespace_mu_adm();
session = mock(PerunSessionImpl.class);
user = new User();
attributeToCheck = new Attribute();
attributeToCheck.setNamespace(AttributesManager.NS_USER_ATTR_DEF);
attributeToCheck.setFriendlyName("login-namespace:mu-adm");
PerunBl perunBl = mock(PerunBl.class);
when(session.getPerunBl()).thenReturn(perunBl);
UsersManagerBl usersManagerBl = mock(UsersManagerBl.class);
when(session.getPerunBl().getUsersManagerBl()).thenReturn(usersManagerBl);
PasswordManagerModule module = mock(GenericPasswordManagerModule.class);
when(session.getPerunBl().getUsersManagerBl().getPasswordManagerModule(session, "mu-adm")).thenReturn(module);
ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
when(perunBl.getModulesUtilsBl()).thenReturn(modulesUtilsBl);
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_user_attribute_def_def_preferredEduPersonPrincipalNameTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_user_attribute_def_def_preferredEduPersonPrincipalName();
session = mock(PerunSessionImpl.class);
user = new User(0, "John", "Doe", "", "", "");
attributeToCheck = new Attribute();
reqAttribute = new Attribute();
PerunBl perunBl = mock(PerunBl.class);
when(session.getPerunBl()).thenReturn(perunBl);
AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
when(session.getPerunBl().getAttributesManagerBl()).thenReturn(attributesManagerBl);
when(session.getPerunBl().getAttributesManagerBl().getAttribute(session, user, AttributesManager.NS_USER_ATTR_VIRT + ":eduPersonPrincipalNames")).thenReturn(reqAttribute);
}
Aggregations