From 07c30c3f010df4c5a66d060eda4eb0866b078bf6 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Thu, 26 Sep 2019 13:10:46 -0400 Subject: Set WorkflowException on BPMN WF error WorkflowException needs to be set when execution of a custom workflows fails due to an error from BPMN Issue-ID: SO-2369 Signed-off-by: Kuleshov, Elena Change-Id: Ie5ab66105681588000693fdbb3ca89310aee8a7c --- .../bpmn/infrastructure/activity/ExecuteActivityTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bpmn/so-bpmn-tasks/src/test/java/org') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java index c0056291ef..1fde3f4fbc 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java @@ -91,6 +91,19 @@ public class ExecuteActivityTest extends BaseTaskTest { assertEquals(ebb.getBuildingBlock(), bb); } + @Test + public void executeException_Test() throws Exception { + execution.setVariable("workflowSyncAckSent", true); + execution.setVariable("testProcessKey", "testProcessKeyValue"); + thrown.expect(BpmnError.class); + executeActivity.execute(execution); + String errorMessage = (String) execution.getVariable("ExecuteActivityErrorMessage"); + assertEquals(errorMessage, "not implemented"); + WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException"); + assertEquals(workflowException.getErrorMessage(), "not implemented"); + assertEquals(workflowException.getErrorCode(), 7000); + } + @Test public void buildAndThrowException_Test() throws Exception { doNothing().when(workflowActionBBFailure).updateRequestStatusToFailed(execution); -- cgit 1.2.3-korg