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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations