Search in sources :

Example 96 with PerunBl

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

the class urn_perun_group_attribute_def_def_groupStructureSynchronizationTimesTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_groupStructureSynchronizationTimes();
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    syncInterval = new Attribute(classInstance.getAttributeDefinition());
    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, GroupsManager.GROUP_STRUCTURE_SYNCHRO_INTERVAL_ATTRNAME)).thenReturn(syncInterval);
}
Also used : GroupsManagerBl(cz.metacentrum.perun.core.bl.GroupsManagerBl) 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 97 with PerunBl

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

the class urn_perun_group_attribute_def_def_o365EmailAddresses_o365muTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_o365EmailAddresses_o365mu();
    // prepare mocks
    session = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    am = mock(AttributesManagerBl.class);
    adNameAttr = mock(Attribute.class);
    when(session.getPerunBl()).thenReturn(perunBl);
    when(perunBl.getAttributesManagerBl()).thenReturn(am);
    when(am.getAttribute(session, group, urn_perun_group_attribute_def_def_o365EmailAddresses_o365mu.ADNAME_ATTRIBUTE)).thenReturn(adNameAttr);
    when(adNameAttr.valueAsString()).thenReturn(adName);
    when(adNameAttr.getValue()).thenReturn(adName);
    when(am.getAttributeDefinition(session, urn_perun_group_attribute_def_def_o365EmailAddresses_o365mu.USER_O365EMAIL_ADDRESSES_MU_ATTRIBUTE)).thenReturn(new urn_perun_user_attribute_def_def_o365UserEmailAddresses_mu().getAttributeDefinition());
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    attributeToCheck.setId(100);
}
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 98 with PerunBl

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

the class urn_perun_entityless_attribute_def_def_namespace_maxUIDTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_entityless_attribute_def_def_namespace_maxUID();
    session = mock(PerunSessionImpl.class);
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    reqAttribute = new Attribute(classInstance.getAttributeDefinition());
    PerunBl perunBl = mock(PerunBl.class);
    when(session.getPerunBl()).thenReturn(perunBl);
    AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
    when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
    when(session.getPerunBl().getAttributesManagerBl().getAttribute(session, key, AttributesManager.NS_ENTITYLESS_ATTR_DEF + ":namespace-minUID")).thenReturn(reqAttribute);
}
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 99 with PerunBl

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

the class urn_perun_facility_attribute_def_def_googleGroupsDomainTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_facility_attribute_def_def_googleGroupsDomain();
    session = mock(PerunSessionImpl.class);
    facility = new Facility();
    attributeToCheck = new Attribute();
    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 100 with PerunBl

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

the class urn_perun_group_attribute_def_def_synchronizationEnabledTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_synchronizationEnabled();
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    reqAttribute = new Attribute(classInstance.getAttributeDefinition());
    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;
    attributesManagerBl = mock(AttributesManagerBl.class);
    when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
    when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GroupsManager.GROUPMEMBERSQUERY_ATTRNAME)).thenReturn(reqAttribute);
    when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GroupsManager.GROUPEXTSOURCE_ATTRNAME)).thenReturn(reqAttribute);
}
Also used : GroupsManagerBl(cz.metacentrum.perun.core.bl.GroupsManagerBl) 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

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