use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class AbstractAdLdapTest method test500AddOrgMeleeIsland.
@Test
public void test500AddOrgMeleeIsland() throws Exception {
final String TEST_NAME = "test500AddOrgMeleeIsland";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<OrgType> org = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(OrgType.class).instantiate();
OrgType orgType = org.asObjectable();
orgType.setName(new PolyStringType(GROUP_MELEE_ISLAND_NAME));
AssignmentType metaroleAssignment = new AssignmentType();
ObjectReferenceType metaroleRef = new ObjectReferenceType();
metaroleRef.setOid(ROLE_META_ORG_OID);
metaroleRef.setType(RoleType.COMPLEX_TYPE);
metaroleAssignment.setTargetRef(metaroleRef);
orgType.getAssignment().add(metaroleAssignment);
// WHEN
TestUtil.displayWhen(TEST_NAME);
addObject(org, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
orgMeleeIslandOid = org.getOid();
Entry entry = assertLdapGroup(GROUP_MELEE_ISLAND_NAME);
org = getObject(OrgType.class, orgMeleeIslandOid);
groupMeleeOid = getSingleLinkOid(org);
PrismObject<ShadowType> shadow = getShadowModel(groupMeleeOid);
display("Shadow (model)", shadow);
assertLdapConnectorInstances(2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class AbstractEDirTest method test520RenameOrgMeleeIsland.
@Test
public void test520RenameOrgMeleeIsland() throws Exception {
final String TEST_NAME = "test520RenameOrgMeleeIsland";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
renameObject(OrgType.class, orgMeleeIslandOid, GROUP_MELA_NOVA_NAME, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
Entry entry = assertLdapGroup(GROUP_MELA_NOVA_NAME);
PrismObject<OrgType> org = getObject(OrgType.class, orgMeleeIslandOid);
String groupMeleeOidAfter = getSingleLinkOid(org);
PrismObject<ShadowType> shadow = getShadowModel(groupMeleeOidAfter);
display("Shadow (model)", shadow);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestOrgSync method test100AddHrAccountHerman.
/**
* First account on Monkey Island. The Monkey Island org should be created.
*/
@Test
public void test100AddHrAccountHerman() throws Exception {
final String TEST_NAME = "test100AddHrAccountHerman";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME);
DummyAccount newAccount = new DummyAccount(ACCOUNT_HERMAN_USERNAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_FIRST_NAME, ACCOUNT_HERMAN_FIST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, ACCOUNT_HERMAN_LAST_NAME);
newAccount.addAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_ORGPATH, ORGPATH_MONKEY_ISLAND);
// WHEN
dummyResourceHr.addAccount(newAccount);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true);
// THEN
PrismObject<UserType> user = findUserByUsername(ACCOUNT_HERMAN_USERNAME);
assertNotNull("No herman user", user);
display("User", user);
assertUserHerman(user);
assertAccount(user, RESOURCE_DUMMY_HR_OID);
dumpOrgTree();
PrismObject<OrgType> org = getAndAssertReplicatedOrg(ORGPATH_MONKEY_ISLAND);
orgMonkeyIslandOid = org.getOid();
assertAssignedOrg(user, org.getOid());
assertHasOrg(user, org.getOid());
assertHasOrg(org, ORG_TOP_OID);
assertSubOrgs(org, 0);
assertSubOrgs(ORG_TOP_OID, 1);
assertBasicRoleAndResources(user);
assertAssignments(user, 2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestRetirement method getAndAssertFunctionalOrg.
private PrismObject<OrgType> getAndAssertFunctionalOrg(String orgName, String directParentOrgOid) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
PrismObject<OrgType> org = getOrg(orgName);
display("org", org);
PrismAsserts.assertPropertyValue(org, OrgType.F_ORG_TYPE, ORG_TYPE_FUNCTIONAL);
assertAssignedRole(org, ROLE_META_ORG_OID);
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");
assertHasOrg(org, directParentOrgOid);
assertAssignedOrg(org, directParentOrgOid);
return org;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType in project midpoint by Evolveum.
the class TestRetirement method test110AddUserTeleke.
@Test
public void test110AddUserTeleke() throws Exception {
final String TEST_NAME = "test110AddUserTeleke";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TestRetirement.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<UserType> userBefore = createUser(USER_TELEKE_USERNAME, USER_TELEKE_GIVEN_NAME, USER_TELEKE_FAMILY_NAME, orgRolyulaCarpathiaOid);
// WHEN
TestUtil.displayWhen(TEST_NAME);
display("Adding user", userBefore);
addObject(userBefore, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<UserType> userAfter = getAndAssertUser(USER_TELEKE_USERNAME, ORG_ROYULA_CARPATHIA_NAME);
PrismObject<OrgType> orgAfter = getAndAssertFunctionalOrg(ORG_ROYULA_CARPATHIA_NAME, ORG_TOP_OID);
dumpOrgTree();
dumpLdap();
assertSubOrgs(orgAfter, 0);
assertSubOrgs(ORG_TOP_OID, 1);
}
Aggregations