use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class AbstractLdapHierarchyTest method test300RenameOrgCortuvHrad.
@Test
public void test300RenameOrgCortuvHrad() throws Exception {
final String TEST_NAME = "test300RenameOrgCortuvHrad";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(AbstractLdapHierarchyTest.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<OrgType> orgBefore = createOrg(ORG_CORTUV_HRAD_NAME, orgRolyulaCarpathiaOid);
// WHEN
TestUtil.displayWhen(TEST_NAME);
display("Adding org", orgBefore);
modifyObjectReplaceProperty(OrgType.class, orgCortuvHradOid, OrgType.F_NAME, task, result, new PolyString(ORG_CORTUV_HRAD_NAME2));
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
dumpOrgTree();
dumpLdap();
PrismObject<OrgType> orgAfter = getAndAssertFunctionalOrg(ORG_CORTUV_HRAD_NAME2, orgRolyulaCarpathiaOid);
assertEquals("Cortuv hrad org OID changed after rename", orgCortuvHradOid, orgAfter.getOid());
getAndAssertUser(USER_DEZI_USERNAME, ORG_VYSNE_VLKODLAKY_NAME, ORG_CORTUV_HRAD_NAME2, ORG_ROYULA_CARPATHIA_NAME);
assertSubOrgs(orgAfter, 1);
assertSubOrgs(orgRolyulaCarpathiaOid, 1);
assertSubOrgs(ORG_TOP_OID, 1);
assertSubOrgs(orgVysneVlkodlakyOid, 0);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestLdapDeeplyHierarchical method getAndAssertFunctionalOrg.
@Override
protected PrismObject<OrgType> getAndAssertFunctionalOrg(String orgName, String directParentOrgOid) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
PrismObject<OrgType> org = super.getAndAssertFunctionalOrg(orgName, directParentOrgOid);
if (directParentOrgOid != null && !ORG_TOP_OID.equals(directParentOrgOid)) {
Entry groupEntry = openDJController.searchSingle("cn=" + orgName);
PrismObject<OrgType> parentOrg = getObject(OrgType.class, directParentOrgOid);
Entry parentGroupEntry = openDJController.searchSingle("cn=" + parentOrg.getName());
assertNotNull("No group LDAP entry for " + parentOrg.getName(), parentGroupEntry);
display("parent group entry", openDJController.toHumanReadableLdifoid(parentGroupEntry));
openDJController.assertUniqueMember(parentGroupEntry, groupEntry.getDN().toString());
}
String ouOid = getLinkRefOid(org, RESOURCE_OPENDJ_OID, ShadowKindType.GENERIC, LDAP_OU_INTENT);
PrismObject<ShadowType> ouShadow = getShadowModel(ouOid);
display("Org " + orgName + " ou shadow", ouShadow);
Entry groupEntry = openDJController.searchSingle("ou=" + orgName);
assertNotNull("No UO LDAP entry for " + orgName, groupEntry);
display("OU entry", openDJController.toHumanReadableLdifoid(groupEntry));
openDJController.assertObjectClass(groupEntry, "organizationalUnit");
String expectedDn = getOuDn(org);
assertEquals("Wrong OU DN", expectedDn, groupEntry.getDN().toString().toLowerCase());
return org;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestLdapDependency method test200AddOrgHR.
@Test
public void test200AddOrgHR() throws Exception {
final String TEST_NAME = "test200AddOrgHR";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestLdapDependency.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<OrgType> orgBefore = createOrg(ORG_HR_NAME, ORG_TOP_OID);
// WHEN
TestUtil.displayWhen(TEST_NAME);
display("Adding org", orgBefore);
addObject(orgBefore, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
dumpOrgTree();
dumpLdap();
PrismObject<OrgType> orgAfter = getOrg(ORG_HR_NAME);
orgHrOid = orgAfter.getOid();
assertSubOrgs(orgAfter, 0);
assertSubOrgs(ORG_TOP_OID, 2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestLdapDependency method test100AddOrgIT.
@Test
public void test100AddOrgIT() throws Exception {
final String TEST_NAME = "test100AddOrgIT";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestLdapDependency.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<OrgType> orgBefore = createOrg(ORG_IT_NAME, ORG_TOP_OID);
// WHEN
TestUtil.displayWhen(TEST_NAME);
display("Adding org", orgBefore);
addObject(orgBefore, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
dumpOrgTree();
dumpLdap();
PrismObject<OrgType> orgAfter = getOrg(ORG_IT_NAME);
orgItOid = orgAfter.getOid();
assertSubOrgs(orgAfter, 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 TestLdapDependency method test270UnassignVipRoleFromHROrg.
@Test
public void test270UnassignVipRoleFromHROrg() throws Exception {
final String TEST_NAME = "test270UnassignVipRoleFromHROrg";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestLdapDependency.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<OrgType> orgBefore = getOrg(ORG_HR_NAME);
// WHEN
TestUtil.displayWhen(TEST_NAME);
display("unassigning vip role org", orgBefore);
unassignRoleFromOrg(orgHrOid, ROLE_META_ORG_VIP_OID, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
dumpOrgTree();
dumpLdap();
PrismObject<OrgType> orgAfter = getOrg(ORG_HR_NAME);
display("AFTER unassigning vip role org", orgAfter);
assertSubOrgs(orgAfter, 0);
assertSubOrgs(ORG_TOP_OID, 2);
assertRoleMembershipRef(orgAfter, ROLE_META_ORG_OID, ORG_TOP_OID);
assertNotAssignedRole(orgAfter, ROLE_META_ORG_VIP_OID);
assertLdapObject(orgAfter, ShadowKindType.ENTITLEMENT, LDAP_GROUP_INTENT);
assertLdapObject(orgAfter, ShadowKindType.GENERIC, LDAP_OU_INTENT);
//TODO: assert ldap vip objects deleted...
}
Aggregations