use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_group_attribute_def_virt_adDisplayName_o365muTest method setUp.
@Before
public void setUp() throws Exception {
// prepare mocks
sess = mock(PerunSessionImpl.class);
PerunBl perunBl = mock(PerunBl.class);
AttributesManagerBl am = mock(AttributesManagerBl.class);
GroupsManagerBl gm = mock(GroupsManagerBl.class);
when(sess.getPerunBl()).thenReturn(perunBl);
when(perunBl.getAttributesManagerBl()).thenReturn(am);
when(perunBl.getGroupsManagerBl()).thenReturn(gm);
when(sess.getPerunBl().getGroupsManagerBl().getParentGroup(sess, groupB)).thenReturn(groupA);
when(sess.getPerunBl().getGroupsManagerBl().getParentGroup(sess, groupC)).thenReturn(groupB);
when(sess.getPerunBl().getGroupsManagerBl().getParentGroup(sess, groupD)).thenReturn(groupC);
when(sess.getPerunBl().getGroupsManagerBl().getParentGroup(sess, groupE)).thenReturn(groupD);
when(sess.getPerunBl().getGroupsManagerBl().getParentGroup(sess, groupF)).thenReturn(groupA);
// group A is the main group with cispr 000000, it has no default display name
setWhenClauseByParametersForGroup(sess, groupA, null, "000000", groupA.getName(), groupA.getDescription(), typeOfWorkplacesA);
// group B is special group which should return null on display name
setWhenClauseByParametersForGroup(sess, groupB, null, "000001", groupB.getName(), groupB.getDescription(), typeOfWorkplacesA);
// group C is other part of university, it has no default display name
setWhenClauseByParametersForGroup(sess, groupC, null, "110000", groupC.getName(), groupC.getDescription(), typeOfWorkplacesB);
// group D is special group with predefined display name
setWhenClauseByParametersForGroup(sess, groupD, predefinedDisplayName, null, null, null, null);
// group E is other type of group, it has no default display name
setWhenClauseByParametersForGroup(sess, groupE, null, "123456", groupE.getName(), groupE.getDescription(), typeOfWorkplacesC);
// group E is other type of group, it has no default display name, but displayName is missing
setWhenClauseByParametersForGroup(sess, groupF, null, "654321", groupF.getName(), groupF.getDescription(), typeOfWorkplacesB);
when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, groupWithoutAttributes, defaultAdDisplayNameAttrDef.getName())).thenThrow(AttributeNotExistsException.class);
when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, groupWithoutAttributes, inetCisprAttrDef.getName())).thenThrow(AttributeNotExistsException.class);
when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, groupWithoutAttributes, inetWorkplacesTypeCSAttrDef.getName())).thenThrow(AttributeNotExistsException.class);
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_facility_attribute_def_virt_GIDRangesTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_facility_attribute_def_virt_GIDRanges();
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);
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_facility_attribute_def_def_pbsServerTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_facility_attribute_def_def_pbsServer();
session = mock(PerunSessionImpl.class);
facility = new Facility();
attributeToCheck = new Attribute();
Attribute name = new Attribute();
PerunBl perunBl = mock(PerunBl.class);
when(session.getPerunBl()).thenReturn(perunBl);
FacilitiesManagerBl facilitiesManagerBl = mock(FacilitiesManagerBl.class);
when(perunBl.getFacilitiesManagerBl()).thenReturn(facilitiesManagerBl);
AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
when(attributesManagerBl.getAttributeDefinition(session, AttributesManager.NS_FACILITY_ATTR_CORE + ":name")).thenReturn(name);
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_facility_attribute_def_def_reqAupsTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_facility_attribute_def_def_reqAups();
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);
when(session.getPerunBl().getAttributesManagerBl().getEntitylessAttributes(session, AttributesManager.NS_ENTITYLESS_ATTR_DEF + ":orgAups")).thenReturn(Collections.singletonList(reqAttribute));
}
use of cz.metacentrum.perun.core.bl.PerunBl in project perun by CESNET.
the class urn_perun_facility_attribute_def_def_uid_namespaceTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_facility_attribute_def_def_uid_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);
}
Aggregations