From 3dd23b7d25e31d07457c4747119a09398d3b454d Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Tue, 10 Oct 2017 13:22:40 +0200 Subject: [PATCH] Fixed TestStrings story test. --- .../com/evolveum/midpoint/testing/story/TestStrings.java | 7 +++++-- .../test/resources/strings/roles/global-policy-rules.xml | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java index f6475bf0ea6..69cefd58464 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java @@ -387,11 +387,14 @@ public void test104SimpleAssignmentApproveByAdministrator() throws Exception { // GIVEN login(userAdministrator); List workItems = getWorkItems(task, result); - WorkItemType firstWorkItem = workItems.get(0); + displayWorkItems("Work item after 1st approval", workItems); + WorkItemType elaineWorkItem = workItems.stream() + .filter(wi -> userElaineOid.equals(wi.getOriginalAssigneeRef().getOid())) + .findFirst().orElseThrow(() -> new AssertionError("No work item for elaine")); // WHEN // Second approval - workflowService.completeWorkItem(firstWorkItem.getExternalId(), true, "OK. Security.", null, result); + workflowService.completeWorkItem(elaineWorkItem.getExternalId(), true, "OK. Security.", null, result); // THEN workItems = getWorkItems(task, result); diff --git a/testing/story/src/test/resources/strings/roles/global-policy-rules.xml b/testing/story/src/test/resources/strings/roles/global-policy-rules.xml index db30348884f..73480d4ced7 100644 --- a/testing/story/src/test/resources/strings/roles/global-policy-rules.xml +++ b/testing/story/src/test/resources/strings/roles/global-policy-rules.xml @@ -147,7 +147,7 @@ Automatic escalation followed by rejection for levels 10 and 40 (LM, role approvers) - http://midpoint.evolveum.com/xml/ns/public/model/policy/situation#assigned + http://midpoint.evolveum.com/xml/ns/public/model/policy/situation#modified @@ -192,6 +192,7 @@ + assignment UserType @@ -205,7 +206,7 @@ Automatic rejection for levels 20 and 30 (security, SoD) - http://midpoint.evolveum.com/xml/ns/public/model/policy/situation#assigned + http://midpoint.evolveum.com/xml/ns/public/model/policy/situation#modified @@ -230,6 +231,7 @@ + assignment UserType