Skip to content

Commit

Permalink
Fixed incorrect UUIDs in TestObjectLifecycleApprovalGlobal
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Sep 27, 2021
1 parent 039c758 commit 94cf273
Showing 1 changed file with 12 additions and 9 deletions.
Expand Up @@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;

import org.jetbrains.annotations.NotNull;
import org.testng.annotations.Test;

import com.evolveum.midpoint.model.impl.lens.LensContext;
Expand Down Expand Up @@ -47,6 +48,8 @@
public class TestObjectLifecycleApprovalGlobal extends AbstractTestObjectLifecycleApproval {

private static final File GLOBAL_POLICY_RULES_FILE = new File(TEST_RESOURCE_DIR, "global-policy-rules.xml");
private static final @NotNull String OID1 = "10000001-d34d-b33f-f00d-d34db33ff00d";
private static final @NotNull String OID2 = "20000002-d34d-b33f-f00d-d34db33ff00d";

@Override
protected boolean approveObjectAdd() {
Expand Down Expand Up @@ -171,8 +174,8 @@ public void test510AddInducementsToJudge() throws Exception {

ObjectDelta<RoleType> judgeDelta = prismContext.deltaFor(RoleType.class)
.item(RoleType.F_INDUCEMENT)
.add(createAssignmentTo("oid1", ObjectTypes.ROLE, prismContext),
createAssignmentTo("oid2", ObjectTypes.ROLE, prismContext))
.add(createAssignmentTo(OID1, ObjectTypes.ROLE, prismContext),
createAssignmentTo(OID2, ObjectTypes.ROLE, prismContext))
.item(RoleType.F_DESCRIPTION)
.replace("hi")
.asObjectDeltaCast(roleJudgeOid);
Expand Down Expand Up @@ -256,7 +259,7 @@ public List<ApprovalInstruction> getApprovalSequence() {

assertEquals("Wrong risk level", "high", judgeAfter.asObjectable().getRiskLevel());
assertEquals("Wrong description", "hi", judgeAfter.asObjectable().getDescription());
assertInducedRoles(judgeAfter, "oid1", "oid2");
assertInducedRoles(judgeAfter, OID1, OID2);
}

// MID-4372
Expand Down Expand Up @@ -329,8 +332,8 @@ public void test600CreateRoleCaptain() throws Exception {
.name("captain")
.description("something")
.riskLevel("high")
.inducement(createAssignmentTo("oid1", ObjectTypes.ROLE, prismContext))
.inducement(createAssignmentTo("oid2", ObjectTypes.ROLE, prismContext));
.inducement(createAssignmentTo(OID1, ObjectTypes.ROLE, prismContext))
.inducement(createAssignmentTo(OID2, ObjectTypes.ROLE, prismContext));
ObjectDelta<RoleType> addObjectDelta = DeltaFactory.Object.createAddDelta(captain.asPrismObject());

executeTest(new TestDetails() {
Expand Down Expand Up @@ -419,7 +422,7 @@ public List<ApprovalInstruction> getApprovalSequence() {
display("Captain role", captainAfter);

assertEquals("Wrong risk level", "high", captainAfter.asObjectable().getRiskLevel());
assertInducedRoles(captainAfter, "oid1", "oid2");
assertInducedRoles(captainAfter, OID1, OID2);
}

@Test
Expand Down Expand Up @@ -515,8 +518,8 @@ public void test700CreateRoleThief() throws Exception {
.name("thief")
.description("something")
.riskLevel("high")
.inducement(createAssignmentTo("oid1", ObjectTypes.ROLE, prismContext))
.inducement(createAssignmentTo("oid2", ObjectTypes.ROLE, prismContext));
.inducement(createAssignmentTo(OID1, ObjectTypes.ROLE, prismContext))
.inducement(createAssignmentTo(OID2, ObjectTypes.ROLE, prismContext));

ObjectDelta<RoleType> addObjectDelta = DeltaFactory.Object.createAddDelta(thief.asPrismObject());

Expand Down Expand Up @@ -605,7 +608,7 @@ public List<ApprovalInstruction> getApprovalSequence() {
display("Thief role", thiefAfter);

assertEquals("Wrong risk level", "high", thiefAfter.asObjectable().getRiskLevel());
assertInducedRoles(thiefAfter, "oid1", "oid2");
assertInducedRoles(thiefAfter, OID1, OID2);
}

@Test
Expand Down

0 comments on commit 94cf273

Please sign in to comment.