use of com.evolveum.midpoint.prism.PrismReference in project midpoint by Evolveum.
the class AbstractIntegrationTest method assertNoRoleMembershipRef.
protected <F extends FocusType> void assertNoRoleMembershipRef(PrismObject<F> focus) {
PrismReference memRef = focus.findReference(FocusType.F_ROLE_MEMBERSHIP_REF);
assertNull("No roleMembershipRef expected in " + focus + ", but found: " + memRef, memRef);
}
use of com.evolveum.midpoint.prism.PrismReference in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method createAssignmentModification.
protected ContainerDelta<AssignmentType> createAssignmentModification(String roleOid, QName refType, QName relation, Consumer<AssignmentType> modificationBlock, boolean add) throws SchemaException {
ContainerDelta<AssignmentType> assignmentDelta = ContainerDelta.createDelta(UserType.F_ASSIGNMENT, getUserDefinition());
PrismContainerValue<AssignmentType> cval = new PrismContainerValue<AssignmentType>(prismContext);
if (add) {
assignmentDelta.addValueToAdd(cval);
} else {
assignmentDelta.addValueToDelete(cval);
}
PrismReference targetRef = cval.findOrCreateReference(AssignmentType.F_TARGET_REF);
targetRef.getValue().setOid(roleOid);
targetRef.getValue().setTargetType(refType);
targetRef.getValue().setRelation(relation);
if (modificationBlock != null) {
modificationBlock.accept(cval.asContainerable());
}
return assignmentDelta;
}
use of com.evolveum.midpoint.prism.PrismReference in project midpoint by Evolveum.
the class TestStrings method ref.
protected PrismReference ref(List<ObjectReferenceType> orts) {
PrismReference rv = new PrismReference(new QName("dummy"));
orts.forEach(ort -> rv.add(ort.asReferenceValue().clone()));
return rv;
}
use of com.evolveum.midpoint.prism.PrismReference in project midpoint by Evolveum.
the class ObjectUpdater method createAddParentRefDelta.
private <T extends ObjectType> List<ReferenceDelta> createAddParentRefDelta(PrismObject<T> object) {
PrismReference parentOrgRef = object.findReference(ObjectType.F_PARENT_ORG_REF);
if (parentOrgRef == null || parentOrgRef.isEmpty()) {
return new ArrayList<>();
}
PrismObjectDefinition def = object.getDefinition();
ReferenceDelta delta = ReferenceDelta.createModificationAdd(new ItemPath(ObjectType.F_PARENT_ORG_REF), def, parentOrgRef.getClonedValues());
return Arrays.asList(delta);
}
use of com.evolveum.midpoint.prism.PrismReference in project midpoint by Evolveum.
the class AbstractIntegrationTest method assertNotLinked.
protected void assertNotLinked(PrismObject<UserType> user, String accountOid) throws ObjectNotFoundException, SchemaException {
PrismReference linkRef = user.findReference(UserType.F_LINK_REF);
if (linkRef == null) {
return;
}
boolean found = false;
for (PrismReferenceValue val : linkRef.getValues()) {
if (val.getOid().equals(accountOid)) {
found = true;
}
}
assertFalse("User " + user + " IS linked to account " + accountOid + " but not expecting it", found);
}
Aggregations