use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class TestOrgSync method getAndAssertReplicatedOrg.
private PrismObject<OrgType> getAndAssertReplicatedOrg(String orgName) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
PrismObject<OrgType> org = getOrg(orgName);
PrismAsserts.assertPropertyValue(org, OrgType.F_ORG_TYPE, "replicated");
assertAssignedRole(org, ROLE_META_REPLICATED_ORG_OID);
PrismReferenceValue linkRef = getSingleLinkRef(org);
// We are bold enough to get the whole shadow
PrismObject<ShadowType> shadow = getShadowModel(linkRef.getOid());
display("Org " + orgName + " shadow", shadow);
// TODO assert shadow content
Entry ouEntry = openDJController.searchSingle("ou=" + orgName);
assertNotNull("No ou LDAP entry for " + orgName);
display("OU entry", ouEntry);
openDJController.assertObjectClass(ouEntry, "organizationalUnit");
return org;
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class AuditEventRecord method getReferenceValueFromObjectReferenceType.
private static PrismReferenceValue getReferenceValueFromObjectReferenceType(ObjectReferenceType refType) {
if (refType == null) {
return null;
}
PrismReferenceValue refVal = new PrismReferenceValue(refType.getOid());
refVal.setTargetType(refType.getType());
refVal.setTargetName(refType.getTargetName());
return refVal;
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class OrgStructTest method test009modifyOrgStructRemoveUser.
@Test
public void test009modifyOrgStructRemoveUser() throws Exception {
OperationResult opResult = new OperationResult("test009modifyOrgStructRemoveUser");
PrismReferenceValue prv = new PrismReferenceValue(MODIFY_USER_DELETE_REF_OID);
prv.setTargetType(OrgType.COMPLEX_TYPE);
ObjectDelta<UserType> delta = ObjectDelta.createModificationDeleteReference(UserType.class, ELAINE_OID, UserType.F_PARENT_ORG_REF, prismContext, prv);
repositoryService.modifyObject(UserType.class, ELAINE_OID, delta.getModifications(), opResult);
UserType userElaine = repositoryService.getObject(UserType.class, ELAINE_OID, null, opResult).asObjectable();
LOGGER.trace("elaine's og refs");
for (ObjectReferenceType ort : userElaine.getParentOrgRef()) {
LOGGER.trace("{}", ort);
if (ort.getOid().equals(MODIFY_USER_DELETE_REF_OID)) {
AssertJUnit.fail("expected that elain does not have reference on the org with oid:" + MODIFY_USER_DELETE_REF_OID);
}
}
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class OrgStructTest method test100ParentOrgRefFilterNullRelation.
@Test
public void test100ParentOrgRefFilterNullRelation() throws Exception {
final String TEST_NAME = "test100ParentOrgRefFilterNullRelation";
TestUtil.displayTestTile(TEST_NAME);
OperationResult opResult = new OperationResult(TEST_NAME);
ObjectQuery query = QueryBuilder.queryFor(ObjectType.class, prismContext).item(ObjectType.F_PARENT_ORG_REF).ref(new PrismReferenceValue(ORG_F001_OID)).build();
// WHEN
List<PrismObject<ObjectType>> orgs = repositoryService.searchObjects(ObjectType.class, query, null, opResult);
// THEN
PrismAsserts.assertOids(orgs, ORG_F002_OID, ORG_F003_OID, ORG_F004_OID, ELAINE_OID);
}
use of com.evolveum.midpoint.prism.PrismReferenceValue in project midpoint by Evolveum.
the class ModifyUser method test100ModifyUserApproverMetadata.
@Test
public void test100ModifyUserApproverMetadata() throws Exception {
PrismObjectDefinition userDefinition = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(UserType.class);
ReferenceDelta delta1 = ReferenceDelta.createModificationAdd(new ItemPath(UserType.F_METADATA, MetadataType.F_CREATE_APPROVER_REF), userDefinition, new PrismReferenceValue("target-oid-1", UserType.COMPLEX_TYPE));
ReferenceDelta delta2 = ReferenceDelta.createModificationAdd(new ItemPath(UserType.F_METADATA, MetadataType.F_MODIFY_APPROVER_REF), userDefinition, // the same as in delta1
new PrismReferenceValue("target-oid-1", UserType.COMPLEX_TYPE));
repositoryService.modifyObject(UserType.class, userOid, Arrays.asList(delta1, delta2), new OperationResult("asdf"));
}
Aggregations