aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-flows/src
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-flows/src')
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn4
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSWUPDownload.bpmn202
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSoftwareUpgrade.bpmn273
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java68
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSWUPDownloadTest.java230
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSoftwareUpgradeTest.java236
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/PNFSoftwareUpgradeTest.json54
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest.json26
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest_catalogdb.json39
9 files changed, 1103 insertions, 29 deletions
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn
index 693dd922e2..234c744e4a 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn
@@ -22,7 +22,7 @@
<bpmn:outgoing>SequenceFlow_1w4p9f7</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_1owbpsy" name="Success" sourceRef="ExclusiveGateway_0vtv1wi" targetRef="Task_14cwhgk">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("CDSStatus").equals("Success")}</bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:exclusiveGateway id="ExclusiveGateway_01jwwmc" default="SequenceFlow_0d24h26">
<bpmn:incoming>SequenceFlow_02919fh</bpmn:incoming>
@@ -30,7 +30,7 @@
<bpmn:outgoing>SequenceFlow_0d24h26</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_1n080up" name="Success" sourceRef="ExclusiveGateway_01jwwmc" targetRef="EndEvent_0xky46v">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("CDSStatus").equals("Success")}</bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_1w4p9f7" name="Failure" sourceRef="ExclusiveGateway_0vtv1wi" targetRef="EndEvent_16620h9" />
<bpmn:endEvent id="EndEvent_16620h9">
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSWUPDownload.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSWUPDownload.bpmn
new file mode 100644
index 0000000000..24ca7104a7
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSWUPDownload.bpmn
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0474hns" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.3.4">
+ <bpmn:process id="PNFSWUPDownload" name="PNFSWUPDownload" isExecutable="true">
+ <bpmn:startEvent id="download_StartEvent" name="Start Flow">
+ <bpmn:outgoing>SequenceFlow_1fdclh0</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="ServiceTask_1mpt2eq" name="NF Download Dispatcher" camunda:delegateExpression="${NfSoftwareUpgradeDispatcher}">
+ <bpmn:incoming>SequenceFlow_1fdclh0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_12155q6</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:endEvent id="download_EndEvent" name="End">
+ <bpmn:incoming>SequenceFlow_1d2rfyx</bpmn:incoming>
+ <bpmn:terminateEventDefinition id="TerminateEventDefinition_1kiurmf" />
+ </bpmn:endEvent>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_1ja7grm" default="SequenceFlow_078xmlz">
+ <bpmn:incoming>SequenceFlow_0o6b6a8</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_078xmlz</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0qznt4u</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:endEvent id="EndEvent_1j64ij1">
+ <bpmn:incoming>SequenceFlow_078xmlz</bpmn:incoming>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_0b3kbjs" errorRef="Error_1q14dnd" />
+ </bpmn:endEvent>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_1rj84ne" default="SequenceFlow_1tfbzn1">
+ <bpmn:incoming>SequenceFlow_1ccldpp</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0s6i4o9</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1tfbzn1</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:endEvent id="EndEvent_1ubpef4">
+ <bpmn:incoming>SequenceFlow_1tfbzn1</bpmn:incoming>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_0wevx6s" errorRef="Error_1q14dnd" />
+ </bpmn:endEvent>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_08lusga" default="SequenceFlow_1gawssm">
+ <bpmn:incoming>SequenceFlow_1kaikh5</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1d2rfyx</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1gawssm</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:endEvent id="EndEvent_11hee4g">
+ <bpmn:incoming>SequenceFlow_1gawssm</bpmn:incoming>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_12tyzwb" errorRef="Error_1q14dnd" />
+ </bpmn:endEvent>
+ <bpmn:serviceTask id="ServiceTask_0yavde3" name="Download" camunda:delegateExpression="${ControllerExecutionDE}">
+ <bpmn:extensionElements>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="action">downloadNESw</camunda:inputParameter>
+ <camunda:inputParameter name="scope">pnf</camunda:inputParameter>
+ <camunda:inputParameter name="mode">async</camunda:inputParameter>
+ </camunda:inputOutput>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_0s6i4o9</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0o6b6a8</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:serviceTask id="ServiceTask_1wxo7xz" name="Post check" camunda:delegateExpression="${ControllerExecutionDE}">
+ <bpmn:extensionElements>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="action">postCheck</camunda:inputParameter>
+ <camunda:inputParameter name="scope">pnf</camunda:inputParameter>
+ <camunda:inputParameter name="mode">async</camunda:inputParameter>
+ </camunda:inputOutput>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_0qznt4u</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1kaikh5</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:serviceTask id="ServiceTask_1nl90ao" name="Pre check" camunda:delegateExpression="${ControllerExecutionDE}">
+ <bpmn:extensionElements>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="action">preCheck</camunda:inputParameter>
+ <camunda:inputParameter name="scope">pnf</camunda:inputParameter>
+ <camunda:inputParameter name="mode">async</camunda:inputParameter>
+ </camunda:inputOutput>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_12155q6</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ccldpp</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1fdclh0" sourceRef="download_StartEvent" targetRef="ServiceTask_1mpt2eq" />
+ <bpmn:sequenceFlow id="SequenceFlow_12155q6" sourceRef="ServiceTask_1mpt2eq" targetRef="ServiceTask_1nl90ao" />
+ <bpmn:sequenceFlow id="SequenceFlow_1d2rfyx" name="Success" sourceRef="ExclusiveGateway_08lusga" targetRef="download_EndEvent">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_0o6b6a8" sourceRef="ServiceTask_0yavde3" targetRef="ExclusiveGateway_1ja7grm" />
+ <bpmn:sequenceFlow id="SequenceFlow_078xmlz" name="Failure" sourceRef="ExclusiveGateway_1ja7grm" targetRef="EndEvent_1j64ij1" />
+ <bpmn:sequenceFlow id="SequenceFlow_1ccldpp" sourceRef="ServiceTask_1nl90ao" targetRef="ExclusiveGateway_1rj84ne" />
+ <bpmn:sequenceFlow id="SequenceFlow_0s6i4o9" name="Success" sourceRef="ExclusiveGateway_1rj84ne" targetRef="ServiceTask_0yavde3">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1tfbzn1" name="Failure" sourceRef="ExclusiveGateway_1rj84ne" targetRef="EndEvent_1ubpef4" />
+ <bpmn:sequenceFlow id="SequenceFlow_1kaikh5" sourceRef="ServiceTask_1wxo7xz" targetRef="ExclusiveGateway_08lusga" />
+ <bpmn:sequenceFlow id="SequenceFlow_1gawssm" name="Failure" sourceRef="ExclusiveGateway_08lusga" targetRef="EndEvent_11hee4g" />
+ <bpmn:sequenceFlow id="SequenceFlow_0qznt4u" name="Success" sourceRef="ExclusiveGateway_1ja7grm" targetRef="ServiceTask_1wxo7xz">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ </bpmn:process>
+ <bpmn:error id="Error_1q14dnd" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="PNFSWUPDownload">
+ <bpmndi:BPMNShape id="StartEvent_1k8gssq_di" bpmnElement="download_StartEvent">
+ <dc:Bounds x="162" y="102" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="157" y="145" width="50" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1mpt2eq_di" bpmnElement="ServiceTask_1mpt2eq">
+ <dc:Bounds x="280" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_1e4dq7w_di" bpmnElement="download_EndEvent">
+ <dc:Bounds x="1312" y="102" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1321" y="145" width="20" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1ja7grm_di" bpmnElement="ExclusiveGateway_1ja7grm" isMarkerVisible="true">
+ <dc:Bounds x="895" y="95" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_1j64ij1_di" bpmnElement="EndEvent_1j64ij1">
+ <dc:Bounds x="902" y="252" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1rj84ne_di" bpmnElement="ExclusiveGateway_1rj84ne" isMarkerVisible="true">
+ <dc:Bounds x="635" y="95" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_1ubpef4_di" bpmnElement="EndEvent_1ubpef4">
+ <dc:Bounds x="642" y="252" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_08lusga_di" bpmnElement="ExclusiveGateway_08lusga" isMarkerVisible="true">
+ <dc:Bounds x="1155" y="95" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_11hee4g_di" bpmnElement="EndEvent_11hee4g">
+ <dc:Bounds x="1162" y="252" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_0yavde3_di" bpmnElement="ServiceTask_0yavde3">
+ <dc:Bounds x="760" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1wxo7xz_di" bpmnElement="ServiceTask_1wxo7xz">
+ <dc:Bounds x="1000" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1nl90ao_di" bpmnElement="ServiceTask_1nl90ao">
+ <dc:Bounds x="480" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1fdclh0_di" bpmnElement="SequenceFlow_1fdclh0">
+ <di:waypoint x="198" y="120" />
+ <di:waypoint x="280" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_12155q6_di" bpmnElement="SequenceFlow_12155q6">
+ <di:waypoint x="380" y="120" />
+ <di:waypoint x="480" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1d2rfyx_di" bpmnElement="SequenceFlow_1d2rfyx">
+ <di:waypoint x="1205" y="120" />
+ <di:waypoint x="1312" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1214" y="102" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0o6b6a8_di" bpmnElement="SequenceFlow_0o6b6a8">
+ <di:waypoint x="860" y="120" />
+ <di:waypoint x="895" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_078xmlz_di" bpmnElement="SequenceFlow_078xmlz">
+ <di:waypoint x="920" y="145" />
+ <di:waypoint x="920" y="252" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="918" y="217" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ccldpp_di" bpmnElement="SequenceFlow_1ccldpp">
+ <di:waypoint x="580" y="120" />
+ <di:waypoint x="635" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0s6i4o9_di" bpmnElement="SequenceFlow_0s6i4o9">
+ <di:waypoint x="685" y="120" />
+ <di:waypoint x="760" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="678" y="102" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1tfbzn1_di" bpmnElement="SequenceFlow_1tfbzn1">
+ <di:waypoint x="660" y="145" />
+ <di:waypoint x="660" y="252" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="658" y="217" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1kaikh5_di" bpmnElement="SequenceFlow_1kaikh5">
+ <di:waypoint x="1100" y="120" />
+ <di:waypoint x="1155" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1gawssm_di" bpmnElement="SequenceFlow_1gawssm">
+ <di:waypoint x="1180" y="145" />
+ <di:waypoint x="1180" y="252" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1178" y="172" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0qznt4u_di" bpmnElement="SequenceFlow_0qznt4u">
+ <di:waypoint x="945" y="120" />
+ <di:waypoint x="1000" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="951" y="102" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSoftwareUpgrade.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSoftwareUpgrade.bpmn
new file mode 100644
index 0000000000..8d59dac8ac
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSoftwareUpgrade.bpmn
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1yd8m0g" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.3.4">
+ <bpmn:process id="PNFSoftwareUpgrade" name="PNFSoftwareUpgrade" isExecutable="true">
+ <bpmn:startEvent id="softwareUpgrade_startEvent" name="Start Flow">
+ <bpmn:outgoing>SequenceFlow_1ng4b6l</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="ServiceTask_042uz7n" name="NF Upgrade Dispatcher" camunda:delegateExpression="${NfSoftwareUpgradeDispatcher}">
+ <bpmn:incoming>SequenceFlow_1ng4b6l</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_12ejx4m</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_12ejx4m" sourceRef="ServiceTask_042uz7n" targetRef="ServiceTask_0slpahe" />
+ <bpmn:endEvent id="softwareUpgrade_endEvent" name="End">
+ <bpmn:incoming>SequenceFlow_1atiydu</bpmn:incoming>
+ <bpmn:terminateEventDefinition />
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1ng4b6l" sourceRef="softwareUpgrade_startEvent" targetRef="ServiceTask_042uz7n" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0v3l3wv" default="SequenceFlow_1lr7vgu">
+ <bpmn:incoming>SequenceFlow_0cchgih</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1lr7vgu</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1eljvek</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:endEvent id="EndEvent_0bnbfds">
+ <bpmn:incoming>SequenceFlow_1lr7vgu</bpmn:incoming>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_1sjbsm2" errorRef="Error_12cpov5" />
+ </bpmn:endEvent>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0x6h0ni" default="SequenceFlow_0piri91">
+ <bpmn:incoming>SequenceFlow_0j26xlx</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1nsmyr5</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0piri91</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_1nsmyr5" name="Success" sourceRef="ExclusiveGateway_0x6h0ni" targetRef="ServiceTask_0x5cje8">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:endEvent id="EndEvent_180lm4y">
+ <bpmn:incoming>SequenceFlow_0piri91</bpmn:incoming>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_0fm5he7" errorRef="Error_12cpov5" />
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_0piri91" name="Failure" sourceRef="ExclusiveGateway_0x6h0ni" targetRef="EndEvent_180lm4y" />
+ <bpmn:sequenceFlow id="SequenceFlow_1lr7vgu" name="Failure" sourceRef="ExclusiveGateway_0v3l3wv" targetRef="EndEvent_0bnbfds" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0ch3fef" default="SequenceFlow_0dqnb6c">
+ <bpmn:incoming>SequenceFlow_015y785</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0dqnb6c</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0eiif6e</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:endEvent id="EndEvent_1ms4wdz">
+ <bpmn:incoming>SequenceFlow_0dqnb6c</bpmn:incoming>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_15s8fgk" errorRef="Error_12cpov5" />
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_0dqnb6c" name="Failure" sourceRef="ExclusiveGateway_0ch3fef" targetRef="EndEvent_1ms4wdz" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_1ny9b1z" default="SequenceFlow_1p0axph">
+ <bpmn:incoming>SequenceFlow_0g3qcd0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1p0axph</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1atiydu</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:endEvent id="EndEvent_0l6n6x5">
+ <bpmn:incoming>SequenceFlow_1p0axph</bpmn:incoming>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_1l0gsy0" errorRef="Error_12cpov5" />
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1p0axph" name="Failure" sourceRef="ExclusiveGateway_1ny9b1z" targetRef="EndEvent_0l6n6x5" />
+ <bpmn:sequenceFlow id="SequenceFlow_1eljvek" name="Success" sourceRef="ExclusiveGateway_0v3l3wv" targetRef="ServiceTask_02lxf48">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1atiydu" name="Success" sourceRef="ExclusiveGateway_1ny9b1z" targetRef="softwareUpgrade_endEvent">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_0eiif6e" name="Success" sourceRef="ExclusiveGateway_0ch3fef" targetRef="ServiceTask_1jo8vn7">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:serviceTask id="ServiceTask_0x5cje8" name="Download" camunda:delegateExpression="${ControllerExecutionDE}">
+ <bpmn:extensionElements>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="action">downloadNESw</camunda:inputParameter>
+ <camunda:inputParameter name="scope">pnf</camunda:inputParameter>
+ <camunda:inputParameter name="mode">async</camunda:inputParameter>
+ </camunda:inputOutput>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1nsmyr5</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0cchgih</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0cchgih" sourceRef="ServiceTask_0x5cje8" targetRef="ExclusiveGateway_0v3l3wv" />
+ <bpmn:serviceTask id="ServiceTask_02lxf48" name="Activate" camunda:delegateExpression="${ControllerExecutionDE}">
+ <bpmn:extensionElements>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="action">activateNESw</camunda:inputParameter>
+ <camunda:inputParameter name="scope">pnf</camunda:inputParameter>
+ <camunda:inputParameter name="mode">async</camunda:inputParameter>
+ </camunda:inputOutput>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1eljvek</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_015y785</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_015y785" sourceRef="ServiceTask_02lxf48" targetRef="ExclusiveGateway_0ch3fef" />
+ <bpmn:serviceTask id="ServiceTask_0y2uysu" name="Post check" camunda:delegateExpression="${ControllerExecutionDE}">
+ <bpmn:extensionElements>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="action">postCheck</camunda:inputParameter>
+ <camunda:inputParameter name="scope">pnf</camunda:inputParameter>
+ <camunda:inputParameter name="mode">async</camunda:inputParameter>
+ </camunda:inputOutput>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_084orr1</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0g3qcd0</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0g3qcd0" sourceRef="ServiceTask_0y2uysu" targetRef="ExclusiveGateway_1ny9b1z" />
+ <bpmn:serviceTask id="ServiceTask_0slpahe" name="Pre check" camunda:delegateExpression="${ControllerExecutionDE}">
+ <bpmn:extensionElements>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="action">preCheck</camunda:inputParameter>
+ <camunda:inputParameter name="scope">pnf</camunda:inputParameter>
+ <camunda:inputParameter name="mode">async</camunda:inputParameter>
+ </camunda:inputOutput>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_12ejx4m</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0j26xlx</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0j26xlx" sourceRef="ServiceTask_0slpahe" targetRef="ExclusiveGateway_0x6h0ni" />
+ <bpmn:serviceTask id="ServiceTask_1jo8vn7" name="Update Pnf in AAI" camunda:delegateExpression="${UpdatePnfEntryInAai}">
+ <bpmn:incoming>SequenceFlow_0eiif6e</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_084orr1</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_084orr1" sourceRef="ServiceTask_1jo8vn7" targetRef="ServiceTask_0y2uysu" />
+ </bpmn:process>
+ <bpmn:error id="Error_12cpov5" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
+ <bpmn:error id="Error_0nmskzh" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="PNFSoftwareUpgrade">
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="softwareUpgrade_startEvent">
+ <dc:Bounds x="162" y="102" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="157" y="145" width="50" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_042uz7n_di" bpmnElement="ServiceTask_042uz7n">
+ <dc:Bounds x="280" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_12ejx4m_di" bpmnElement="SequenceFlow_12ejx4m">
+ <di:waypoint x="380" y="120" />
+ <di:waypoint x="480" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_1w3jv30_di" bpmnElement="softwareUpgrade_endEvent">
+ <dc:Bounds x="1662" y="102" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1671" y="145" width="20" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ng4b6l_di" bpmnElement="SequenceFlow_1ng4b6l">
+ <di:waypoint x="198" y="120" />
+ <di:waypoint x="280" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0v3l3wv_di" bpmnElement="ExclusiveGateway_0v3l3wv" isMarkerVisible="true">
+ <dc:Bounds x="895" y="95" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1040" y="65" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_0bnbfds_di" bpmnElement="EndEvent_0bnbfds">
+ <dc:Bounds x="902" y="252" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1044" y="295" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0x6h0ni_di" bpmnElement="ExclusiveGateway_0x6h0ni" isMarkerVisible="true">
+ <dc:Bounds x="635" y="95" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1nsmyr5_di" bpmnElement="SequenceFlow_1nsmyr5">
+ <di:waypoint x="685" y="120" />
+ <di:waypoint x="760" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="678" y="102" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_180lm4y_di" bpmnElement="EndEvent_180lm4y">
+ <dc:Bounds x="642" y="252" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0piri91_di" bpmnElement="SequenceFlow_0piri91">
+ <di:waypoint x="660" y="145" />
+ <di:waypoint x="660" y="252" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="658" y="217" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1lr7vgu_di" bpmnElement="SequenceFlow_1lr7vgu">
+ <di:waypoint x="920" y="145" />
+ <di:waypoint x="920" y="252" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="918" y="217" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0ch3fef_di" bpmnElement="ExclusiveGateway_0ch3fef" isMarkerVisible="true">
+ <dc:Bounds x="1125" y="95" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_1ms4wdz_di" bpmnElement="EndEvent_1ms4wdz">
+ <dc:Bounds x="1132" y="252" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0dqnb6c_di" bpmnElement="SequenceFlow_0dqnb6c">
+ <di:waypoint x="1150" y="145" />
+ <di:waypoint x="1150" y="252" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1148" y="230" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1ny9b1z_di" bpmnElement="ExclusiveGateway_1ny9b1z" isMarkerVisible="true">
+ <dc:Bounds x="1505" y="95" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_0l6n6x5_di" bpmnElement="EndEvent_0l6n6x5">
+ <dc:Bounds x="1512" y="252" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1p0axph_di" bpmnElement="SequenceFlow_1p0axph">
+ <di:waypoint x="1530" y="145" />
+ <di:waypoint x="1530" y="252" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1528" y="172" width="34" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1eljvek_di" bpmnElement="SequenceFlow_1eljvek">
+ <di:waypoint x="945" y="120" />
+ <di:waypoint x="1010" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="938" y="102" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1atiydu_di" bpmnElement="SequenceFlow_1atiydu">
+ <di:waypoint x="1555" y="120" />
+ <di:waypoint x="1662" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1564" y="102" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0eiif6e_di" bpmnElement="SequenceFlow_0eiif6e">
+ <di:waypoint x="1175" y="120" />
+ <di:waypoint x="1210" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1169" y="102" width="43" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0x5cje8_di" bpmnElement="ServiceTask_0x5cje8">
+ <dc:Bounds x="760" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0cchgih_di" bpmnElement="SequenceFlow_0cchgih">
+ <di:waypoint x="860" y="120" />
+ <di:waypoint x="895" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_02lxf48_di" bpmnElement="ServiceTask_02lxf48">
+ <dc:Bounds x="1010" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_015y785_di" bpmnElement="SequenceFlow_015y785">
+ <di:waypoint x="1110" y="120" />
+ <di:waypoint x="1125" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0y2uysu_di" bpmnElement="ServiceTask_0y2uysu">
+ <dc:Bounds x="1370" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0g3qcd0_di" bpmnElement="SequenceFlow_0g3qcd0">
+ <di:waypoint x="1470" y="120" />
+ <di:waypoint x="1505" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0slpahe_di" bpmnElement="ServiceTask_0slpahe">
+ <dc:Bounds x="480" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0j26xlx_di" bpmnElement="SequenceFlow_0j26xlx">
+ <di:waypoint x="580" y="120" />
+ <di:waypoint x="635" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1jo8vn7_di" bpmnElement="ServiceTask_1jo8vn7">
+ <dc:Bounds x="1210" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_084orr1_di" bpmnElement="SequenceFlow_084orr1">
+ <di:waypoint x="1310" y="120" />
+ <di:waypoint x="1370" y="120" />
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java
index aea06b5fc9..d426dc3f66 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java
@@ -20,22 +20,9 @@
package org.onap.so.bpmn.infrastructure.process;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.ok;
-import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.fail;
-import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
-import java.io.IOException;
-import java.util.List;
-import java.util.UUID;
+import com.google.protobuf.Struct;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
@@ -47,7 +34,21 @@ import org.onap.so.client.aai.AAIVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import com.google.protobuf.Struct;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.ok;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
/**
@@ -62,10 +63,10 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
private static final String TEST_PROCESSINSTANCE_KEY = "CreateVcpeResCustService_simplified";
private static final AAIVersion VERSION = AAIVersion.LATEST;
+ private static final Map<String, Object> executionVariables = new HashMap();
private String testBusinessKey;
private String requestObject;
private String responseObject;
- private String msoRequestId;
@Autowired
private GrpcNettyServer grpcNettyServer;
@@ -76,25 +77,25 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
requestObject = FileUtil.readResourceFile("request/" + getClass().getSimpleName() + ".json");
responseObject = FileUtil.readResourceFile("response/" + getClass().getSimpleName() + ".json");
- variables.put("bpmnRequest", requestObject);
+ executionVariables.clear();
+
+ executionVariables.put("bpmnRequest", requestObject);
/**
* This variable indicates that the flow was invoked asynchronously. It's injected by {@link WorkflowProcessor}.
*/
- variables.put("isAsyncProcess", "true");
+ executionVariables.put("isAsyncProcess", "true");
/**
* Temporary solution to add pnfCorrelationId to context. this value is getting from the request to SO api
* handler and then convert to CamudaInput
*/
- variables.put("pnfCorrelationId", "PNFDemo");
+ executionVariables.put("pnfCorrelationId", "PNFDemo");
/**
* Create mso-request-id.
*/
- msoRequestId = UUID.randomUUID().toString();
- variables.put("mso-request-id", msoRequestId);
/**
* Create Business key for the process instance
@@ -113,8 +114,11 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
mockAai();
mockDmaapForPnf();
+ final String msoRequestId = UUID.randomUUID().toString();
+ executionVariables.put("mso-request-id", msoRequestId);
+
ProcessInstance pi =
- runtimeService.startProcessInstanceByKey(TEST_PROCESSINSTANCE_KEY, testBusinessKey, variables);
+ runtimeService.startProcessInstanceByKey(TEST_PROCESSINSTANCE_KEY, testBusinessKey, executionVariables);
int waitCount = 10;
while (!isProcessInstanceEnded() && waitCount >= 0) {
@@ -129,14 +133,24 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
"callCompleteMsoProcess_CallActivity", "ScriptTask_2", "CreateVCPE_EndEvent");
List<ExecutionServiceInput> detailedMessages = grpcNettyServer.getDetailedMessages();
- assertThat(detailedMessages).hasSize(2);
+ assertThat(detailedMessages.size() == 2);
+ int count = 0;
try {
- checkConfigAssign(detailedMessages.get(0));
- checkConfigDeploy(detailedMessages.get(1));
+ for (ExecutionServiceInput eSI : detailedMessages) {
+ if ("config-assign".equals(eSI.getActionIdentifiers().getActionName())) {
+ checkConfigAssign(eSI, msoRequestId);
+ count++;
+ }
+ if ("config-deploy".equals(eSI.getActionIdentifiers().getActionName())) {
+ checkConfigDeploy(eSI, msoRequestId);
+ count++;
+ }
+ }
} catch (Exception e) {
e.printStackTrace();
fail("ConfigAssign/deploy request exception", e);
}
+ assertThat(count == 2);
}
private boolean isProcessInstanceEnded() {
@@ -144,7 +158,7 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
.singleResult() == null;
}
- private void checkConfigAssign(ExecutionServiceInput executionServiceInput) {
+ private void checkConfigAssign(ExecutionServiceInput executionServiceInput, String msoRequestId) {
logger.info("Checking the configAssign request");
ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
@@ -175,7 +189,7 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
.isEqualTo("68dc9a92-214c-11e7-93ae-92361f002680");
}
- private void checkConfigDeploy(ExecutionServiceInput executionServiceInput) {
+ private void checkConfigDeploy(ExecutionServiceInput executionServiceInput, String msoRequestId) {
logger.info("Checking the configDeploy request");
ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSWUPDownloadTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSWUPDownloadTest.java
new file mode 100644
index 0000000000..065d2a54a8
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSWUPDownloadTest.java
@@ -0,0 +1,230 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.process;
+
+import com.google.protobuf.Struct;
+import org.assertj.core.api.Assertions;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
+import org.onap.so.BaseBPMNTest;
+import org.onap.so.GrpcNettyServer;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames;
+import org.onap.so.bpmn.mock.FileUtil;
+import org.onap.so.client.aai.AAIVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.assertj.core.api.Assertions.fail;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+
+/**
+ * Basic Integration test for PNFSWUPDownloadTest.bpmn workflow.
+ */
+public class PNFSWUPDownloadTest extends BaseBPMNTest {
+
+ private final Logger logger = LoggerFactory.getLogger(getClass());
+
+ private static final long WORKFLOW_WAIT_TIME = 1000L;
+
+ private static final String TEST_PROCESSINSTANCE_KEY = "PNFSWUPDownload";
+ private static final AAIVersion VERSION = AAIVersion.LATEST;
+ private static final Map<String, Object> executionVariables = new HashMap();
+ private final String[] actionNames = new String[3];
+ private String responseObject;
+ private String requestObject;
+
+ @Autowired
+ private GrpcNettyServer grpcNettyServer;
+
+ @Before
+ public void setUp() throws IOException {
+
+ actionNames[0] = "preCheck";
+ actionNames[1] = "downloadNESw";
+ actionNames[2] = "postCheck";
+
+ executionVariables.clear();
+
+ requestObject = FileUtil.readResourceFile("request/PNFSoftwareUpgradeTest.json");
+ responseObject = FileUtil.readResourceFile("response/PNFSoftwareUpgradeTest.json");
+
+ executionVariables.put("bpmnRequest", requestObject);
+
+ /**
+ * This variable indicates that the flow was invoked asynchronously. It's injected by {@link WorkflowProcessor}.
+ */
+ executionVariables.put("isAsyncProcess", "true");
+ executionVariables.put(ExecutionVariableNames.PRC_CUSTOMIZATION_UUID, "38dc9a92-214c-11e7-93ae-92361f002680");
+
+ /**
+ * Temporary solution to add pnfCorrelationId to context. this value is getting from the request to SO api
+ * handler and then convert to CamudaInput
+ */
+ executionVariables.put(ExecutionVariableNames.PNF_CORRELATION_ID, "PNFDemo");
+ }
+
+
+ @Test
+ public void workflow_validInput_expectedOutput() throws InterruptedException {
+
+ mockCatalogDb();
+ mockAai();
+
+ final String msoRequestId = UUID.randomUUID().toString();
+ executionVariables.put(ExecutionVariableNames.MSO_REQUEST_ID, msoRequestId);
+
+ final String testBusinessKey = UUID.randomUUID().toString();
+ logger.info("Test the process instance: {} with business key: {}", TEST_PROCESSINSTANCE_KEY, testBusinessKey);
+
+ ProcessInstance pi =
+ runtimeService.startProcessInstanceByKey(TEST_PROCESSINSTANCE_KEY, testBusinessKey, executionVariables);
+
+ int waitCount = 10;
+ while (!isProcessInstanceEnded() && waitCount >= 0) {
+ Thread.sleep(WORKFLOW_WAIT_TIME);
+ waitCount--;
+ }
+
+ // Layout is to reflect the bpmn visual layout
+ assertThat(pi).isEnded().hasPassedInOrder("download_StartEvent", "ServiceTask_1mpt2eq", "ServiceTask_1nl90ao",
+ "ExclusiveGateway_1rj84ne", "ServiceTask_0yavde3", "ExclusiveGateway_1ja7grm", "ServiceTask_1wxo7xz",
+ "ExclusiveGateway_08lusga", "download_EndEvent");
+
+ List<ExecutionServiceInput> detailedMessages = grpcNettyServer.getDetailedMessages();
+ assertThat(detailedMessages.size() == 3);
+ int count = 0;
+ try {
+ for (ExecutionServiceInput eSI : detailedMessages) {
+ for (String action : actionNames) {
+ if (action.equals(eSI.getActionIdentifiers().getActionName())
+ && eSI.getCommonHeader().getRequestId().equals(msoRequestId)) {
+ checkWithActionName(eSI, action, msoRequestId);
+ count++;
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("PNFSWUPDownload request exception", e);
+ }
+ assertThat(count == actionNames.length);
+ }
+
+ private boolean isProcessInstanceEnded() {
+ return runtimeService.createProcessInstanceQuery().processDefinitionKey(TEST_PROCESSINSTANCE_KEY)
+ .singleResult() == null;
+ }
+
+ private void checkWithActionName(ExecutionServiceInput executionServiceInput, String action, String msoRequestId) {
+
+ logger.info("Checking the " + action + " request");
+ ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
+
+ /**
+ * the fields of actionIdentifiers should match the one in the response/PNFSoftwareUpgrade_catalogdb.json.
+ */
+ Assertions.assertThat(actionIdentifiers.getBlueprintName()).isEqualTo("test_pnf_software_upgrade_restconf");
+ Assertions.assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo("1.0.0");
+ Assertions.assertThat(actionIdentifiers.getActionName()).isEqualTo(action);
+ Assertions.assertThat(actionIdentifiers.getMode()).isEqualTo("async");
+
+ CommonHeader commonHeader = executionServiceInput.getCommonHeader();
+ Assertions.assertThat(commonHeader.getOriginatorId()).isEqualTo("SO");
+ Assertions.assertThat(commonHeader.getRequestId()).isEqualTo(msoRequestId);
+
+ Struct payload = executionServiceInput.getPayload();
+ Struct requeststruct = payload.getFieldsOrThrow(action + "-request").getStructValue();
+
+ Assertions.assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue()).isEqualTo("PNFDemo");
+ Struct propertiesStruct = requeststruct.getFieldsOrThrow(action + "-properties").getStructValue();
+
+ Assertions.assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).isEqualTo("PNFDemo");
+ Assertions.assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue())
+ .isEqualTo("32daaac6-5017-4e1e-96c8-6a27dfbe1421");
+ Assertions.assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue())
+ .isEqualTo("38dc9a92-214c-11e7-93ae-92361f002680");
+ Assertions.assertThat(propertiesStruct.getFieldsOrThrow("target-software-version").getStringValue())
+ .isEqualTo("demo-sw-ver2.0.0");
+ }
+
+ private void mockAai() {
+
+ String aaiPnfEntry =
+ "{ \n" + " \"pnf-name\":\"PNFDemo\",\n" + " \"pnf-id\":\"testtest\",\n" + " \"in-maint\":true,\n"
+ + " \"resource-version\":\"1541720264047\",\n" + " \"swVersion\":\"demo-1.1\",\n"
+ + " \"ipaddress-v4-oam\":\"1.1.1.1\",\n" + " \"ipaddress-v6-oam\":\"::/128\"\n" + "}";
+
+ /**
+ * PUT the PNF correlation ID to AAI.
+ */
+ wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")));
+
+ /**
+ * Get the PNF entry from AAI.
+ */
+ wireMockServer.stubFor(
+ get(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")).willReturn(okJson(aaiPnfEntry)));
+ }
+
+ /**
+ * Mock the catalobdb rest interface.
+ */
+ private void mockCatalogDb() {
+
+ String catalogdbClientResponse = FileUtil.readResourceFile("response/PNFSoftwareUpgradeTest_catalogdb.json");
+
+
+ /**
+ * Return valid json for the model UUID in the request file.
+ */
+ wireMockServer
+ .stubFor(get(urlEqualTo("/v2/serviceResources?serviceModelUuid=32daaac6-5017-4e1e-96c8-6a27dfbe1421"))
+ .willReturn(okJson(responseObject)));
+
+ /**
+ * Return valid json for the service model InvariantUUID as specified in the request file.
+ */
+ wireMockServer.stubFor(
+ get(urlEqualTo("/v2/serviceResources?serviceModelInvariantUuid=339b7a2f-9524-4dbf-9eee-f2e05521df3f"))
+ .willReturn(okJson(responseObject)));
+
+ /**
+ * Return valid spring data rest json for the service model UUID as specified in the request file.
+ */
+ wireMockServer.stubFor(get(urlEqualTo(
+ "/pnfResourceCustomization/search/findPnfResourceCustomizationByModelUuid?SERVICE_MODEL_UUID=32daaac6-5017-4e1e-96c8-6a27dfbe1421"))
+ .willReturn(okJson(catalogdbClientResponse)));
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSoftwareUpgradeTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSoftwareUpgradeTest.java
new file mode 100644
index 0000000000..a9bf4352bf
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSoftwareUpgradeTest.java
@@ -0,0 +1,236 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.process;
+
+import com.google.protobuf.Struct;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
+import org.onap.so.BaseBPMNTest;
+import org.onap.so.GrpcNettyServer;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames;
+import org.onap.so.bpmn.mock.FileUtil;
+import org.onap.so.client.aai.AAIVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.assertj.core.api.Assertions.fail;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+
+/**
+ * Basic Integration test for PNFSoftwareUpgrade.bpmn workflow.
+ */
+public class PNFSoftwareUpgradeTest extends BaseBPMNTest {
+
+ private final Logger logger = LoggerFactory.getLogger(getClass());
+
+ private static final long WORKFLOW_WAIT_TIME = 1000L;
+
+ private static final String TEST_PROCESSINSTANCE_KEY = "PNFSoftwareUpgrade";
+ private static final AAIVersion VERSION = AAIVersion.LATEST;
+ private static final Map<String, Object> executionVariables = new HashMap();
+ private final String[] actionNames = new String[4];
+ private String requestObject;
+ private String responseObject;
+
+ @Autowired
+ private GrpcNettyServer grpcNettyServer;
+
+ @Before
+ public void setUp() throws IOException {
+ actionNames[0] = "preCheck";
+ actionNames[1] = "downloadNESw";
+ actionNames[2] = "activateNESw";
+ actionNames[3] = "postCheck";
+
+ executionVariables.clear();
+
+ requestObject = FileUtil.readResourceFile("request/" + getClass().getSimpleName() + ".json");
+ responseObject = FileUtil.readResourceFile("response/" + getClass().getSimpleName() + ".json");
+
+ executionVariables.put("bpmnRequest", requestObject);
+
+ /**
+ * This variable indicates that the flow was invoked asynchronously. It's injected by {@link WorkflowProcessor}.
+ */
+ executionVariables.put("isAsyncProcess", "true");
+ executionVariables.put(ExecutionVariableNames.PRC_CUSTOMIZATION_UUID, "38dc9a92-214c-11e7-93ae-92361f002680");
+
+ /**
+ * Temporary solution to add pnfCorrelationId to context. this value is getting from the request to SO api
+ * handler and then convert to CamudaInput
+ */
+ executionVariables.put(ExecutionVariableNames.PNF_CORRELATION_ID, "PNFDemo");
+ }
+
+
+ @Test
+ public void workflow_validInput_expectedOutput() throws InterruptedException {
+
+ mockCatalogDb();
+ mockAai();
+
+ final String msoRequestId = UUID.randomUUID().toString();
+ executionVariables.put(ExecutionVariableNames.MSO_REQUEST_ID, msoRequestId);
+
+ final String testBusinessKey = UUID.randomUUID().toString();
+ logger.info("Test the process instance: {} with business key: {}", TEST_PROCESSINSTANCE_KEY, testBusinessKey);
+
+ ProcessInstance pi =
+ runtimeService.startProcessInstanceByKey(TEST_PROCESSINSTANCE_KEY, testBusinessKey, executionVariables);
+
+ int waitCount = 10;
+ while (!isProcessInstanceEnded() && waitCount >= 0) {
+ Thread.sleep(WORKFLOW_WAIT_TIME);
+ waitCount--;
+ }
+
+ // Layout is to reflect the bpmn visual layout
+ assertThat(pi).isEnded().hasPassedInOrder("softwareUpgrade_startEvent", "ServiceTask_042uz7n",
+ "ServiceTask_0slpahe", "ExclusiveGateway_0x6h0ni", "ServiceTask_0x5cje8", "ExclusiveGateway_0v3l3wv",
+ "ServiceTask_02lxf48", "ExclusiveGateway_0ch3fef", "ServiceTask_0y2uysu", "ExclusiveGateway_1ny9b1z",
+ "softwareUpgrade_endEvent");
+
+ List<ExecutionServiceInput> detailedMessages = grpcNettyServer.getDetailedMessages();
+ assertThat(detailedMessages.size() == 4);
+ int count = 0;
+ try {
+ for (ExecutionServiceInput eSI : detailedMessages) {
+ for (String action : actionNames) {
+ if (action.equals(eSI.getActionIdentifiers().getActionName())
+ && eSI.getCommonHeader().getRequestId().equals(msoRequestId)) {
+ checkWithActionName(eSI, action);
+ count++;
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("PNFSoftwareUpgrade request exception", e);
+ }
+ assertThat(count == actionNames.length);
+ }
+
+ private boolean isProcessInstanceEnded() {
+ return runtimeService.createProcessInstanceQuery().processDefinitionKey(TEST_PROCESSINSTANCE_KEY)
+ .singleResult() == null;
+ }
+
+ private void checkWithActionName(ExecutionServiceInput executionServiceInput, String action) {
+
+ logger.info("Checking the " + action + " request");
+ ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
+
+ /**
+ * the fields of actionIdentifiers should match the one in the response/PNFSoftwareUpgrade_catalogdb.json.
+ */
+ assertThat(actionIdentifiers.getBlueprintName()).isEqualTo("test_pnf_software_upgrade_restconf");
+ assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo("1.0.0");
+ assertThat(actionIdentifiers.getActionName()).isEqualTo(action);
+ assertThat(actionIdentifiers.getMode()).isEqualTo("async");
+
+ CommonHeader commonHeader = executionServiceInput.getCommonHeader();
+ assertThat(commonHeader.getOriginatorId()).isEqualTo("SO");
+
+ Struct payload = executionServiceInput.getPayload();
+ Struct requeststruct = payload.getFieldsOrThrow(action + "-request").getStructValue();
+
+ assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue()).isEqualTo("PNFDemo");
+ Struct propertiesStruct = requeststruct.getFieldsOrThrow(action + "-properties").getStructValue();
+
+ assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).isEqualTo("PNFDemo");
+ assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue())
+ .isEqualTo("32daaac6-5017-4e1e-96c8-6a27dfbe1421");
+ assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue())
+ .isEqualTo("38dc9a92-214c-11e7-93ae-92361f002680");
+ assertThat(propertiesStruct.getFieldsOrThrow("target-software-version").getStringValue())
+ .isEqualTo("demo-sw-ver2.0.0");
+ }
+
+ private void mockAai() {
+
+ String aaiPnfEntry =
+ "{ \n" + " \"pnf-name\":\"PNFDemo\",\n" + " \"pnf-id\":\"testtest\",\n" + " \"in-maint\":true,\n"
+ + " \"resource-version\":\"1541720264047\",\n" + " \"swVersion\":\"demo-1.1\",\n"
+ + " \"ipaddress-v4-oam\":\"1.1.1.1\",\n" + " \"ipaddress-v6-oam\":\"::/128\"\n" + "}";
+
+ /**
+ * PUT the PNF correlation ID to AAI.
+ */
+ wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")));
+
+ /**
+ * Get the PNF entry from AAI.
+ */
+ wireMockServer.stubFor(
+ get(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")).willReturn(okJson(aaiPnfEntry)));
+
+ /*
+ * Post the pnf to AAI
+ */
+ wireMockServer.stubFor(post(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")));
+ }
+
+ /**
+ * Mock the catalobdb rest interface.
+ */
+ private void mockCatalogDb() {
+
+ String catalogdbClientResponse =
+ FileUtil.readResourceFile("response/" + getClass().getSimpleName() + "_catalogdb.json");
+
+
+ /**
+ * Return valid json for the model UUID in the request file.
+ */
+ wireMockServer
+ .stubFor(get(urlEqualTo("/v2/serviceResources?serviceModelUuid=32daaac6-5017-4e1e-96c8-6a27dfbe1421"))
+ .willReturn(okJson(responseObject)));
+
+ /**
+ * Return valid json for the service model InvariantUUID as specified in the request file.
+ */
+ wireMockServer.stubFor(
+ get(urlEqualTo("/v2/serviceResources?serviceModelInvariantUuid=339b7a2f-9524-4dbf-9eee-f2e05521df3f"))
+ .willReturn(okJson(responseObject)));
+
+ /**
+ * Return valid spring data rest json for the service model UUID as specified in the request file.
+ */
+ wireMockServer.stubFor(get(urlEqualTo(
+ "/pnfResourceCustomization/search/findPnfResourceCustomizationByModelUuid?SERVICE_MODEL_UUID=32daaac6-5017-4e1e-96c8-6a27dfbe1421"))
+ .willReturn(okJson(catalogdbClientResponse)));
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/PNFSoftwareUpgradeTest.json b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/PNFSoftwareUpgradeTest.json
new file mode 100644
index 0000000000..a101118623
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/PNFSoftwareUpgradeTest.json
@@ -0,0 +1,54 @@
+{
+ "requestDetails":{
+ "requestInfo":{
+ "source":"VID",
+ "suppressRollback":false,
+ "requestorId":"demo",
+ "productFamilyId":"SWUPid"
+ },
+ "modelInfo":{
+ "modelType":"service",
+ "modelInvariantUuid":"339b7a2f-9524-4dbf-9eee-f2e05521df3f",
+ "modelInvariantId":"339b7a2f-9524-4dbf-9eee-f2e05521df3f",
+ "modelUuid":"32daaac6-5017-4e1e-96c8-6a27dfbe1421",
+ "modelName":"PNF_int_service_2",
+ "modelVersion":"1.0"
+ },
+ "requestParameters":{
+ "userParams":[
+ {
+ "name":"aic_zone",
+ "value":"nova"
+ },
+ {
+ "name":"pnfId",
+ "value":"PNFDemo"
+ },
+ {
+ "name":"targetSoftwareVersion",
+ "value":"demo-sw-ver2.0.0"
+ },
+ {
+ "name":"pnfName",
+ "value":"PNFDemo"
+ }
+ ],
+ "subscriptionServiceType":"SWUP",
+ "aLaCarte":false
+ },
+ "cloudConfiguration":{
+ "lcpCloudRegionId":"regionOne",
+ "tenantId":"09a63533072f4a579d5c99c3b8fe94c6"
+ },
+ "subscriberInfo":{
+ "globalSubscriberId":"ADemoCustomerInEric"
+ },
+ "project":{
+ "projectName":"Project-Demonstration"
+ },
+ "owningEntity":{
+ "owningEntityId":"5eae949c-1c50-4780-b8b5-7cbeb08856b4",
+ "owningEntityName":"OE-Demonstration"
+ }
+ }
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest.json b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest.json
new file mode 100644
index 0000000000..32539844ba
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest.json
@@ -0,0 +1,26 @@
+{
+ "serviceResources":{
+ "modelInfo":{
+ "modelInvariantId":"439b7a2f-9524-4dbf-9eee-f2e05521df3f",
+ "modelUuid":"42daaac6-5017-4e1e-96c8-6a27dfbe1421",
+ "modelName":"PNF_int_service_2",
+ "modelVersion":"1.0"
+ },
+ "serviceType":"NA",
+ "environmentContext":"Luna",
+ "serviceRole":"NA",
+ "workloadContext":"Oxygen",
+ "serviceVnfs":[
+
+ ],
+ "serviceNetworks":[
+
+ ],
+ "serviceAllottedResources":[
+
+ ],
+ "configResource":[
+
+ ]
+ }
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest_catalogdb.json b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest_catalogdb.json
new file mode 100644
index 0000000000..faec947fec
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest_catalogdb.json
@@ -0,0 +1,39 @@
+{
+ "_embedded": {
+ "pnfResourceCustomization": [
+ {
+ "modelCustomizationUUID": "38dc9a92-214c-11e7-93ae-92361f002680",
+ "modelInstanceName": "PNF routing",
+ "created": "2019-03-08 12:00:29.000",
+ "nfFunction": "routing",
+ "nfType": "routing",
+ "nfRole": "routing",
+ "nfNamingCode": "routing",
+ "multiStageDesign": null,
+ "resourceInput": null,
+ "blueprintName": "test_pnf_software_upgrade_restconf",
+ "blueprintVersion": "1.0.0",
+ "skipPostInstConf": false,
+ "softwareVersion": "1.0.0",
+ "creationTimestamp": "2019-03-08T12:00:29.000+0000",
+ "controllerActor": "cds",
+ "_links": {
+ "self": {
+ "href": "http://localhost:41023/pnfResourceCustomization/38dc9a92-214c-11e7-93ae-92361f002680"
+ },
+ "pnfResourceCustomization": {
+ "href": "http://localhost:41023/pnfResourceCustomization/38dc9a92-214c-11e7-93ae-92361f002680"
+ },
+ "pnfResources": {
+ "href": "http://localhost:41023/pnfResourceCustomization/38dc9a92-214c-11e7-93ae-92361f002680/pnfResources"
+ }
+ }
+ }
+ ]
+ },
+ "_links": {
+ "self": {
+ "href": "http://localhost:41023/pnfResourceCustomization/search/findPnfResourceCustomizationByModelUuid?SERVICE_MODEL_UUID=4df8b6de-2083-11e7-93ae-92361f002676"
+ }
+ }
+} \ No newline at end of file