use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestRetirement method test200AddOrgCortuvHrad.
@Test
public void test200AddOrgCortuvHrad() throws Exception {
final String TEST_NAME = "test200AddOrgCortuvHrad";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestRetirement.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);
addObject(orgBefore, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<OrgType> orgAfter = getAndAssertFunctionalOrg(ORG_CORTUV_HRAD_NAME, orgRolyulaCarpathiaOid);
orgCortuvHradOid = orgAfter.getOid();
dumpOrgTree();
dumpLdap();
assertSubOrgs(orgAfter, 0);
assertSubOrgs(orgRolyulaCarpathiaOid, 1);
assertSubOrgs(ORG_TOP_OID, 1);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestRetirement method test220AddOrgVysneVlkodlaky.
@Test
public void test220AddOrgVysneVlkodlaky() throws Exception {
final String TEST_NAME = "test220AddOrgVysneVlkodlaky";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestRetirement.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<OrgType> orgBefore = createOrg(ORG_VYSNE_VLKODLAKY_NAME, orgCortuvHradOid);
// WHEN
TestUtil.displayWhen(TEST_NAME);
display("Adding org", orgBefore);
addObject(orgBefore, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<OrgType> orgAfter = getAndAssertFunctionalOrg(ORG_VYSNE_VLKODLAKY_NAME, orgCortuvHradOid);
orgVysneVlkodlakyOid = orgAfter.getOid();
dumpOrgTree();
dumpLdap();
assertSubOrgs(orgAfter, 0);
assertSubOrgs(orgRolyulaCarpathiaOid, 1);
assertSubOrgs(ORG_TOP_OID, 1);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestRetirement method test050AddOrgRetired.
@Test
public void test050AddOrgRetired() throws Exception {
final String TEST_NAME = "test050AddOrgRetired";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestRetirement.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<OrgType> orgBefore = PrismTestUtil.parseObject(ORG_RETIRED_FILE);
// 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> org = getObject(OrgType.class, ORG_RETIRED_OID);
display("org", org);
PrismAsserts.assertPropertyValue(org, OrgType.F_ORG_TYPE, ORG_TYPE_FUNCTIONAL);
String ouShadowOid = getLinkRefOid(org, RESOURCE_OPENDJ_OID, ShadowKindType.GENERIC, LDAP_OU_INTENT);
PrismObject<ShadowType> ouShadow = getShadowModel(ouShadowOid);
display("Org retired OU shadow", ouShadow);
// TODO assert shadow content
Entry ouEntry = openDJController.fetchEntry(ouShadow.getName().getOrig());
assertNotNull("No ou LDAP entry for retirement (" + ouShadow.getName().getOrig() + ")", ouEntry);
display("OU retirement entry", openDJController.toHumanReadableLdifoid(ouEntry));
openDJController.assertObjectClass(ouEntry, "organizationalUnit");
assertSubOrgs(org, 0);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestOrgSync method test140AddHrAccountWally.
/**
* Two-level orgpath, upper org is only as ou in LDAP, it is not in
* midpoint.
*/
@Test
public void test140AddHrAccountWally() throws Exception {
final String TEST_NAME = "test140AddHrAccountWally";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME);
DummyAccount newAccount = new DummyAccount(ACCOUNT_WALLY_USERNAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_FIRST_NAME, ACCOUNT_WALLY_FIST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, ACCOUNT_WALLY_LAST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_ORGPATH, ORGPATH_CARTOGRAPHY);
// WHEN
dummyResourceHr.addAccount(newAccount);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true);
// THEN
PrismObject<UserType> user = findUserByUsername(ACCOUNT_WALLY_USERNAME);
assertNotNull("No cobb user", user);
display("User", user);
assertUser(user, ACCOUNT_WALLY_USERNAME, ACCOUNT_WALLY_FIST_NAME, ACCOUNT_WALLY_LAST_NAME);
assertAccount(user, RESOURCE_DUMMY_HR_OID);
dumpOrgTree();
PrismObject<OrgType> orgCartography = getAndAssertReplicatedOrg("Cartography");
PrismObject<OrgType> orgScabb = getAndAssertReplicatedOrg(ORGPATH_SCABB_ISLAND);
assertAssignedOrg(user, orgCartography.getOid());
assertHasOrg(user, orgCartography.getOid());
assertHasOrg(orgCartography, orgScabb.getOid());
assertHasOrg(orgScabb, ORG_TOP_OID);
assertSubOrgs(orgCartography, 0);
assertSubOrgs(orgScabb, 1);
assertSubOrgs(orgMonkeyIslandOid, 0);
assertSubOrgs(ORG_TOP_OID, 4);
assertBasicRoleAndResources(user);
assertAssignments(user, 2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestOrgSync method getAndAssertReplicatedOrg.
private PrismObject<OrgType> getAndAssertReplicatedOrg(String orgName) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
PrismObject<OrgType> org = getOrg(orgName);
PrismAsserts.assertPropertyValue(org, OrgType.F_ORG_TYPE, "replicated");
assertAssignedRole(org, ROLE_META_REPLICATED_ORG_OID);
PrismReferenceValue linkRef = getSingleLinkRef(org);
// We are bold enough to get the whole shadow
PrismObject<ShadowType> shadow = getShadowModel(linkRef.getOid());
display("Org " + orgName + " shadow", shadow);
// TODO assert shadow content
Entry ouEntry = openDJController.searchSingle("ou=" + orgName);
assertNotNull("No ou LDAP entry for " + orgName);
display("OU entry", ouEntry);
openDJController.assertObjectClass(ouEntry, "organizationalUnit");
return org;
}
Aggregations