use of com.evolveum.midpoint.prism.query.builder.S_AtomicFilterExit in project midpoint by Evolveum.
the class AbstractWfTestPolicy method checkVisibleWorkItem.
protected void checkVisibleWorkItem(ExpectedWorkItem expectedWorkItem, int count, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, ConfigurationException, SecurityViolationException {
S_AtomicFilterExit q = QueryUtils.filterForAssignees(QueryBuilder.queryFor(WorkItemType.class, prismContext), SecurityUtil.getPrincipal(), OtherPrivilegesLimitationType.F_APPROVAL_WORK_ITEMS);
List<WorkItemType> currentWorkItems = modelService.searchContainers(WorkItemType.class, q.build(), null, task, result);
long found = currentWorkItems.stream().filter(wi -> expectedWorkItem == null || expectedWorkItem.matches(wi)).count();
assertEquals("Wrong # of matching work items", count, found);
}
Aggregations