Search in sources :

Example 91 with PerunBl

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

the class urn_perun_facility_attribute_def_def_unixGroupName_namespaceTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_facility_attribute_def_def_unixGroupName_namespace();
    session = mock(PerunSessionImpl.class);
    facility = new Facility();
    attributeToCheck = new Attribute();
    attributeToCheck.setFriendlyName("friendly_name");
    reqAttribute = new Attribute();
    PerunBl perunBl = mock(PerunBl.class);
    when(session.getPerunBl()).thenReturn(perunBl);
    AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
    when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
}
Also used : Attribute(cz.metacentrum.perun.core.api.Attribute) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) Facility(cz.metacentrum.perun.core.api.Facility) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) AttributesManagerBl(cz.metacentrum.perun.core.bl.AttributesManagerBl) Before(org.junit.Before)

Example 92 with PerunBl

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

the class urn_perun_group_attribute_def_def_adName_o365muTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_adName_o365mu();
    attributeToCheck = new Attribute();
    sess = mock(PerunSessionImpl.class);
    reqAttribute1 = new Attribute();
    reqAttribute2 = new Attribute();
    // perunBl
    PerunBl perunBl = mock(PerunBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
    // managers
    attributesManagerBl = mock(AttributesManagerBl.class);
    when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
    resourcesManagerBl = mock(ResourcesManagerBl.class);
    when(perunBl.getResourcesManagerBl()).thenReturn(resourcesManagerBl);
    // specific methods
    when(attributesManagerBl.getAttribute(sess, resource1, AttributesManager.NS_RESOURCE_ATTR_DEF + ":adOuName")).thenReturn(reqAttribute1);
    when(attributesManagerBl.getAttribute(sess, resource2, AttributesManager.NS_RESOURCE_ATTR_DEF + ":adOuName")).thenReturn(reqAttribute2);
}
Also used : ResourcesManagerBl(cz.metacentrum.perun.core.bl.ResourcesManagerBl) 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 93 with PerunBl

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

the class urn_perun_group_attribute_def_def_flatGroupStructureEnabledTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_flatGroupStructureEnabled();
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    sess = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    attributesManagerBl = mock(AttributesManagerBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
    when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
}
Also used : 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 94 with PerunBl

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

the class urn_perun_group_attribute_def_def_googleGroupName_namespaceTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_googleGroupName_namespace();
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    sess = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
}
Also used : 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 95 with PerunBl

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

the class urn_perun_group_attribute_def_def_groupExtSourceTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_groupExtSource();
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    sess = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
    GroupsManagerBl groupsManagerBl = mock(GroupsManagerBl.class);
    when(perunBl.getGroupsManagerBl()).thenReturn(groupsManagerBl);
    Vo groupVo = mock(Vo.class);
    VosManagerBl vosManagerBl = mock(VosManagerBl.class);
    when(perunBl.getVosManagerBl()).thenReturn(vosManagerBl);
    when(sess.getPerunBl().getVosManagerBl().getVoById(sess, group.getVoId())).thenReturn(groupVo);
    ExtSource extSource = new ExtSource(1, "my_example", "type");
    ExtSourcesManagerBl extSourcesManagerBl = mock(ExtSourcesManagerBl.class);
    when(sess.getPerunBl().getExtSourcesManagerBl()).thenReturn(extSourcesManagerBl);
    when(sess.getPerunBl().getExtSourcesManagerBl().getVoExtSources(sess, groupVo)).thenReturn(Collections.singletonList(extSource));
}
Also used : GroupsManagerBl(cz.metacentrum.perun.core.bl.GroupsManagerBl) Attribute(cz.metacentrum.perun.core.api.Attribute) VosManagerBl(cz.metacentrum.perun.core.bl.VosManagerBl) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) Vo(cz.metacentrum.perun.core.api.Vo) ExtSource(cz.metacentrum.perun.core.api.ExtSource) ExtSourcesManagerBl(cz.metacentrum.perun.core.bl.ExtSourcesManagerBl) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) Before(org.junit.Before)

Aggregations

PerunBl (cz.metacentrum.perun.core.bl.PerunBl)130 Attribute (cz.metacentrum.perun.core.api.Attribute)93 Before (org.junit.Before)65 PerunSessionImpl (cz.metacentrum.perun.core.impl.PerunSessionImpl)64 AttributesManagerBl (cz.metacentrum.perun.core.bl.AttributesManagerBl)48 User (cz.metacentrum.perun.core.api.User)41 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)37 ArrayList (java.util.ArrayList)22 Vo (cz.metacentrum.perun.core.api.Vo)21 Facility (cz.metacentrum.perun.core.api.Facility)19 UserExtSource (cz.metacentrum.perun.core.api.UserExtSource)19 ModulesUtilsBl (cz.metacentrum.perun.core.bl.ModulesUtilsBl)19 ExtSource (cz.metacentrum.perun.core.api.ExtSource)16 Member (cz.metacentrum.perun.core.api.Member)16 AttributeNotExistsException (cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException)16 UserExtSourceExistsException (cz.metacentrum.perun.core.api.exceptions.UserExtSourceExistsException)16 UsersManagerBl (cz.metacentrum.perun.core.bl.UsersManagerBl)15 WrongAttributeAssignmentException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException)14 GroupsManagerBl (cz.metacentrum.perun.core.bl.GroupsManagerBl)13 Group (cz.metacentrum.perun.core.api.Group)12