From 14a324a7607335b381552e27c345970d5c2a2070 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan (sk720x)" Date: Mon, 10 Dec 2018 15:33:39 -0500 Subject: refactor updaterequeststatustofailed method fixed compliation error in workflowActionbbtest mocks moved request db failure logic to a separate class refactored and added test cases for updateReqToFailed Change-Id: Ie928aa541e86afb8e867ca445258b118eed8b357 Issue-ID: SO-1310 Signed-off-by: Kalkere Ramesh, Sharan (sk720x) --- .../main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn | 8 ++++---- .../src/test/java/org/onap/so/bpmn/BaseBPMNTest.java | 4 ++++ .../so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'bpmn/so-bpmn-building-blocks') diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn index 4b075d403b..2ca9437e9b 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_15s0okp @@ -79,7 +79,7 @@ SequenceFlow_0wvzfgf - + SequenceFlow_024g0d1 SequenceFlow_0eana0l SequenceFlow_0wvzfgf @@ -116,7 +116,7 @@ - + SequenceFlow_02ksbt0 SequenceFlow_1p8yxu6 @@ -164,7 +164,7 @@ - + SequenceFlow_11dlyzt SequenceFlow_0l7kaba SequenceFlow_1ui67mc diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java index f9ff28a023..1e3f175cf1 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java @@ -68,6 +68,7 @@ import org.onap.so.bpmn.infrastructure.sdnc.tasks.SDNCUnassignTasks; import org.onap.so.bpmn.infrastructure.workflow.tasks.FlowCompletionTasks; import org.onap.so.bpmn.infrastructure.workflow.tasks.OrchestrationStatusValidator; import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowAction; +import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionBBFailure; import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionBBTasks; import org.onap.so.bpmn.sdno.tasks.SDNOHealthCheckTasks; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; @@ -219,6 +220,9 @@ public abstract class BaseBPMNTest { @MockBean protected SniroHomingV2 sniroHoming; + + @MockBean + protected WorkflowActionBBFailure workflowActionBBFailure; @LocalServerPort protected int port; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java index 5da6d3a577..45dafbe606 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java @@ -92,7 +92,7 @@ public class WorkflowActionBBTest extends BaseBPMNTest { Map map = new HashMap<>(); map.put("handlingCode", "Abort"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBTasks).abortCallErrorHandling(any(DelegateExecution.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBFailure).abortCallErrorHandling(any(DelegateExecution.class)); mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); -- cgit 1.2.3-korg