use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method createModifyUserUnlinkAccount.
protected ObjectDelta<UserType> createModifyUserUnlinkAccount(String userOid, PrismObject<ResourceType> resource) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException {
String accountOid = getLinkRefOid(userOid, resource.getOid());
ObjectDelta<UserType> userDelta = ObjectDelta.createEmptyModifyDelta(UserType.class, userOid, prismContext);
PrismReferenceValue accountRefVal = new PrismReferenceValue();
accountRefVal.setOid(accountOid);
ReferenceDelta accountDelta = ReferenceDelta.createModificationDelete(UserType.F_LINK_REF, getUserDefinition(), accountRefVal);
userDelta.addModification(accountDelta);
return userDelta;
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertPrismRefValues.
protected void assertPrismRefValues(String contextDesc, Collection<PrismReferenceValue> real, String... expected) {
List<String> refOids = new ArrayList<>();
for (PrismReferenceValue ref : real) {
refOids.add(ref.getOid());
assertNotNull("Missing type in " + ref.getOid() + " in " + contextDesc, ref.getTargetType());
assertNotNull("Missing name in " + ref.getOid() + " in " + contextDesc, ref.getTargetName());
}
PrismAsserts.assertSets("Wrong values in " + contextDesc, refOids, expected);
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertAuditTarget.
protected void assertAuditTarget(AuditEventRecord event, String oid, QName type, String name) {
PrismReferenceValue target = event.getTarget();
assertNotNull("No target", target);
assertEquals("Wrong OID", oid, target.getOid());
assertEquals("Wrong type", type, target.getTargetType());
assertEquals("Wrong name", name, PolyString.getOrig(target.getTargetName()));
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method createModifyUserAddAccount.
protected ObjectDelta<UserType> createModifyUserAddAccount(String userOid, PrismObject<ResourceType> resource) throws SchemaException {
PrismObject<ShadowType> account = getAccountShadowDefinition().instantiate();
ObjectReferenceType resourceRef = new ObjectReferenceType();
resourceRef.setOid(resource.getOid());
account.asObjectable().setResourceRef(resourceRef);
RefinedResourceSchema refinedSchema = RefinedResourceSchemaImpl.getRefinedSchema(resource);
account.asObjectable().setObjectClass(refinedSchema.getDefaultRefinedDefinition(ShadowKindType.ACCOUNT).getObjectClassDefinition().getTypeName());
ObjectDelta<UserType> userDelta = ObjectDelta.createEmptyModifyDelta(UserType.class, userOid, prismContext);
PrismReferenceValue accountRefVal = new PrismReferenceValue();
accountRefVal.setObject(account);
ReferenceDelta accountDelta = ReferenceDelta.createModificationAdd(UserType.F_LINK_REF, getUserDefinition(), accountRefVal);
userDelta.addModification(accountDelta);
return userDelta;
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class TestOrgSync method assertNoResponsibility.
private String assertNoResponsibility(PrismObject<UserType> user, String respName) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
String respRoleName = "R_" + respName;
PrismObject<RoleType> respRole = searchObjectByName(RoleType.class, respRoleName);
assertNotNull("No role for responsibility " + respName);
display("Responsibility role for " + respName, respRole);
assertNotAssignedRole(user, respRole.getOid());
PrismReferenceValue linkRef = getSingleLinkRef(respRole);
PrismObject<ShadowType> shadow = getShadowModel(linkRef.getOid());
display("Role " + respRoleName + " shadow", shadow);
// TODO assert shadow content
String groupDn = "cn=" + respRoleName + ",ou=groups," + openDJController.getSuffix();
Entry groupEntry = openDJController.fetchAndAssertEntry(groupDn, "groupOfUniqueNames");
display("Group entry", groupEntry);
PrismReferenceValue accountLinkRef = getLinkRef(user, RESOURCE_OPENDJ_OID);
PrismObject<ShadowType> accountShadow = getShadowModel(accountLinkRef.getOid());
String accountDn = IntegrationTestTools.getSecondaryIdentifier(accountShadow);
openDJController.assertNoUniqueMember(groupEntry, accountDn);
IntegrationTestTools.assertNoAssociation(accountShadow, OPENDJ_ASSOCIATION_GROUP_NAME, shadow.getOid());
return respRole.getOid();
}
Aggregations