Search in sources :

Example 6 with S_AtomicFilterExit

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);
}
Also used : DirtiesContext(org.springframework.test.annotation.DirtiesContext) F_DELTAS_TO_PROCESS(com.evolveum.midpoint.xml.ns._public.common.common_3.WfPrimaryChangeProcessorStateType.F_DELTAS_TO_PROCESS) GetOperationOptions.createRetrieve(com.evolveum.midpoint.schema.GetOperationOptions.createRetrieve) T_PARENT(com.evolveum.midpoint.prism.PrismConstants.T_PARENT) Autowired(org.springframework.beans.factory.annotation.Autowired) com.evolveum.midpoint.util.exception(com.evolveum.midpoint.util.exception) HookOperationMode(com.evolveum.midpoint.model.api.hooks.HookOperationMode) LightweightObjectRef(com.evolveum.midpoint.wf.impl.processes.common.LightweightObjectRef) LensContext(com.evolveum.midpoint.model.impl.lens.LensContext) QueryUtils(com.evolveum.midpoint.wf.util.QueryUtils) ModelOperationTaskHandler(com.evolveum.midpoint.model.impl.controller.ModelOperationTaskHandler) CommonProcessVariableNames(com.evolveum.midpoint.wf.impl.processes.common.CommonProcessVariableNames) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) SelectorOptions(com.evolveum.midpoint.schema.SelectorOptions) F_WORKFLOW_CONTEXT(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType.F_WORKFLOW_CONTEXT) ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) WorkItemType(com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType) Task(com.evolveum.midpoint.task.api.Task) WorkflowResult(com.evolveum.midpoint.wf.impl.WorkflowResult) WfTestUtil(com.evolveum.midpoint.wf.impl.WfTestUtil) ActivitiEngine(com.evolveum.midpoint.wf.impl.activiti.ActivitiEngine) GetOperationOptions.resolveItemsNamed(com.evolveum.midpoint.schema.GetOperationOptions.resolveItemsNamed) Checker(com.evolveum.midpoint.test.Checker) QName(javax.xml.namespace.QName) java.util(java.util) AssertJUnit(org.testng.AssertJUnit) AbstractIntegrationTest(com.evolveum.midpoint.test.AbstractIntegrationTest) WfContextType(com.evolveum.midpoint.xml.ns._public.common.common_3.WfContextType) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) WorkflowManager(com.evolveum.midpoint.wf.api.WorkflowManager) WfTaskUtil(com.evolveum.midpoint.wf.impl.tasks.WfTaskUtil) TaskManager(com.evolveum.midpoint.task.api.TaskManager) MiscDataUtil(com.evolveum.midpoint.wf.impl.util.MiscDataUtil) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ModelContext(com.evolveum.midpoint.model.api.context.ModelContext) WfContextUtil(com.evolveum.midpoint.schema.util.WfContextUtil) GeneralChangeProcessor(com.evolveum.midpoint.wf.impl.processors.general.GeneralChangeProcessor) ObjectTypeUtil(com.evolveum.midpoint.schema.util.ObjectTypeUtil) Clockwork(com.evolveum.midpoint.model.impl.lens.Clockwork) IntegrationTestTools(com.evolveum.midpoint.test.IntegrationTestTools) ModelExecuteOptions(com.evolveum.midpoint.model.api.ModelExecuteOptions) ModelState(com.evolveum.midpoint.model.api.context.ModelState) ClassMode(org.springframework.test.annotation.DirtiesContext.ClassMode) PrismUtil(com.evolveum.midpoint.prism.util.PrismUtil) S_AtomicFilterExit(com.evolveum.midpoint.prism.query.builder.S_AtomicFilterExit) TaskExecutionStatus(com.evolveum.midpoint.task.api.TaskExecutionStatus) AbstractModelImplementationIntegrationTest(com.evolveum.midpoint.model.impl.AbstractModelImplementationIntegrationTest) ItemPath(com.evolveum.midpoint.prism.path.ItemPath) File(java.io.File) IntegrationTestTools.display(com.evolveum.midpoint.test.IntegrationTestTools.display) QueryBuilder(com.evolveum.midpoint.prism.query.builder.QueryBuilder) SearchResultList(com.evolveum.midpoint.schema.SearchResultList) SecurityUtil(com.evolveum.midpoint.security.api.SecurityUtil) PrimaryChangeProcessor(com.evolveum.midpoint.wf.impl.processors.primary.PrimaryChangeProcessor) GetOperationOptions(com.evolveum.midpoint.schema.GetOperationOptions) ContextConfiguration(org.springframework.test.context.ContextConfiguration) ObjectTypes(com.evolveum.midpoint.schema.constants.ObjectTypes) S_AtomicFilterExit(com.evolveum.midpoint.prism.query.builder.S_AtomicFilterExit) WorkItemType(com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType)

Aggregations

S_AtomicFilterExit (com.evolveum.midpoint.prism.query.builder.S_AtomicFilterExit)6 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)3 QName (javax.xml.namespace.QName)3 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)2 OrgType (com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType)2 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)2 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 ModelExecuteOptions (com.evolveum.midpoint.model.api.ModelExecuteOptions)1 ModelContext (com.evolveum.midpoint.model.api.context.ModelContext)1 ModelState (com.evolveum.midpoint.model.api.context.ModelState)1 HookOperationMode (com.evolveum.midpoint.model.api.hooks.HookOperationMode)1 AbstractModelImplementationIntegrationTest (com.evolveum.midpoint.model.impl.AbstractModelImplementationIntegrationTest)1 ModelOperationTaskHandler (com.evolveum.midpoint.model.impl.controller.ModelOperationTaskHandler)1 Clockwork (com.evolveum.midpoint.model.impl.lens.Clockwork)1 LensContext (com.evolveum.midpoint.model.impl.lens.LensContext)1 com.evolveum.midpoint.prism (com.evolveum.midpoint.prism)1 T_PARENT (com.evolveum.midpoint.prism.PrismConstants.T_PARENT)1 PrismContext (com.evolveum.midpoint.prism.PrismContext)1 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)1 PolyStringNormalizer (com.evolveum.midpoint.prism.polystring.PolyStringNormalizer)1