public AssignmentsAsserter<F,FA,RA> assertOrg(String orgOid) throws ObjectNotFoundException, SchemaException { by() .targetOid(orgOid) .targetType(OrgType.COMPLEX_TYPE) .find(); return this; }
public AssignmentFinder<F,FA,RA> by() { return new AssignmentFinder<>(this); }
public AssignmentsAsserter<F,FA,RA> assertNoRole(String roleOid) throws ObjectNotFoundException, SchemaException { by() .targetOid(roleOid) .targetType(RoleType.COMPLEX_TYPE) .assertNone(); return this; }
public AssignmentsAsserter<F,FA,RA> assertRole(String roleOid, QName relation) throws ObjectNotFoundException, SchemaException { by() .targetOid(roleOid) .targetType(RoleType.COMPLEX_TYPE) .targetRelation(relation) .find(); return this; }
public AssignmentsAsserter<F,FA,RA> assertNone() throws ObjectNotFoundException, SchemaException { for (AssignmentType assignment: assignmentsAsserter.getAssignments()) { PrismObject<ShadowType> assignmentTarget = null; // PrismObject<ShadowType> assignmentTarget = assignmentsAsserter.getTarget(assignment.getOid()); if (matches(assignment, assignmentTarget)) { fail("Found assignment target while not expecting it: "+formatTarget(assignment, assignmentTarget)); } } return assignmentsAsserter; }
public AssignmentsAsserter<F,FA,RA> assertNoRole() throws ObjectNotFoundException, SchemaException { by() .targetType(RoleType.COMPLEX_TYPE) .assertNone(); return this; }
public AssignmentAsserter<AssignmentsAsserter<F, FA, RA>> find() throws ObjectNotFoundException, SchemaException { AssignmentType found = null; PrismObject<?> foundTarget = null; for (AssignmentType assignment: assignmentsAsserter.getAssignments()) { PrismObject<ShadowType> assignmentTarget = null; // PrismObject<ShadowType> assignmentTarget = assignmentsAsserter.getTarget(assignment.getOid()); if (matches(assignment, assignmentTarget)) { if (found == null) { found = assignment; foundTarget = assignmentTarget; } else { fail("Found more than one assignment that matches search criteria"); } } } if (found == null) { fail("Found no assignment that matches search criteria"); } return assignmentsAsserter.forAssignment(found, foundTarget); }
public AssignmentsAsserter<F,FA,RA> assertAll() throws ObjectNotFoundException, SchemaException { for (AssignmentType assignment: assignmentsAsserter.getAssignments()) { PrismObject<ShadowType> assignmentTarget = null; // PrismObject<ShadowType> assignmentTarget = assignmentsAsserter.getTarget(assignment.getOid()); if (!matches(assignment, assignmentTarget)) { fail("Found assignment that does not match search criteria: "+formatTarget(assignment, assignmentTarget)); } } return assignmentsAsserter; }
public AssignmentsAsserter<F,FA,RA> assertRole(String roleOid) throws ObjectNotFoundException, SchemaException { by() .targetOid(roleOid) .targetType(RoleType.COMPLEX_TYPE) .find(); return this; }
public AssignmentsAsserter<F,FA,RA> assertArchetype(String archetypeOid) throws ObjectNotFoundException, SchemaException { by() .targetOid(archetypeOid) .targetType(ArchetypeType.COMPLEX_TYPE) .find(); return this; }
public AssignmentAsserter<AssignmentsAsserter<F,FA,RA>> forRole(String roleOid) throws ObjectNotFoundException, SchemaException { return by() .targetOid(roleOid) .targetType(RoleType.COMPLEX_TYPE) .find(); }