use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestLdapDependency method assertLdapObjectsFunctionalOrg.
private void assertLdapObjectsFunctionalOrg(PrismObject<OrgType> org) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
String orgName = org.getName().toString();
display("assert org", org.getName());
String groupOid = getLinkRefOid(org, RESOURCE_OPENDJ_OID, ShadowKindType.ENTITLEMENT, LDAP_GROUP_INTENT);
PrismObject<ShadowType> groupShadow = getShadowModel(groupOid);
display("Org " + orgName + " group shadow", groupShadow);
// TODO assert shadow content
Entry groupEntry = openDJController.searchSingle("cn=" + orgName);
assertNotNull("No group LDAP entry for " + orgName, groupEntry);
display("OU GROUP entry", openDJController.toHumanReadableLdifoid(groupEntry));
openDJController.assertObjectClass(groupEntry, "groupOfUniqueNames");
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestOrgSync method test109HrDeleteRedskull.
/**
* Vegetarian cannibal? Not really!
*/
@Test
public void test109HrDeleteRedskull() throws Exception {
final String TEST_NAME = "test109HrDeleteRedskull";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME);
// WHEN
TestUtil.displayWhen(TEST_NAME);
dummyResourceHr.deleteAccountByName(ACCOUNT_REDSKULL_USERNAME);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true);
// THEN
TestUtil.displayThen(TEST_NAME);
PrismObject<UserType> user = findUserByUsername(ACCOUNT_REDSKULL_USERNAME);
display("User", user);
assertNull("Redskull user not gone", user);
dumpOrgTree();
PrismObject<OrgType> org = getAndAssertReplicatedOrg(ORGPATH_MONKEY_ISLAND);
assertHasOrg(org, ORG_TOP_OID);
assertSubOrgs(org, 0);
assertSubOrgs(ORG_TOP_OID, 1);
assertEquals("Monkey island Org OID has changed", orgMonkeyIslandOid, org.getOid());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestOrgSync method test185AddHrAccountStan.
/**
* Some national characters there.
*/
@Test
public void test185AddHrAccountStan() throws Exception {
final String TEST_NAME = "test185AddHrAccountStan";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME);
DummyAccount newAccount = new DummyAccount(ACCOUNT_STAN_USERNAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_FIRST_NAME, ACCOUNT_STAN_FIST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, ACCOUNT_STAN_LAST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_ORGPATH, ORGPATH_DOCKS);
// WHEN
dummyResourceHr.addAccount(newAccount);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true);
// THEN
PrismObject<UserType> user = findUserByUsername(ACCOUNT_STAN_USERNAME);
assertNotNull("No largo user", user);
display("User", user);
assertUser(user, ACCOUNT_STAN_USERNAME, ACCOUNT_STAN_FIST_NAME, ACCOUNT_STAN_LAST_NAME);
assertAccount(user, RESOURCE_DUMMY_HR_OID);
dumpOrgTree();
PrismObject<OrgType> orgDocks = getAndAssertReplicatedOrg("Docks");
PrismObject<OrgType> orgMelee = getAndAssertReplicatedOrg(ORGPATH_MELEE_ISLAND);
assertAssignedOrg(user, orgDocks.getOid());
assertHasOrg(user, orgDocks.getOid());
assertHasOrg(orgDocks, orgMelee.getOid());
assertHasOrg(orgMelee, ORG_TOP_OID);
assertSubOrgs(orgDocks, 0);
assertSubOrgs(orgMelee, 1);
assertSubOrgs(orgScummBarOid, 0);
assertSubOrgs(orgMoROid, 2);
assertSubOrgs(orgMonkeyIslandOid, 0);
assertSubOrgs(ORG_TOP_OID, 6);
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 test190AddHrAccountTeleke.
/**
* Lot of national characters here.
*/
@Test
public void test190AddHrAccountTeleke() throws Exception {
final String TEST_NAME = "test190AddHrAccountTeleke";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME);
DummyAccount newAccount = new DummyAccount(ACCOUNT_TELEKE_USERNAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_FIRST_NAME, ACCOUNT_TELEKE_FIST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, ACCOUNT_TELEKE_LAST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_ORGPATH, ORGPATH_HRAD);
// WHEN
dummyResourceHr.addAccount(newAccount);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true);
// THEN
PrismObject<UserType> user = findUserByUsername(ACCOUNT_TELEKE_USERNAME);
assertNotNull("No largo user", user);
display("User", user);
assertUser(user, ACCOUNT_TELEKE_USERNAME, ACCOUNT_TELEKE_FIST_NAME, ACCOUNT_TELEKE_LAST_NAME);
assertAccount(user, RESOURCE_DUMMY_HR_OID);
dumpOrgTree();
PrismObject<OrgType> orgHrad = getAndAssertReplicatedOrg(HRAD);
PrismObject<OrgType> orgKarpatula = getAndAssertReplicatedOrg(ORGPATH_KARPATULA);
assertAssignedOrg(user, orgHrad.getOid());
assertHasOrg(user, orgHrad.getOid());
assertHasOrg(orgHrad, orgKarpatula.getOid());
assertHasOrg(orgKarpatula, ORG_TOP_OID);
assertSubOrgs(orgHrad, 0);
assertSubOrgs(orgKarpatula, 1);
assertSubOrgs(orgScummBarOid, 0);
assertSubOrgs(orgMoROid, 2);
assertSubOrgs(orgMonkeyIslandOid, 0);
assertSubOrgs(ORG_TOP_OID, 8);
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 test130AddHrAccountLargo.
/**
* Four-level orgpath, completely new.
*/
@Test
public void test130AddHrAccountLargo() throws Exception {
final String TEST_NAME = "test130AddHrAccountLargo";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME);
DummyAccount newAccount = new DummyAccount(ACCOUNT_LARGO_USERNAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_FIRST_NAME, ACCOUNT_LARGO_FIST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, ACCOUNT_LARGO_LAST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_ORGPATH, ORGPATH_BRUTE);
// WHEN
dummyResourceHr.addAccount(newAccount);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true);
// THEN
PrismObject<UserType> user = findUserByUsername(ACCOUNT_LARGO_USERNAME);
assertNotNull("No largo user", user);
display("User", user);
assertUser(user, ACCOUNT_LARGO_USERNAME, ACCOUNT_LARGO_FIST_NAME, ACCOUNT_LARGO_LAST_NAME);
assertAccount(user, RESOURCE_DUMMY_HR_OID);
dumpOrgTree();
PrismObject<OrgType> orgMoO = getAndAssertReplicatedOrg("Ministry of Offense");
PrismObject<OrgType> orgDoM = getAndAssertReplicatedOrg("Department of Mischief");
PrismObject<OrgType> orgVSec = getAndAssertReplicatedOrg("Violence Section");
PrismObject<OrgType> orgBOff = getAndAssertReplicatedOrg("Brute Office");
assertAssignedOrg(user, orgBOff.getOid());
assertHasOrg(user, orgBOff.getOid());
assertHasOrg(orgBOff, orgVSec.getOid());
assertHasOrg(orgVSec, orgDoM.getOid());
assertHasOrg(orgDoM, orgMoO.getOid());
assertHasOrg(orgMoO, ORG_TOP_OID);
assertSubOrgs(orgBOff, 0);
assertSubOrgs(orgVSec, 1);
assertSubOrgs(orgDoM, 1);
assertSubOrgs(orgMoO, 1);
assertSubOrgs(orgScummBarOid, 0);
assertSubOrgs(orgMoROid, 2);
assertSubOrgs(orgMonkeyIslandOid, 0);
assertSubOrgs(ORG_TOP_OID, 3);
assertBasicRoleAndResources(user);
assertAssignments(user, 2);
}
Aggregations