use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestUniversity method assertGroupMembers.
private void assertGroupMembers(PrismObject<OrgType> org, String... members) throws Exception {
String groupOid = getLinkRefOid(org, RESOURCE_OPENDJ_OID, ShadowKindType.ENTITLEMENT, "org-group");
PrismObject<ShadowType> groupShadow = getShadowModel(groupOid);
assertAttribute(resourceOpenDj, groupShadow.asObjectable(), new QName(MidPointConstants.NS_RI, "uniqueMember"), members);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestUniversity method test100AddComeniusUniversity.
@Test
public void test100AddComeniusUniversity() throws Exception {
final String TEST_NAME = "test100AddComeniusUniversity";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestUniversity.class.getName() + "." + TEST_NAME);
DummyPrivilege comenius = new DummyPrivilege("UK");
// WHEN
dummyResourceHr.addPrivilege(comenius);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true);
// THEN
PrismObject<OrgType> org = getAndAssertFunctionalOrg("UK");
assertNotNull("Comenius University was not found", org);
display("Org", org);
dumpOrgTree();
assertHasOrg(org, ORG_TOP_OID);
assertAssignedOrg(org, ORG_TOP_OID);
assertSubOrgs(org, 0);
assertSubOrgs(ORG_TOP_OID, 1);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestUniversity method test120MoveComputingCentre.
@Test
public void test120MoveComputingCentre() throws Exception {
final String TEST_NAME = "test120MoveComputingCentre";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestUniversity.class.getName() + "." + TEST_NAME);
DummyPrivilege srcVc = dummyResourceHr.getPrivilegeByName("VC");
// WHEN
srcVc.replaceAttributeValue(DUMMY_PRIVILEGE_ATTRIBUTE_HR_ORGPATH, "UK:PRIF");
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true, 999999999);
// THEN
dumpOrgTree();
PrismObject<OrgType> uk = getAndAssertFunctionalOrg("UK");
assertNotNull("UK was not found", uk);
display("Org UK", uk);
assertHasOrg(uk, ORG_TOP_OID);
assertAssignedOrg(uk, ORG_TOP_OID);
assertSubOrgs(uk, 2);
assertSubOrgs(ORG_TOP_OID, 1);
assertGroupMembers(uk, "cn=DL-FMFI,ou=FMFI,ou=UK,dc=example,dc=com", "cn=DL-PRIF,ou=PRIF,ou=UK,dc=example,dc=com");
PrismObject<OrgType> fmfi = getAndAssertFunctionalOrg("FMFI");
assertNotNull("FMFI was not found", fmfi);
display("Org FMFI", fmfi);
assertHasOrg(fmfi, uk.getOid());
assertAssignedOrg(fmfi, uk.getOid());
assertSubOrgs(fmfi, 0);
assertNoGroupMembers(fmfi);
PrismObject<OrgType> prif = getAndAssertFunctionalOrg("PRIF");
assertNotNull("PRIF was not found", prif);
display("Org PRIF", prif);
assertHasOrg(prif, uk.getOid());
assertAssignedOrg(prif, uk.getOid());
assertSubOrgs(prif, 1);
assertGroupMembers(prif, "cn=DL-VC,ou=VC,ou=PRIF,ou=UK,dc=example,dc=com");
PrismObject<OrgType> vc = getAndAssertFunctionalOrg("VC");
assertNotNull("VC was not found", vc);
display("Org VC", vc);
assertHasOrg(vc, prif.getOid());
assertAssignedOrg(vc, prif.getOid());
assertSubOrgs(vc, 0);
assertNoGroupMembers(vc);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestRetirement method assertNoGroupMembers.
private void assertNoGroupMembers(PrismObject<OrgType> org) throws Exception {
String groupOid = getLinkRefOid(org, RESOURCE_OPENDJ_OID, ShadowKindType.ENTITLEMENT, "org-group");
PrismObject<ShadowType> groupShadow = getShadowModel(groupOid);
assertNoAttribute(resourceOpenDj, groupShadow.asObjectable(), new QName(MidPointConstants.NS_RI, "uniqueMember"));
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestRetirement method reconcileAllOrgs.
private void reconcileAllOrgs() throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
final Task task = createTask("reconcileAllOrgs");
OperationResult result = task.getResult();
ResultHandler<OrgType> handler = new ResultHandler<OrgType>() {
@Override
public boolean handle(PrismObject<OrgType> object, OperationResult parentResult) {
try {
display("reconciling " + object);
reconcileOrg(object.getOid(), task, parentResult);
} catch (SchemaException | PolicyViolationException | ExpressionEvaluationException | ObjectNotFoundException | ObjectAlreadyExistsException | CommunicationException | ConfigurationException | SecurityViolationException e) {
throw new SystemException(e.getMessage(), e);
}
return true;
}
};
display("Reconciling all orgs");
modelService.searchObjectsIterative(OrgType.class, null, handler, null, task, result);
}
Aggregations