From ef86c2d8f9a45b9fa77b771a3179fc3e85944bd4 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 23 Jun 2017 16:18:31 +0200 Subject: [PATCH] Fixed wf tests. --- .../model/test/AbstractModelIntegrationTest.java | 12 ++++++------ .../wf/impl/policy/other/TestMiscellaneous.java | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java index aff0ef4bf1e..927d272e292 100644 --- a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java +++ b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java @@ -2426,7 +2426,7 @@ public boolean check() throws CommonException { OperationResult result = task.getResult(); if (verbose) display("Check result", result); assert !isError(result, checkSubresult) : "Error in "+task+": "+TestUtil.getErrorMessage(result); - assert !isUknown(result, checkSubresult) : "Unknown result in "+task+": "+TestUtil.getErrorMessage(result); + assert !isUnknown(result, checkSubresult) : "Unknown result in "+task+": "+TestUtil.getErrorMessage(result); return !isInProgress(result, checkSubresult); } @Override @@ -2507,10 +2507,10 @@ public boolean check() throws CommonException { AssertJUnit.fail("Error in "+freshTask+": "+TestUtil.getErrorMessage(result)); } } - if (isUknown(result, checkSubresult)) { + if (isUnknown(result, checkSubresult)) { return false; } -// assert !isUknown(result, checkSubresult) : "Unknown result in "+freshTask+": "+IntegrationTestTools.getErrorMessage(result); +// assert !isUnknown(result, checkSubresult) : "Unknown result in "+freshTask+": "+IntegrationTestTools.getErrorMessage(result); return !isInProgress(result, checkSubresult); } @Override @@ -2543,7 +2543,7 @@ public boolean check() throws CommonException { OperationResult result = freshTask.getResult(); if (verbose) display("Check result", result); assert !isError(result, checkSubresult) : "Error in "+freshTask+": "+TestUtil.getErrorMessage(result); - if (isUknown(result, checkSubresult)) { + if (isUnknown(result, checkSubresult)) { return false; } return freshTask.getLastRunStartTimestamp() != null; @@ -2627,7 +2627,7 @@ public boolean check() throws CommonException { if (isError(taskResult, checkSubresult)) { return true; } - if (isUknown(taskResult, checkSubresult)) { + if (isUnknown(taskResult, checkSubresult)) { return false; } if (freshTask.getLastRunFinishTimestamp() == null) { @@ -2682,7 +2682,7 @@ private boolean isError(OperationResult result, boolean checkSubresult) { return subresult != null ? subresult.isError() : false; } - private boolean isUknown(OperationResult result, boolean checkSubresult) { + private boolean isUnknown(OperationResult result, boolean checkSubresult) { OperationResult subresult = getSubresult(result, checkSubresult); return subresult != null ? subresult.isUnknown() : false; // TODO or return true? } diff --git a/model/workflow-impl/src/test/java/com/evolveum/midpoint/wf/impl/policy/other/TestMiscellaneous.java b/model/workflow-impl/src/test/java/com/evolveum/midpoint/wf/impl/policy/other/TestMiscellaneous.java index 17ff4a1d230..593dd715045 100644 --- a/model/workflow-impl/src/test/java/com/evolveum/midpoint/wf/impl/policy/other/TestMiscellaneous.java +++ b/model/workflow-impl/src/test/java/com/evolveum/midpoint/wf/impl/policy/other/TestMiscellaneous.java @@ -111,7 +111,7 @@ public void test100RequesterComment() throws Exception { } Task parent = taskManager.createTaskInstance(wfTask.asPrismObject(), result).getParentTask(result); - waitForTaskFinish(parent.getOid(), true); + waitForTaskFinish(parent.getOid(), false); assertAssignedRole(userJackOid, roleRole2Oid, task, result); } @@ -151,7 +151,7 @@ public void test110RequestPrunedRole() throws Exception { workflowManager.completeWorkItem(workItem.getExternalId(), true, null, null, null, result); TaskType wfTask = getTask(WfContextUtil.getTask(workItem).getOid()).asObjectable(); Task parent = taskManager.createTaskInstance(wfTask.asPrismObject(), result).getParentTask(result); - waitForTaskFinish(parent.getOid(), true); + waitForTaskFinish(parent.getOid(), false); assertNotAssignedRole(userJackOid, roleRole2Oid, task, result); // should be pruned without approval }