From 5bffd3ec2455a9c67206102873e3a6a321bfec5d Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Wed, 10 Apr 2019 16:41:06 -0700 Subject: 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 --- .../subprocess/BuildingBlock/AssignVnfBB.bpmn | 4 +- .../subprocess/BuildingBlock/HomingBB.bpmn | 272 ++++++--------------- .../test/java/org/onap/so/bpmn/BaseBPMNTest.java | 4 +- .../bpmn/subprocess/AssignVnfBBTest.java | 2 +- .../bpmn/subprocess/HomingBBTest.java | 17 +- 5 files changed, 81 insertions(+), 218 deletions(-) (limited to 'bpmn/so-bpmn-building-blocks/src') diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignVnfBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignVnfBB.bpmn index ea762c8719..7bb97939dd 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignVnfBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignVnfBB.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_0zaz9o2 @@ -24,7 +24,7 @@ - + diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn index cd62636b77..b66ecfa329 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn @@ -1,10 +1,9 @@ - + - SequenceFlow_1x9usa6 + SequenceFlow_0jtjlbu - SequenceFlow_1rf4vs8 @@ -43,7 +42,7 @@ ex.processJavaException(execution)]]> - + @@ -52,278 +51,145 @@ ex.processJavaException(execution)]]> - SequenceFlow_1qbnm82 - SequenceFlow_1fipbmk + SequenceFlow_0qrwjzu + SequenceFlow_03cy5y5 - - - SequenceFlow_1urt5i6 + SequenceFlow_138xgla - - - - - - - - - - - - - - - SequenceFlow_1dtador - SequenceFlow_0lc15i7 + + SequenceFlow_0jtjlbu + SequenceFlow_0qrwjzu - - SequenceFlow_08k112s - SequenceFlow_01apjvo + + SequenceFlow_03cy5y5 + SequenceFlow_138xgla - - SequenceFlow_0m6nhqg - SequenceFlow_0kvax6n - - - SequenceFlow_0oixz4g - SequenceFlow_0ph4paa - - - SequenceFlow_1x9usa6 - SequenceFlow_1dtador - SequenceFlow_0m6nhqg - - - SequenceFlow_0lc15i7 - SequenceFlow_0kvax6n - SequenceFlow_1qbnm82 - - - SequenceFlow_1fipbmk - SequenceFlow_08k112s - SequenceFlow_0oixz4g - - - SequenceFlow_01apjvo - SequenceFlow_0ph4paa - SequenceFlow_1urt5i6 - + + + + - + - + - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - + + + + - + - - + + - + - - + + - + - + - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - + - - - - + + + - + - - - - + + + - + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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(); } -- cgit 1.2.3-korg