Search in sources :

Example 1 with ModulesUtilsBl

use of cz.metacentrum.perun.core.bl.ModulesUtilsBl in project perun by CESNET.

the class urn_perun_vo_attribute_def_def_contactEmailTest method setUp.

@Before
public void setUp() {
    classInstance = new urn_perun_vo_attribute_def_def_contactEmail();
    session = mock(PerunSessionImpl.class);
    attributeToCheck = new Attribute();
    vo = new Vo();
    PerunBl perunBl = mock(PerunBl.class);
    when(session.getPerunBl()).thenReturn(perunBl);
    ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
    when(perunBl.getModulesUtilsBl()).thenReturn(modulesUtilsBl);
    when(session.getPerunBl().getModulesUtilsBl().isNameOfEmailValid(session, correctEmail)).thenReturn(true);
    when(session.getPerunBl().getModulesUtilsBl().isNameOfEmailValid(session, incorrectEmail)).thenReturn(false);
}
Also used : ModulesUtilsBl(cz.metacentrum.perun.core.bl.ModulesUtilsBl) Attribute(cz.metacentrum.perun.core.api.Attribute) Vo(cz.metacentrum.perun.core.api.Vo) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) Before(org.junit.Before)

Example 2 with ModulesUtilsBl

use of cz.metacentrum.perun.core.bl.ModulesUtilsBl in project perun by CESNET.

the class urn_perun_vo_attribute_def_def_toEmailTest method setUp.

@Before
public void setUp() {
    classInstance = new urn_perun_vo_attribute_def_def_toEmail();
    session = mock(PerunSessionImpl.class);
    attributeToCheck = new Attribute();
    vo = new Vo();
    PerunBl perunBl = mock(PerunBl.class);
    when(session.getPerunBl()).thenReturn(perunBl);
    ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
    when(perunBl.getModulesUtilsBl()).thenReturn(modulesUtilsBl);
    when(session.getPerunBl().getModulesUtilsBl().isNameOfEmailValid(session, correctEmail)).thenReturn(true);
    when(session.getPerunBl().getModulesUtilsBl().isNameOfEmailValid(session, incorrectEmail)).thenReturn(false);
}
Also used : ModulesUtilsBl(cz.metacentrum.perun.core.bl.ModulesUtilsBl) Attribute(cz.metacentrum.perun.core.api.Attribute) Vo(cz.metacentrum.perun.core.api.Vo) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) Before(org.junit.Before)

Example 3 with ModulesUtilsBl

use of cz.metacentrum.perun.core.bl.ModulesUtilsBl in project perun by CESNET.

the class urn_perun_group_attribute_def_def_fromEmailTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_fromEmail();
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    sess = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
    modulesUtilsBl = mock(ModulesUtilsBl.class);
    when(perunBl.getModulesUtilsBl()).thenReturn(modulesUtilsBl);
}
Also used : ModulesUtilsBl(cz.metacentrum.perun.core.bl.ModulesUtilsBl) Attribute(cz.metacentrum.perun.core.api.Attribute) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) Before(org.junit.Before)

Example 4 with ModulesUtilsBl

use of cz.metacentrum.perun.core.bl.ModulesUtilsBl in project perun by CESNET.

the class urn_perun_group_attribute_def_def_unixGID_namespaceTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_unixGID_namespace();
    attributeToCheck = new Attribute();
    attributeToCheck.setFriendlyName("friendly name");
    reqAttribute = new Attribute();
    reqAttribute.setFriendlyName("friendly name");
    sess = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
    GroupsManagerBl groupsManagerBl = mock(GroupsManagerBl.class);
    when(sess.getPerunBl().getGroupsManagerBl()).thenReturn(groupsManagerBl);
    when(sess.getPerunBl().getGroupsManagerBl().isGroupSynchronizedFromExternallSource(sess, group)).thenReturn(false);
    AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
    when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
    when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, group, AttributesManager.NS_GROUP_ATTR_DEF + ":unixGroupName-namespace" + ":" + attributeToCheck.getNamespace())).thenReturn(reqAttribute);
    when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, "", AttributesManager.NS_ENTITYLESS_ATTR_DEF + ":usedGids")).thenReturn(reqAttribute);
    when(sess.getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, AttributesManager.NS_RESOURCE_ATTR_DEF + ":unixGID-namespace:")).thenReturn(reqAttribute);
    when(sess.getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, AttributesManager.NS_RESOURCE_ATTR_DEF + ":unixGroupName-namespace:")).thenReturn(reqAttribute);
    ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
    when(sess.getPerunBl().getModulesUtilsBl()).thenReturn(modulesUtilsBl);
    ResourcesManagerBl resourcesManagerBl = mock(ResourcesManagerBl.class);
    when(sess.getPerunBl().getResourcesManagerBl()).thenReturn(resourcesManagerBl);
}
Also used : ResourcesManagerBl(cz.metacentrum.perun.core.bl.ResourcesManagerBl) GroupsManagerBl(cz.metacentrum.perun.core.bl.GroupsManagerBl) ModulesUtilsBl(cz.metacentrum.perun.core.bl.ModulesUtilsBl) Attribute(cz.metacentrum.perun.core.api.Attribute) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) AttributesManagerBl(cz.metacentrum.perun.core.bl.AttributesManagerBl) Before(org.junit.Before)

Example 5 with ModulesUtilsBl

use of cz.metacentrum.perun.core.bl.ModulesUtilsBl in project perun by CESNET.

the class urn_perun_resource_attribute_def_def_unixGID_namespaceTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_resource_attribute_def_def_unixGID_namespace();
    attributeToCheck = new Attribute();
    attributeToCheck.setFriendlyName("friendly name");
    reqAttribute = new Attribute();
    reqAttribute.setFriendlyName("friendly name");
    sess = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
    GroupsManagerBl groupsManagerBl = mock(GroupsManagerBl.class);
    when(sess.getPerunBl().getGroupsManagerBl()).thenReturn(groupsManagerBl);
    AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
    when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
    when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, AttributesManager.NS_GROUP_ATTR_DEF + ":unixGroupName-namespace" + ":" + attributeToCheck.getNamespace())).thenReturn(reqAttribute);
    when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, attributeToCheck.getFriendlyNameParameter(), AttributesManager.NS_ENTITYLESS_ATTR_DEF + ":usedGids")).thenReturn(reqAttribute);
    when(sess.getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, AttributesManager.NS_GROUP_ATTR_DEF + ":unixGID-namespace:")).thenReturn(reqAttribute);
    when(sess.getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, AttributesManager.NS_GROUP_ATTR_DEF + ":unixGroupName-namespace:")).thenReturn(reqAttribute);
    ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
    when(sess.getPerunBl().getModulesUtilsBl()).thenReturn(modulesUtilsBl);
    ResourcesManagerBl resourcesManagerBl = mock(ResourcesManagerBl.class);
    when(sess.getPerunBl().getResourcesManagerBl()).thenReturn(resourcesManagerBl);
}
Also used : ResourcesManagerBl(cz.metacentrum.perun.core.bl.ResourcesManagerBl) GroupsManagerBl(cz.metacentrum.perun.core.bl.GroupsManagerBl) ModulesUtilsBl(cz.metacentrum.perun.core.bl.ModulesUtilsBl) Attribute(cz.metacentrum.perun.core.api.Attribute) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) AttributesManagerBl(cz.metacentrum.perun.core.bl.AttributesManagerBl) Before(org.junit.Before)

Aggregations

ModulesUtilsBl (cz.metacentrum.perun.core.bl.ModulesUtilsBl)19 PerunBl (cz.metacentrum.perun.core.bl.PerunBl)19 PerunSessionImpl (cz.metacentrum.perun.core.impl.PerunSessionImpl)19 Before (org.junit.Before)19 Attribute (cz.metacentrum.perun.core.api.Attribute)18 UsersManagerBl (cz.metacentrum.perun.core.bl.UsersManagerBl)9 User (cz.metacentrum.perun.core.api.User)8 PasswordManagerModule (cz.metacentrum.perun.core.implApi.modules.pwdmgr.PasswordManagerModule)8 GenericPasswordManagerModule (cz.metacentrum.perun.core.impl.modules.pwdmgr.GenericPasswordManagerModule)7 AttributesManagerBl (cz.metacentrum.perun.core.bl.AttributesManagerBl)6 GroupsManagerBl (cz.metacentrum.perun.core.bl.GroupsManagerBl)4 ResourcesManagerBl (cz.metacentrum.perun.core.bl.ResourcesManagerBl)4 Vo (cz.metacentrum.perun.core.api.Vo)3 AttributeDefinition (cz.metacentrum.perun.core.api.AttributeDefinition)1 CoreConfig (cz.metacentrum.perun.core.api.CoreConfig)1 EinfraPasswordManagerModule (cz.metacentrum.perun.core.impl.modules.pwdmgr.EinfraPasswordManagerModule)1 Pattern (java.util.regex.Pattern)1