Code changes in BPMN infra for RAN Slice Use case
[so.git] / bpmn / so-bpmn-building-blocks / src / test / java / org / onap / so / bpmn / infrastructure / bpmn / subprocess / ExecuteBuildingBlockTest.java
index 07554cd..c2363b7 100644 (file)
 
 package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
 
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doThrow;
-import java.util.List;
 import org.camunda.bpm.engine.ManagementService;
 import org.camunda.bpm.engine.TaskService;
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.management.JobDefinition;
 import org.camunda.bpm.engine.runtime.Job;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.camunda.bpm.engine.task.Task;
-import org.camunda.bpm.engine.test.ProcessEngineRule;
 import org.junit.Ignore;
-import org.junit.Rule;
 import org.junit.Test;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
 import org.onap.so.bpmn.BaseBPMNTest;
 import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective;
 import org.springframework.beans.factory.annotation.Autowired;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
 
 public class ExecuteBuildingBlockTest extends BaseBPMNTest {
     @Autowired
@@ -55,6 +47,7 @@ public class ExecuteBuildingBlockTest extends BaseBPMNTest {
 
         variables.put("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.CONTINUE);
         variables.put("flowToBeCalled", "MockFlow");
+        variables.put("homing", false);
 
         mockSubprocess("MockFlow", "My Mock Process Name", "GenericStub");
 
@@ -72,6 +65,7 @@ public class ExecuteBuildingBlockTest extends BaseBPMNTest {
     @Test
     public void test_sunnyDayExecuteBuildingBlock_silentSuccess() throws Exception {
         variables.put("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS);
+        variables.put("homing", false);
 
         ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables);
         assertThat(pi).isNotNull();
@@ -87,6 +81,7 @@ public class ExecuteBuildingBlockTest extends BaseBPMNTest {
     public void test_rainyDayExecuteBuildingBlock_rollbackOrAbort() throws Exception {
         doThrow(new BpmnError("7000", "TESTING ERRORS")).when(bbInputSetup).execute(any(DelegateExecution.class));
         ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables);
+        variables.put("homing", false);
         assertThat(pi).isNotNull();
         assertThat(pi).isStarted()
                 .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StartEvent_0tmcs9g",
@@ -104,6 +99,7 @@ public class ExecuteBuildingBlockTest extends BaseBPMNTest {
 
         variables.put("handlingCode", "Retry");
         variables.put("RetryCount", 5);
+        variables.put("homing", false);
 
         ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables);
         assertThat(pi).isNotNull();
@@ -124,6 +120,7 @@ public class ExecuteBuildingBlockTest extends BaseBPMNTest {
         variables.put("handlingCode", "Retry");
         variables.put("RetryCount", 4);
         variables.put("RetryDuration", "PT1S");
+        variables.put("homing", false);
 
         ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables);
         assertThat(pi).isNotNull();