use of cz.metacentrum.perun.core.bl.AttributesManagerBl in project perun by CESNET.
the class urn_perun_group_attribute_def_def_unixGroupName_namespaceTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_group_attribute_def_def_unixGroupName_namespace();
attributeToCheck = new Attribute();
attributeToCheck.setFriendlyName("unixGID-namespace");
sess = mock(PerunSessionImpl.class);
PerunBl perunBl = mock(PerunBl.class);
when(sess.getPerunBl()).thenReturn(perunBl);
AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
when(sess.getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, AttributesManager.NS_RESOURCE_ATTR_DEF + ":unixGroupName-namespace:")).thenReturn(attributeToCheck);
GroupsManagerBl groupsManagerBl = mock(GroupsManagerBl.class);
when(sess.getPerunBl().getGroupsManagerBl()).thenReturn(groupsManagerBl);
when(sess.getPerunBl().getGroupsManagerBl().isGroupSynchronizedFromExternallSource(sess, group)).thenReturn(false);
ModulesUtilsBl modulesUtilsBl = mock(ModulesUtilsBl.class);
when(sess.getPerunBl().getModulesUtilsBl()).thenReturn(modulesUtilsBl);
ResourcesManagerBl resourcesManagerBl = mock(ResourcesManagerBl.class);
when(sess.getPerunBl().getResourcesManagerBl()).thenReturn(resourcesManagerBl);
}
use of cz.metacentrum.perun.core.bl.AttributesManagerBl in project perun by CESNET.
the class urn_perun_group_resource_attribute_def_def_adNameTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_group_resource_attribute_def_def_adName();
attributeToCheck = new Attribute();
sess = mock(PerunSessionImpl.class);
reqAttribute = new Attribute();
PerunBl perunBl = mock(PerunBl.class);
when(sess.getPerunBl()).thenReturn(perunBl);
AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
when(attributesManagerBl.getAttribute(sess, resource, AttributesManager.NS_RESOURCE_ATTR_DEF + ":adOuName")).thenReturn(reqAttribute);
SearcherBl searcherBl = mock(SearcherBl.class);
when(perunBl.getSearcherBl()).thenReturn(searcherBl);
}
use of cz.metacentrum.perun.core.bl.AttributesManagerBl in project perun by CESNET.
the class urn_perun_resource_attribute_def_def_fairshareGroupNameTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_resource_attribute_def_def_fairshareGroupName();
attributeToCheck = new Attribute();
reqAttribute = new Attribute();
sess = mock(PerunSessionImpl.class);
Facility facility = new Facility();
List<Resource> resources = new ArrayList<>();
Resource resource2 = new Resource();
resources.add(resource2);
resources.add(resource);
PerunBl perunBl = mock(PerunBl.class);
when(sess.getPerunBl()).thenReturn(perunBl);
AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
when(perunBl.getAttributesManagerBl()).thenReturn(attributesManagerBl);
when(sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource2, attributeToCheck.getName())).thenReturn(reqAttribute);
ResourcesManagerBl resourcesManagerBl = mock(ResourcesManagerBl.class);
when(perunBl.getResourcesManagerBl()).thenReturn(resourcesManagerBl);
when(resourcesManagerBl.getFacility(sess, resource)).thenReturn(facility);
FacilitiesManagerBl facilitiesManagerBl = mock(FacilitiesManagerBl.class);
when(perunBl.getFacilitiesManagerBl()).thenReturn(facilitiesManagerBl);
when(facilitiesManagerBl.getAssignedResources(sess, facility)).thenReturn(resources);
}
use of cz.metacentrum.perun.core.bl.AttributesManagerBl in project perun by CESNET.
the class urn_perun_facility_attribute_def_virt_minUIDTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_facility_attribute_def_virt_minUID();
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.AttributesManagerBl in project perun by CESNET.
the class urn_perun_user_facility_attribute_def_virt_UIDTest method setUp.
@Before
public void setUp() throws Exception {
classInstance = new urn_perun_user_facility_attribute_def_virt_UID();
attributeToCheck = new Attribute();
reqAttribute = new Attribute();
reqAttribute.setValue("namespace");
sess = mock(PerunSessionImpl.class);
PerunBl perunBl = mock(PerunBl.class);
when(sess.getPerunBl()).thenReturn(perunBl);
AttributesManagerBl attributesManagerBl = mock(AttributesManagerBl.class);
when(sess.getPerunBl().getAttributesManagerBl()).thenReturn(attributesManagerBl);
when(attributesManagerBl.getAttribute(sess, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":uid-namespace")).thenReturn(reqAttribute);
when(attributesManagerBl.getAttribute(sess, user, AttributesManager.NS_USER_ATTR_DEF + ":uid-namespace:" + reqAttribute.getValue())).thenReturn(reqAttribute);
}
Aggregations