summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-building-blocks/src/test
diff options
context:
space:
mode:
authorMarcus G K Williams <marcus.williams@intel.com>2019-04-10 16:41:06 -0700
committerMarcus G K Williams <marcus.williams@intel.com>2019-04-11 13:03:07 -0700
commit5bffd3ec2455a9c67206102873e3a6a321bfec5d (patch)
tree7f2e77cc76b1ffe4f5211d4b56c96de62a950568 /bpmn/so-bpmn-building-blocks/src/test
parent9be08883d82199a580247451597db87889075ca5 (diff)
Fix GR_API Homing
This change uses the correct variable name to enable homing in AssignVnfBB. The correct variable to use is not 'callHoming' but 'homing'. Also updated sunnyDayAssignVnfBBTest to use the correct variable and BaseBPMNTest. This change also corrects HomingBB and calls HomingV2 rather than SniroV2 or OofV2. HomingV2 already passes calls to the correct implimentation, no need do this in the BPMN. Issue-ID: SO-1470 Change-Id: I14a77ef75b8b86feed7af3aab4d52c0df5f12886 Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'bpmn/so-bpmn-building-blocks/src/test')
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVnfBBTest.java2
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/HomingBBTest.java17
3 files changed, 10 insertions, 13 deletions
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 2a0fef0caa..5ef4d7ea98 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
@@ -34,7 +34,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.onap.so.TestApplication;
-import org.onap.so.bpmn.buildingblock.SniroHomingV2;
+import org.onap.so.bpmn.buildingblock.HomingV2;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
import org.onap.so.bpmn.common.validation.BuildingBlockValidatorRunner;
import org.onap.so.bpmn.infrastructure.aai.tasks.AAICommonTasks;
@@ -230,7 +230,7 @@ public abstract class BaseBPMNTest {
protected SDNCClient sdncClient;
@MockBean
- protected SniroHomingV2 sniroHoming;
+ protected HomingV2 homing;
@MockBean
protected NamingServiceDeleteTasks namingServiceDeleteTasks;
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVnfBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVnfBBTest.java
index 9943e39ef6..f46331fdd4 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVnfBBTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVnfBBTest.java
@@ -33,7 +33,7 @@ import org.onap.so.bpmn.common.BuildingBlockExecution;
public class AssignVnfBBTest extends BaseBPMNTest {
@Test
public void sunnyDayAssignVnfBBTest() throws InterruptedException, IOException {
- variables.put("callHoming", true);
+ variables.put("homing", true);
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVnfBB", variables);
assertThat(pi).isNotNull();
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/HomingBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/HomingBBTest.java
index f1bb1462d6..bca4d3a979 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/HomingBBTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/HomingBBTest.java
@@ -25,12 +25,9 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.so.bpmn.buildingblock.SniroHomingV2;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.springframework.boot.test.mock.mockito.MockBean;
public class HomingBBTest extends BaseBPMNTest {
@@ -40,28 +37,28 @@ public class HomingBBTest extends BaseBPMNTest {
mockSubprocess("ReceiveWorkflowMessage", "Mock ReceiveWorkflowMessage", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("HomingBB", variables);
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassedInOrder("start", "sniroOofCheck", "callSniro", "ExclusiveGateway_1ckp059",
- "receiveAsyncCallback", "sniroOofCheck2", "processSniroSolution", "ExclusiveGateway_1kvzxpb", "end");
+ assertThat(pi).isStarted().hasPassedInOrder("start", "callHoming", "receiveAsyncCallback",
+ "processHomingSolution", "end");
assertThat(pi).isEnded();
}
@Test
public void testHomingV2_error_bpmnError() {
- doThrow(new BpmnError("MSOWorkflowException")).when(sniroHoming).callSniro(any(BuildingBlockExecution.class));
+ doThrow(new BpmnError("MSOWorkflowException")).when(homing).callHoming(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("HomingBB", variables);
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassed("start", "sniroOofCheck", "startBpmnError", "bpmnErrorSubprocess",
+ assertThat(pi).isStarted().hasPassed("start", "callHoming", "startBpmnError", "bpmnErrorSubprocess",
"processMsoWorkflowException", "endBpmnError").hasNotPassed("callReceiveAsync");
assertThat(pi).isEnded();
}
@Test
public void testHomingV2_error_javaException() {
- doThrow(new RuntimeException("Test")).when(sniroHoming).callSniro(any(BuildingBlockExecution.class));
+ doThrow(new RuntimeException("Test")).when(homing).callHoming(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("HomingBB", variables);
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassed("start", "sniroOofCheck", "callSniro", "startJavaError",
- "processJavaException", "javaExceptionSubProcess", "endJavaError").hasNotPassed("callReceiveAsync");
+ assertThat(pi).isStarted().hasPassed("start", "callHoming", "startJavaError", "processJavaException",
+ "javaExceptionSubProcess", "endJavaError").hasNotPassed("callReceiveAsync");
assertThat(pi).isEnded();
}