summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/test/java/org
diff options
context:
space:
mode:
authorMnushkin, Dmitry <dmitry.mnushkin@att.com>2019-07-24 12:44:16 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-07-24 12:44:16 -0400
commit8813ba72c340e45f586b71c9ee12382cdecec91f (patch)
tree0df8c2e6296abbdf29483d873bd90cf5a7e926c0 /bpmn/so-bpmn-tasks/src/test/java/org
parentcd0748e0dc1b509062b7c69a4ef11f2d354f81a7 (diff)
set multi-stage flag in listener to log success
set multi-stage flag in listener to log success msg added post listener for requests db object Issue-ID: SO-2153 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I4b27cbb69b983bd2f7c0d72c8ebb4d9c43201120
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java/org')
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipTest.java)19
1 files changed, 17 insertions, 2 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java
index b6f8aafa55..9e2eac416c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java
@@ -36,16 +36,16 @@ import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.common.BBConstants;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
-import org.onap.so.bpmn.infrastructure.workflow.tasks.listeners.MultiStageSkipListener;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.db.request.beans.InfraActiveRequests;
@RunWith(MockitoJUnitRunner.class)
-public class MultiStageSkipTest {
+public class MultiStageSkipListenerTest {
@Mock
private CatalogDbClient catalogDbClient;
@@ -71,6 +71,12 @@ public class MultiStageSkipTest {
assertFalse("should not be triggered",
multiStageSkipListener.shouldRunFor("AssignVfModuleBB2", true, execution));
+ execution.setVariable("multiStageDesign", true);
+ assertTrue("should be triggered", multiStageSkipListener.shouldRunFor(execution));
+
+ execution.setVariable("multiStageDesign", false);
+ assertFalse("should not be triggered", multiStageSkipListener.shouldRunFor(execution));
+
}
@@ -107,6 +113,15 @@ public class MultiStageSkipTest {
assertEquals("Flows should only have Assign", flowsToExecute.size(), 1);
assertEquals("Flows should only have Assign", flowsToExecute.get(0).getBuildingBlock().getBpmnFlowName(),
"AssignVfModuleBB");
+ }
+
+ @Test
+ public void postCompletionRequestsDbListenerTest() {
+ InfraActiveRequests request = new InfraActiveRequests();
+ BuildingBlockExecution execution = new DelegateExecutionImpl(new DelegateExecutionFake());
+ multiStageSkipListener.run(request, execution);
+ assertEquals("Successfully completed Assign Building Block only due to multi-stage-design VNF",
+ request.getFlowStatus());
}
}