use of org.opends.server.types.Entry in project midpoint by Evolveum.
the class TestLdapHierarchical method getAndAssertUser.
@Override
protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
PrismObject<UserType> user = super.getAndAssertUser(username, directOrgGroupname, indirectGroupNames);
Entry accountEntry = openDJController.searchSingle("uid=" + username);
Entry groupEntry = openDJController.searchSingle("cn=" + directOrgGroupname);
assertNotNull("No group LDAP entry for " + directOrgGroupname, groupEntry);
openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());
return user;
}
use of org.opends.server.types.Entry in project midpoint by Evolveum.
the class TestLdapNested method getAndAssertUser.
@Override
protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
PrismObject<UserType> user = super.getAndAssertUser(username, directOrgGroupname, indirectGroupNames);
Entry accountEntry = openDJController.searchSingle("uid=" + username);
Entry groupEntry = openDJController.searchSingle("cn=" + directOrgGroupname);
assertNotNull("No group LDAP entry for " + directOrgGroupname, groupEntry);
openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());
return user;
}
use of org.opends.server.types.Entry in project midpoint by Evolveum.
the class AbstractLdapHierarchyTest method getAndAssertUser.
protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
PrismObject<UserType> user = findUserByUsername(username);
display("user", user);
String shadowOid = getLinkRefOid(user, RESOURCE_OPENDJ_OID, ShadowKindType.ACCOUNT, SchemaConstants.INTENT_DEFAULT);
PrismObject<ShadowType> accountShadow = getShadowModel(shadowOid);
display("Account " + username + " shadow", accountShadow);
// TODO assert shadow content
Entry accountEntry = openDJController.searchSingle("uid=" + username);
assertNotNull("No account LDAP entry for " + username, accountEntry);
display("account entry", openDJController.toHumanReadableLdifoid(accountEntry));
openDJController.assertObjectClass(accountEntry, "inetOrgPerson");
return user;
}
use of org.opends.server.types.Entry in project midpoint by Evolveum.
the class AbstractLdapHierarchyTest method getAndAssertFunctionalOrg.
protected 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 org.opends.server.types.Entry in project midpoint by Evolveum.
the class TestLdapDeeplyHierarchical method getAndAssertUser.
@Override
protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
PrismObject<UserType> user = super.getAndAssertUser(username, directOrgGroupname, indirectGroupNames);
Entry accountEntry = openDJController.searchSingle("uid=" + username);
String expectedDn = getAccountDn(user);
assertEquals("Wrong account DN", expectedDn, accountEntry.getDN().toString().toLowerCase());
Entry groupEntry = openDJController.searchSingle("cn=" + directOrgGroupname);
assertNotNull("No group LDAP entry for " + directOrgGroupname, groupEntry);
openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());
return user;
}
Aggregations