diff options
Diffstat (limited to 'bpmn/so-bpmn-building-blocks')
98 files changed, 3997 insertions, 2770 deletions
diff --git a/bpmn/so-bpmn-building-blocks/pom.xml b/bpmn/so-bpmn-building-blocks/pom.xml index 0971a9d54e..09706746af 100644 --- a/bpmn/so-bpmn-building-blocks/pom.xml +++ b/bpmn/so-bpmn-building-blocks/pom.xml @@ -36,6 +36,9 @@ </configuration> </execution> </executions> + <configuration> + <parallel>suites</parallel> + </configuration> </plugin> </plugins> diff --git a/bpmn/so-bpmn-building-blocks/src/main/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecs.java b/bpmn/so-bpmn-building-blocks/src/main/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecs.java index db1f7cb6f9..e4f1998c40 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecs.java +++ b/bpmn/so-bpmn-building-blocks/src/main/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecs.java @@ -23,9 +23,7 @@ package org.onap.so.bpmn.infrastructure.bpmn.activity; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; - import javax.ws.rs.core.UriBuilder; - import org.apache.http.HttpResponse; import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; @@ -36,68 +34,65 @@ import org.springframework.stereotype.Component; @Component public class DeployActivitySpecs { - private static final String ACTIVITY_FILE_LOCATION = "src/main/resources/ActivitySpec/"; - private static final String ACTIVITY_SPEC_URI = "/activityspec-api/v1.0/activity-spec"; - private static final String CONTENT_TYPE_JSON = "application/json"; - - public static void main(String[] args) throws Exception { - - if (args == null || args.length == 0) { - System.out.println("Please specify hostname argument"); - return; - } - - String hostname = args[0]; - - File dir = new File(ACTIVITY_FILE_LOCATION); - if (!dir.isDirectory()) { - System.out.println("ActivitySpec store is not a directory"); - return; - } - - for (File f : dir.listFiles()) { - String activitySpecName = f.getName(); - String errorMessage = deployActivitySpec(hostname, activitySpecName); - if (errorMessage == null) { - System.out.println("Deployed Activity Spec: " + activitySpecName); - } - else { - System.out.println("Error deploying Activity Spec: " + activitySpecName + " : " + errorMessage); - } - } - return; - } - - protected static String deployActivitySpec(String hostname, String activitySpecName) throws Exception { - String payload = new String(Files.readAllBytes(Paths.get(ACTIVITY_FILE_LOCATION + activitySpecName))); - try { - HttpClient client = HttpClientBuilder.create().build(); - - String url = UriBuilder.fromUri(hostname).path(ACTIVITY_SPEC_URI).build().toString(); - HttpPost post = new HttpPost(url); - - StringEntity input = new StringEntity(payload); - input.setContentType(CONTENT_TYPE_JSON); - post.setEntity(input); - - HttpResponse response = client.execute(post); - StatusLine statusLine = response.getStatusLine(); - - if (statusLine != null) { - if (statusLine.getStatusCode() != 200) { - return (statusLine.toString()); - } - else { - return null; - } - } - else { - return("Empty response from the remote endpoint"); - } - - } catch (Exception e) { - return e.getMessage(); - } - - } + private static final String ACTIVITY_FILE_LOCATION = "src/main/resources/ActivitySpec/"; + private static final String ACTIVITY_SPEC_URI = "/activityspec-api/v1.0/activity-spec"; + private static final String CONTENT_TYPE_JSON = "application/json"; + + public static void main(String[] args) throws Exception { + + if (args == null || args.length == 0) { + System.out.println("Please specify hostname argument"); + return; + } + + String hostname = args[0]; + + File dir = new File(ACTIVITY_FILE_LOCATION); + if (!dir.isDirectory()) { + System.out.println("ActivitySpec store is not a directory"); + return; + } + + for (File f : dir.listFiles()) { + String activitySpecName = f.getName(); + String errorMessage = deployActivitySpec(hostname, activitySpecName); + if (errorMessage == null) { + System.out.println("Deployed Activity Spec: " + activitySpecName); + } else { + System.out.println("Error deploying Activity Spec: " + activitySpecName + " : " + errorMessage); + } + } + return; + } + + protected static String deployActivitySpec(String hostname, String activitySpecName) throws Exception { + String payload = new String(Files.readAllBytes(Paths.get(ACTIVITY_FILE_LOCATION + activitySpecName))); + try { + HttpClient client = HttpClientBuilder.create().build(); + + String url = UriBuilder.fromUri(hostname).path(ACTIVITY_SPEC_URI).build().toString(); + HttpPost post = new HttpPost(url); + + StringEntity input = new StringEntity(payload); + input.setContentType(CONTENT_TYPE_JSON); + post.setEntity(input); + + HttpResponse response = client.execute(post); + StatusLine statusLine = response.getStatusLine(); + + if (statusLine != null) { + if (statusLine.getStatusCode() != 200) { + return (statusLine.toString()); + } else { + return null; + } + } else { + return ("Empty response from the remote endpoint"); + } + + } catch (Exception e) { + return e.getMessage(); + } + + } } diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn new file mode 100644 index 0000000000..4ea6bb10b1 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn @@ -0,0 +1,62 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> + <bpmn:process id="DistributeTrafficActivity" name="DistributeTrafficActivity" isExecutable="true"> + <bpmn:startEvent id="DistributeTrafficActivity_Start"> + <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:endEvent id="DistributeTrafficActivity_End"> + <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="DistributeTrafficActivity_Start" targetRef="TaskPreProcessActivity" /> + <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskDistributeTraffic" targetRef="DistributeTrafficActivity_End" /> + <bpmn:serviceTask id="TaskDistributeTraffic" name="Distribute Traffic" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")),execution.getVariable("actionDistributeTraffic"))}"> + <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskDistributeTraffic" /> + <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing> + </bpmn:serviceTask> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DistributeTrafficActivity"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DistributeTrafficActivity_Start"> + <dc:Bounds x="173" y="102" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="DistributeTrafficActivity_End"> + <dc:Bounds x="561" y="102" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="579" y="138" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci"> + <di:waypoint xsi:type="dc:Point" x="209" y="120" /> + <di:waypoint xsi:type="dc:Point" x="255" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="232" y="105" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj"> + <di:waypoint xsi:type="dc:Point" x="497" y="120" /> + <di:waypoint xsi:type="dc:Point" x="561" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="529" y="105" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskDistributeTraffic"> + <dc:Bounds x="397" y="80" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu"> + <di:waypoint xsi:type="dc:Point" x="355" y="120" /> + <di:waypoint xsi:type="dc:Point" x="397" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="376" y="105" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity"> + <dc:Bounds x="255" y="80" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn new file mode 100644 index 0000000000..19a4972187 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn @@ -0,0 +1,62 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> + <bpmn:process id="DistributeTrafficCheckActivity" name="DistributeTrafficCheckActivity" isExecutable="true"> + <bpmn:startEvent id="DistributeTrafficCheckActivity_Start"> + <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:endEvent id="DistributeTrafficCheckActivity_End"> + <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="DistributeTrafficCheckActivity_Start" targetRef="TaskPreProcessActivity" /> + <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskDistributeTrafficCheck" targetRef="DistributeTrafficCheckActivity_End" /> + <bpmn:serviceTask id="TaskDistributeTrafficCheck" name="Distribute Traffic Check" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")),execution.getVariable("actionDistributeTrafficCheck"))}"> + <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskDistributeTrafficCheck" /> + <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing> + </bpmn:serviceTask> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DistributeTrafficCheckActivity"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DistributeTrafficCheckActivity_Start"> + <dc:Bounds x="173" y="102" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="DistributeTrafficCheckActivity_End"> + <dc:Bounds x="561" y="102" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="579" y="138" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci"> + <di:waypoint xsi:type="dc:Point" x="209" y="120" /> + <di:waypoint xsi:type="dc:Point" x="255" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="232" y="105" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj"> + <di:waypoint xsi:type="dc:Point" x="497" y="120" /> + <di:waypoint xsi:type="dc:Point" x="561" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="529" y="105" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskDistributeTrafficCheck"> + <dc:Bounds x="397" y="80" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu"> + <di:waypoint xsi:type="dc:Point" x="355" y="120" /> + <di:waypoint xsi:type="dc:Point" x="397" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="376" y="105" width="0" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity"> + <dc:Bounds x="255" y="80" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn new file mode 100644 index 0000000000..4fcf13d98d --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn @@ -0,0 +1,50 @@ +<?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1l7m222" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.1"> + <bpmn:process id="AbstractCDSProcessingBB" name="Abstract CDS Processing BB" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1"> + <bpmn:outgoing>SequenceFlow_02v5z4h</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:sequenceFlow id="SequenceFlow_02v5z4h" sourceRef="StartEvent_1" targetRef="Task_06n9c9v" /> + <bpmn:sequenceFlow id="SequenceFlow_0gksy4i" sourceRef="Task_06n9c9v" targetRef="Task_0kjfr5o" /> + <bpmn:sequenceFlow id="SequenceFlow_161g9uz" sourceRef="Task_0kjfr5o" targetRef="EndEvent_1h3epjc" /> + <bpmn:endEvent id="EndEvent_1h3epjc"> + <bpmn:incoming>SequenceFlow_161g9uz</bpmn:incoming> + </bpmn:endEvent> + <bpmn:serviceTask id="Task_06n9c9v" name="Get Required data to call CDS Client" camunda:expression="${AbstractCDSProcessingBBUtils.constructExecutionServiceInputObject(execution)}"> + <bpmn:incoming>SequenceFlow_02v5z4h</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0gksy4i</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:serviceTask id="Task_0kjfr5o" name="CDS (Call SelfServiceAPI) " camunda:expression="${AbstractCDSProcessingBBUtils.sendRequestToCDSClient(execution)}"> + <bpmn:incoming>SequenceFlow_0gksy4i</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_161g9uz</bpmn:outgoing> + </bpmn:serviceTask> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="AbstractCDSProcessingBB"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> + <dc:Bounds x="124" y="264" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_02v5z4h_di" bpmnElement="SequenceFlow_02v5z4h"> + <di:waypoint x="160" y="282" /> + <di:waypoint x="223" y="282" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0gksy4i_di" bpmnElement="SequenceFlow_0gksy4i"> + <di:waypoint x="323" y="282" /> + <di:waypoint x="385" y="282" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_161g9uz_di" bpmnElement="SequenceFlow_161g9uz"> + <di:waypoint x="485" y="282" /> + <di:waypoint x="578" y="282" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="EndEvent_1h3epjc_di" bpmnElement="EndEvent_1h3epjc"> + <dc:Bounds x="578" y="264" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_16es7z5_di" bpmnElement="Task_06n9c9v"> + <dc:Bounds x="223" y="242" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_18soa9e_di" bpmnElement="Task_0kjfr5o"> + <dc:Bounds x="385" y="242" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn index c841da3e3a..289ab6e155 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn @@ -10,7 +10,8 @@ </bpmn:endEvent> <bpmn:serviceTask id="ActivateVfModule" name=" SDNC Activate (vf module) " camunda:expression="${SDNCActivateTasks.activateVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_07ybdik</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0ee42yq</bpmn:incoming> + <bpmn:incoming>SequenceFlow_109oxx2</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0arwo1o</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1a495wm</bpmn:outgoing> </bpmn:serviceTask> <bpmn:serviceTask id="UpdateVfModuleActiveStatus" name=" AAI Update (vf module) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusActivateVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> @@ -39,14 +40,6 @@ <bpmn:incoming>SequenceFlow_0xndboi</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0ee42yq</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:boundaryEvent id="BoundaryEvent_1nb1hw4" attachedToRef="Audit_AAI_Inventory"> - <bpmn:outgoing>SequenceFlow_1t99ceh</bpmn:outgoing> - <bpmn:errorEventDefinition /> - </bpmn:boundaryEvent> - <bpmn:sequenceFlow id="SequenceFlow_1t99ceh" sourceRef="BoundaryEvent_1nb1hw4" targetRef="Task_0swpw3v" /> - <bpmn:serviceTask id="Task_0swpw3v" name="Throw Exception" camunda:expression="${ExceptionBuilder.buildAndThrowWorkflowException(execution, "AuditAAIInventoryFailure", "Error Auditing Cloud Inventory in A&AI")}" camunda:resultVariable="ExceptionBuilder"> - <bpmn:incoming>SequenceFlow_1t99ceh</bpmn:incoming> - </bpmn:serviceTask> <bpmn:exclusiveGateway id="ExclusiveGateway_1v8bmbu" default="SequenceFlow_07ybdik"> <bpmn:incoming>SequenceFlow_1xqyur9</bpmn:incoming> <bpmn:outgoing>SequenceFlow_07ybdik</bpmn:outgoing> @@ -56,12 +49,26 @@ <bpmn:sequenceFlow id="SequenceFlow_0ghzwlo" sourceRef="ExclusiveGateway_1v8bmbu" targetRef="Setup_AAI_Inventory_Audit"> <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditInventoryNeeded") == true}]]></bpmn:conditionExpression> </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_0ee42yq" sourceRef="Audit_AAI_Inventory" targetRef="ActivateVfModule" /> + <bpmn:sequenceFlow id="SequenceFlow_0ee42yq" sourceRef="Audit_AAI_Inventory" targetRef="ExclusiveGateway_1h8avxn" /> <bpmn:serviceTask id="CheckAuditVariable" name="Check Audit Variable" camunda:expression="${AuditTasks.isAuditNeeded(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_0ieafii</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1xqyur9</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1xqyur9" sourceRef="CheckAuditVariable" targetRef="ExclusiveGateway_1v8bmbu" /> + <bpmn:exclusiveGateway id="ExclusiveGateway_1h8avxn" default="SequenceFlow_1bo83qk"> + <bpmn:incoming>SequenceFlow_0ee42yq</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_109oxx2</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_1bo83qk</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:sequenceFlow id="SequenceFlow_109oxx2" sourceRef="ExclusiveGateway_1h8avxn" targetRef="ActivateVfModule"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditIsSuccessful")== true }]]></bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_1bo83qk" name="If Audit Fails" sourceRef="ExclusiveGateway_1h8avxn" targetRef="Create_AAI_Inventory" /> + <bpmn:sequenceFlow id="SequenceFlow_0arwo1o" sourceRef="Create_AAI_Inventory" targetRef="ActivateVfModule" /> + <bpmn:serviceTask id="Create_AAI_Inventory" name="Create A&AI Inventory" camunda:type="external" camunda:topic="InventoryCreate"> + <bpmn:incoming>SequenceFlow_1bo83qk</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0arwo1o</bpmn:outgoing> + </bpmn:serviceTask> </bpmn:process> <bpmn:error id="Error_0q258vt" errorCode="7000" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> @@ -86,7 +93,7 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0hawa84_di" bpmnElement="ActivateVfModule"> - <dc:Bounds x="539" y="80" width="100" height="80" /> + <dc:Bounds x="647" y="80" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_175e9ul_di" bpmnElement="UpdateVfModuleActiveStatus"> <dc:Bounds x="952" y="80" width="100" height="80" /> @@ -102,10 +109,10 @@ <dc:Bounds x="794" y="80" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1a495wm_di" bpmnElement="SequenceFlow_1a495wm"> - <di:waypoint xsi:type="dc:Point" x="639" y="120" /> + <di:waypoint xsi:type="dc:Point" x="747" y="120" /> <di:waypoint xsi:type="dc:Point" x="794" y="120" /> <bpmndi:BPMNLabel> - <dc:Bounds x="671.5" y="99" width="90" height="12" /> + <dc:Bounds x="725.5" y="99" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1j4x1ej_di" bpmnElement="SequenceFlow_1j4x1ej"> @@ -117,36 +124,16 @@ </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0xndboi_di" bpmnElement="SequenceFlow_0xndboi"> <di:waypoint xsi:type="dc:Point" x="365" y="256" /> - <di:waypoint xsi:type="dc:Point" x="452" y="256" /> - <di:waypoint xsi:type="dc:Point" x="452" y="256" /> - <di:waypoint xsi:type="dc:Point" x="539" y="256" /> + <di:waypoint xsi:type="dc:Point" x="408" y="256" /> <bpmndi:BPMNLabel> - <dc:Bounds x="422" y="249.5" width="90" height="13" /> + <dc:Bounds x="341.5" y="234.5" width="90" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0krf1ur_di" bpmnElement="Setup_AAI_Inventory_Audit"> <dc:Bounds x="265" y="216" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_08rxjeb_di" bpmnElement="Audit_AAI_Inventory"> - <dc:Bounds x="539" y="216" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="BoundaryEvent_0s7rszu_di" bpmnElement="BoundaryEvent_1nb1hw4"> - <dc:Bounds x="575" y="278" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="548" y="317" width="90" height="13" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1t99ceh_di" bpmnElement="SequenceFlow_1t99ceh"> - <di:waypoint xsi:type="dc:Point" x="593" y="314" /> - <di:waypoint xsi:type="dc:Point" x="593" y="348" /> - <di:waypoint xsi:type="dc:Point" x="593" y="348" /> - <di:waypoint xsi:type="dc:Point" x="593" y="371" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="563" y="341.5" width="90" height="13" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0eujimg_di" bpmnElement="Task_0swpw3v"> - <dc:Bounds x="543" y="371" width="100" height="80" /> + <dc:Bounds x="408" y="216" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1v8bmbu_di" bpmnElement="ExclusiveGateway_1v8bmbu" isMarkerVisible="true"> <dc:Bounds x="290" y="95" width="50" height="50" /> @@ -156,9 +143,9 @@ </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_07ybdik_di" bpmnElement="SequenceFlow_07ybdik"> <di:waypoint xsi:type="dc:Point" x="340" y="120" /> - <di:waypoint xsi:type="dc:Point" x="539" y="120" /> + <di:waypoint xsi:type="dc:Point" x="647" y="120" /> <bpmndi:BPMNLabel> - <dc:Bounds x="439.5" y="98.5" width="0" height="13" /> + <dc:Bounds x="448.5" y="98.5" width="90" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ghzwlo_di" bpmnElement="SequenceFlow_0ghzwlo"> @@ -169,12 +156,10 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ee42yq_di" bpmnElement="SequenceFlow_0ee42yq"> - <di:waypoint xsi:type="dc:Point" x="589" y="216" /> - <di:waypoint xsi:type="dc:Point" x="589" y="193" /> - <di:waypoint xsi:type="dc:Point" x="589" y="193" /> - <di:waypoint xsi:type="dc:Point" x="589" y="160" /> + <di:waypoint xsi:type="dc:Point" x="508" y="256" /> + <di:waypoint xsi:type="dc:Point" x="566" y="256" /> <bpmndi:BPMNLabel> - <dc:Bounds x="604" y="186.5" width="0" height="13" /> + <dc:Bounds x="492" y="234.5" width="90" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_1eg5ryx_di" bpmnElement="CheckAuditVariable"> @@ -187,6 +172,38 @@ <dc:Bounds x="275.5" y="98.5" width="0" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ExclusiveGateway_1h8avxn_di" bpmnElement="ExclusiveGateway_1h8avxn" isMarkerVisible="true"> + <dc:Bounds x="566" y="231" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="591" y="284" width="0" height="13" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_109oxx2_di" bpmnElement="SequenceFlow_109oxx2"> + <di:waypoint xsi:type="dc:Point" x="616" y="256" /> + <di:waypoint xsi:type="dc:Point" x="670" y="256" /> + <di:waypoint xsi:type="dc:Point" x="670" y="160" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="643" y="234.5" width="0" height="13" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1bo83qk_di" bpmnElement="SequenceFlow_1bo83qk"> + <di:waypoint xsi:type="dc:Point" x="591" y="281" /> + <di:waypoint xsi:type="dc:Point" x="591" y="345" /> + <di:waypoint xsi:type="dc:Point" x="656" y="345" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="560" y="358" width="61" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0arwo1o_di" bpmnElement="SequenceFlow_0arwo1o"> + <di:waypoint xsi:type="dc:Point" x="706" y="305" /> + <di:waypoint xsi:type="dc:Point" x="706" y="160" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="721" y="226" width="0" height="13" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_1eb09gr_di" bpmnElement="Create_AAI_Inventory"> + <dc:Bounds x="656" y="305" width="100" height="80" /> + </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> 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 ce4d2e1dab..ea762c8719 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,13 +1,9 @@ <?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.1"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2"> <bpmn:process id="AssignVnfBB" name="AssignVnfBB" isExecutable="true"> <bpmn:startEvent id="Start_AssignVnfBB"> <bpmn:outgoing>SequenceFlow_0zaz9o2</bpmn:outgoing> </bpmn:startEvent> - <bpmn:serviceTask id="Task_SDNCAdapterVnfTopologyAssign" name=" SDNC Create Request (vnf) " camunda:expression="${SDNCAssignTasks.assignVnf(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_1samncw</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1qkhm79</bpmn:outgoing> - </bpmn:serviceTask> <bpmn:endEvent id="End_AssignVnfBB"> <bpmn:incoming>SequenceFlow_0csh9dc</bpmn:incoming> </bpmn:endEvent> @@ -18,7 +14,7 @@ <bpmn:sequenceFlow id="SequenceFlow_0zaz9o2" sourceRef="Start_AssignVnfBB" targetRef="Task_CreateVnf" /> <bpmn:sequenceFlow id="SequenceFlow_0csh9dc" sourceRef="Task_UpdateVnfOrchestrationStatusAssigned" targetRef="End_AssignVnfBB" /> <bpmn:serviceTask id="Task_UpdateVnfOrchestrationStatusAssigned" name=" AAI Update (vnf) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusAssignedVnf(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_1vw20wu</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0yzidhu</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0csh9dc</bpmn:outgoing> </bpmn:serviceTask> <bpmn:serviceTask id="Task_createInstanceGroups" name=" AAI Create (instance grp) " camunda:expression="${AssignVnf.createInstanceGroups(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> @@ -62,6 +58,7 @@ </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_1i52a7x" sourceRef="StartEvent_1c3cyuv" targetRef="EndEvent_1bywujf" /> </bpmn:subProcess> + <bpmn:sequenceFlow id="SequenceFlow_14mpqit" sourceRef="ExclusiveGateway_1blf52g" targetRef="Task_SDNCCreateRequest" /> <bpmn:inclusiveGateway id="ExclusiveGateway_02tchpp" name="Call Homing?" default="SequenceFlow_11jum90"> <bpmn:incoming>SequenceFlow_1nle8kc</bpmn:incoming> <bpmn:outgoing>SequenceFlow_11jum90</bpmn:outgoing> @@ -70,7 +67,7 @@ <bpmn:inclusiveGateway id="ExclusiveGateway_1blf52g"> <bpmn:incoming>SequenceFlow_11jum90</bpmn:incoming> <bpmn:incoming>SequenceFlow_0v8d14a</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1samncw</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_14mpqit</bpmn:outgoing> </bpmn:inclusiveGateway> <bpmn:serviceTask id="ServiceTask_ConnectVnfToCloudRegion" name=" AAI Connect (vnf to cloud region) " camunda:expression="${AAICreateTasks.connectVnfToCloudRegion(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_0qj7zcn</bpmn:incoming> @@ -83,19 +80,22 @@ </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_0nsg48b" sourceRef="ServiceTask_ConnectVnfToCloudRegion" targetRef="ServiceTask_ConnectVnfToTenant" /> <bpmn:sequenceFlow id="SequenceFlow_18ixm0j" sourceRef="ServiceTask_ConnectVnfToTenant" targetRef="Task_createPlatform" /> - <bpmn:callActivity id="CallActivity_sdncAssign" name="SDNC Assign (vnf)" calledElement="SDNCHandler"> + <bpmn:serviceTask id="Task_SDNCCreateRequest" name=" SDNC Create Request (vnf) " camunda:expression="${SDNCAssignTasks.assignVnf(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_14mpqit</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1991eue</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:callActivity id="CallActivity_SDNCAssignVnf" name="SDNC Assign (vnf)" calledElement="SDNCHandler"> <bpmn:extensionElements> <camunda:in source="SDNCRequest" target="SDNCRequest" /> <camunda:out source="SDNCResponse" target="SDNCResponse" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:in source="mso-request-id" target="mso-request-id" /> </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_1qkhm79</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1vw20wu</bpmn:outgoing> + <bpmn:incoming>SequenceFlow_1991eue</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0yzidhu</bpmn:outgoing> </bpmn:callActivity> - <bpmn:sequenceFlow id="SequenceFlow_1samncw" sourceRef="ExclusiveGateway_1blf52g" targetRef="Task_SDNCAdapterVnfTopologyAssign" /> - <bpmn:sequenceFlow id="SequenceFlow_1qkhm79" sourceRef="Task_SDNCAdapterVnfTopologyAssign" targetRef="CallActivity_sdncAssign" /> - <bpmn:sequenceFlow id="SequenceFlow_1vw20wu" sourceRef="CallActivity_sdncAssign" targetRef="Task_UpdateVnfOrchestrationStatusAssigned" /> + <bpmn:sequenceFlow id="SequenceFlow_1991eue" sourceRef="Task_SDNCCreateRequest" targetRef="CallActivity_SDNCAssignVnf" /> + <bpmn:sequenceFlow id="SequenceFlow_0yzidhu" sourceRef="CallActivity_SDNCAssignVnf" targetRef="Task_UpdateVnfOrchestrationStatusAssigned" /> </bpmn:process> <bpmn:error id="Error_0rgauy1" name="gDelegateError" errorCode="7000" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> @@ -106,13 +106,10 @@ <dc:Bounds x="-275" y="152" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0m0ikey_di" bpmnElement="Task_SDNCAdapterVnfTopologyAssign"> - <dc:Bounds x="930" y="94" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1h93h9d_di" bpmnElement="End_AssignVnfBB"> - <dc:Bounds x="1323" y="116" width="36" height="36" /> + <dc:Bounds x="1415" y="116" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1296" y="156" width="90" height="12" /> + <dc:Bounds x="1388" y="156" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1r380lg_di" bpmnElement="Task_CreateVnf"> @@ -126,14 +123,14 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0csh9dc_di" bpmnElement="SequenceFlow_0csh9dc"> - <di:waypoint xsi:type="dc:Point" x="1303" y="134" /> - <di:waypoint xsi:type="dc:Point" x="1323" y="134" /> + <di:waypoint xsi:type="dc:Point" x="1342" y="134" /> + <di:waypoint xsi:type="dc:Point" x="1415" y="134" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1268" y="113" width="90" height="12" /> + <dc:Bounds x="1334" y="113" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0s6d1be_di" bpmnElement="Task_UpdateVnfOrchestrationStatusAssigned"> - <dc:Bounds x="1203" y="94" width="100" height="80" /> + <dc:Bounds x="1242" y="94" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0wjy7za_di" bpmnElement="Task_createInstanceGroups"> <dc:Bounds x="534" y="94" width="100" height="80" /> @@ -194,25 +191,32 @@ <dc:Bounds x="404" y="94" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_19596dp_di" bpmnElement="SubProcess_19596dp" isExpanded="true"> - <dc:Bounds x="673" y="239" width="231" height="135" /> + <dc:Bounds x="249" y="267" width="231" height="135" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1c3cyuv_di" bpmnElement="StartEvent_1c3cyuv"> - <dc:Bounds x="710" y="295" width="36" height="36" /> + <dc:Bounds x="286" y="323" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="638" y="331" width="90" height="12" /> + <dc:Bounds x="259" y="359" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1bywujf_di" bpmnElement="EndEvent_1bywujf"> - <dc:Bounds x="846" y="295" width="36" height="36" /> + <dc:Bounds x="422" y="323" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="774" y="331" width="90" height="12" /> + <dc:Bounds x="395" y="359" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1i52a7x_di" bpmnElement="SequenceFlow_1i52a7x"> - <di:waypoint xsi:type="dc:Point" x="746" y="313" /> - <di:waypoint xsi:type="dc:Point" x="846" y="313" /> + <di:waypoint xsi:type="dc:Point" x="322" y="341" /> + <di:waypoint xsi:type="dc:Point" x="422" y="341" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="372" y="320" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_14mpqit_di" bpmnElement="SequenceFlow_14mpqit"> + <di:waypoint xsi:type="dc:Point" x="899" y="134" /> + <di:waypoint xsi:type="dc:Point" x="937" y="134" /> <bpmndi:BPMNLabel> - <dc:Bounds x="751" y="292" width="90" height="12" /> + <dc:Bounds x="873" y="113" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="InclusiveGateway_0x0c3kk_di" bpmnElement="ExclusiveGateway_02tchpp"> @@ -254,31 +258,26 @@ <dc:Bounds x="259.5" y="113" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_12uxg1m_di" bpmnElement="CallActivity_sdncAssign"> - <dc:Bounds x="1060" y="94" width="100" height="80" /> + <bpmndi:BPMNShape id="ServiceTask_07icomz_di" bpmnElement="Task_SDNCCreateRequest"> + <dc:Bounds x="940" y="94" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1samncw_di" bpmnElement="SequenceFlow_1samncw"> - <di:waypoint xsi:type="dc:Point" x="899" y="134" /> - <di:waypoint xsi:type="dc:Point" x="930" y="134" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="914.5" y="113" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1qkhm79_di" bpmnElement="SequenceFlow_1qkhm79"> - <di:waypoint xsi:type="dc:Point" x="1030" y="134" /> - <di:waypoint xsi:type="dc:Point" x="1060" y="134" /> + <bpmndi:BPMNShape id="CallActivity_09hycsr_di" bpmnElement="CallActivity_SDNCAssignVnf"> + <dc:Bounds x="1088" y="94" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1991eue_di" bpmnElement="SequenceFlow_1991eue"> + <di:waypoint xsi:type="dc:Point" x="1040" y="134" /> + <di:waypoint xsi:type="dc:Point" x="1088" y="134" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1045" y="113" width="0" height="12" /> + <dc:Bounds x="1064" y="113" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1vw20wu_di" bpmnElement="SequenceFlow_1vw20wu"> - <di:waypoint xsi:type="dc:Point" x="1160" y="134" /> - <di:waypoint xsi:type="dc:Point" x="1203" y="134" /> + <bpmndi:BPMNEdge id="SequenceFlow_0yzidhu_di" bpmnElement="SequenceFlow_0yzidhu"> + <di:waypoint xsi:type="dc:Point" x="1188" y="134" /> + <di:waypoint xsi:type="dc:Point" x="1242" y="134" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1181.5" y="113" width="0" height="12" /> + <dc:Bounds x="1215" y="113" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> - diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigAssignVnfBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigAssignVnfBB.bpmn new file mode 100644 index 0000000000..9892fbdd91 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigAssignVnfBB.bpmn @@ -0,0 +1,98 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1ahlzqg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.1"> + <bpmn:process id="ConfigAssignVnfBB" name="ConfigAssignVnfBB" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1"> + <bpmn:outgoing>SequenceFlow_0gmfit3</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:sequenceFlow id="SequenceFlow_0gmfit3" sourceRef="StartEvent_1" targetRef="Task_0bhf6tp" /> + <bpmn:endEvent id="EndEvent_0lgvk82"> + <bpmn:incoming>SequenceFlow_1mkhog2</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_1mkhog2" sourceRef="Task_1hs1mn0" targetRef="EndEvent_0lgvk82" /> + <bpmn:callActivity id="CallActivity_1gfzi2g" name="Abstract CDS (CDS Call) " calledElement="AbstractCDSProcessingBB"> + <bpmn:extensionElements> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="CDSStatus" target="CDSStatus" /> + <camunda:in source="executionObject" target="executionObject" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_05qembo</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0cvsnuu</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:serviceTask id="Task_1hs1mn0" name="Update AAI (VNF) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusConfigAssignedVnf(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_07tqu82</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1mkhog2</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_05qembo" sourceRef="Task_0bhf6tp" targetRef="CallActivity_1gfzi2g" /> + <bpmn:serviceTask id="Task_0bhf6tp" name="PreProcess Abstract CDS Processing" camunda:expression="${ConfigAssignVnf.PreProcessAbstractCDSProcessing(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_0gmfit3</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_05qembo</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:exclusiveGateway id="ExclusiveGateway_13q340y" default="SequenceFlow_15gxql1"> + <bpmn:incoming>SequenceFlow_0cvsnuu</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_07tqu82</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_15gxql1</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:sequenceFlow id="SequenceFlow_0cvsnuu" sourceRef="CallActivity_1gfzi2g" targetRef="ExclusiveGateway_13q340y" /> + <bpmn:sequenceFlow id="SequenceFlow_07tqu82" name="success" sourceRef="ExclusiveGateway_13q340y" targetRef="Task_1hs1mn0"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("CDSStatus").equals("Success")}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:endEvent id="EndEvent_0mnaj50"> + <bpmn:incoming>SequenceFlow_15gxql1</bpmn:incoming> + <bpmn:errorEventDefinition id="ErrorEventDefinition_1s1hqgm" errorRef="Error_0aovtfv" /> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_15gxql1" sourceRef="ExclusiveGateway_13q340y" targetRef="EndEvent_0mnaj50" /> + </bpmn:process> + <bpmn:error id="Error_0aovtfv" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ConfigAssignVnfBB"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> + <dc:Bounds x="507" y="187" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0gmfit3_di" bpmnElement="SequenceFlow_0gmfit3"> + <di:waypoint x="543" y="205" /> + <di:waypoint x="614" y="205" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="EndEvent_0lgvk82_di" bpmnElement="EndEvent_0lgvk82"> + <dc:Bounds x="1307" y="187" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1mkhog2_di" bpmnElement="SequenceFlow_1mkhog2"> + <di:waypoint x="1218" y="205" /> + <di:waypoint x="1307" y="205" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="CallActivity_1gfzi2g_di" bpmnElement="CallActivity_1gfzi2g"> + <dc:Bounds x="788" y="165" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0404s6a_di" bpmnElement="Task_1hs1mn0"> + <dc:Bounds x="1118" y="165" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_05qembo_di" bpmnElement="SequenceFlow_05qembo"> + <di:waypoint x="714" y="205" /> + <di:waypoint x="788" y="205" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_01mv1si_di" bpmnElement="Task_0bhf6tp"> + <dc:Bounds x="614" y="165" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_13q340y_di" bpmnElement="ExclusiveGateway_13q340y" isMarkerVisible="true"> + <dc:Bounds x="978" y="180" width="50" height="50" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0cvsnuu_di" bpmnElement="SequenceFlow_0cvsnuu"> + <di:waypoint x="888" y="205" /> + <di:waypoint x="978" y="205" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_07tqu82_di" bpmnElement="SequenceFlow_07tqu82"> + <di:waypoint x="1028" y="205" /> + <di:waypoint x="1118" y="205" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1053" y="187" width="41" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="EndEvent_0mnaj50_di" bpmnElement="EndEvent_0mnaj50"> + <dc:Bounds x="985" y="327" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_15gxql1_di" bpmnElement="SequenceFlow_15gxql1"> + <di:waypoint x="1003" y="230" /> + <di:waypoint x="1003" y="327" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigDeployVnfBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigDeployVnfBB.bpmn new file mode 100644 index 0000000000..92ac5f9f5b --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigDeployVnfBB.bpmn @@ -0,0 +1,116 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1556kf5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> + <bpmn:process id="ConfigDeployVnfBB" name="ConfigDeployVnfBB" isExecutable="true"> + <bpmn:startEvent id="Start" name="Start"> + <bpmn:outgoing>SequenceFlow_0pd4jka</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:serviceTask id="UpdateAAIConfigured" name="Update AAI Configured" camunda:expression="${ConfigDeployVnf.updateAAIConfigured(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_1tb7fs1</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_00u29dm</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:endEvent id="End" name="End"> + <bpmn:incoming>SequenceFlow_00u29dm</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_0pd4jka" sourceRef="Start" targetRef="UpdateAAIConfigure" /> + <bpmn:sequenceFlow id="SequenceFlow_03xbj4e" sourceRef="AbstractCDSBB" targetRef="ExclusiveGateway_0duh80v" /> + <bpmn:sequenceFlow id="SequenceFlow_00u29dm" sourceRef="UpdateAAIConfigured" targetRef="End" /> + <bpmn:callActivity id="AbstractCDSBB" name="Abstract CDS (CDS Call)" calledElement="AbstractCDSProcessingBB"> + <bpmn:extensionElements> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:in source="executionObject" target="executionObject" /> + <camunda:out source="CDSStatus" target="CDSStatus" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_0kruy8t</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_03xbj4e</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:serviceTask id="UpdateAAIConfigure" name="Update AAI Configure" camunda:expression="${ConfigDeployVnf.updateAAIConfigure(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_0pd4jka</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0moyu92</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_0moyu92" sourceRef="UpdateAAIConfigure" targetRef="PreProcessAbstractCDSProcessing" /> + <bpmn:sequenceFlow id="SequenceFlow_0kruy8t" sourceRef="PreProcessAbstractCDSProcessing" targetRef="AbstractCDSBB" /> + <bpmn:serviceTask id="PreProcessAbstractCDSProcessing" name="PreProcess Abstract CDS Processing" camunda:expression="${ConfigDeployVnf.preProcessAbstractCDSProcessing(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_0moyu92</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0kruy8t</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:exclusiveGateway id="ExclusiveGateway_0duh80v" default="SequenceFlow_0o50k2d"> + <bpmn:incoming>SequenceFlow_03xbj4e</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1tb7fs1</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_0o50k2d</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:sequenceFlow id="SequenceFlow_1tb7fs1" name="success" sourceRef="ExclusiveGateway_0duh80v" targetRef="UpdateAAIConfigured"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("CDSStatus").equals("Success")}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_0o50k2d" sourceRef="ExclusiveGateway_0duh80v" targetRef="EndEvent_0wwnq4u" /> + <bpmn:endEvent id="EndEvent_0wwnq4u"> + <bpmn:incoming>SequenceFlow_0o50k2d</bpmn:incoming> + <bpmn:errorEventDefinition errorRef="Error_0zsv500" /> + </bpmn:endEvent> + </bpmn:process> + <bpmn:error id="Error_0zsv500" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ConfigDeployVnfBB"> + <bpmndi:BPMNEdge id="SequenceFlow_0pd4jka_di" bpmnElement="SequenceFlow_0pd4jka"> + <di:waypoint x="542" y="248" /> + <di:waypoint x="607" y="248" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_03xbj4e_di" bpmnElement="SequenceFlow_03xbj4e"> + <di:waypoint x="1039" y="248" /> + <di:waypoint x="1089" y="248" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_00u29dm_di" bpmnElement="SequenceFlow_00u29dm"> + <di:waypoint x="1327" y="248" /> + <di:waypoint x="1399" y="248" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="Start"> + <dc:Bounds x="506" y="230" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="512" y="273" width="25" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0c9apxl_di" bpmnElement="UpdateAAIConfigured"> + <dc:Bounds x="1227" y="208" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0p7ssqo_di" bpmnElement="End"> + <dc:Bounds x="1399" y="230" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1407" y="273" width="20" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="CallActivity_0vg7uiv_di" bpmnElement="AbstractCDSBB"> + <dc:Bounds x="939" y="208" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_05zt0do_di" bpmnElement="UpdateAAIConfigure"> + <dc:Bounds x="607" y="208" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0moyu92_di" bpmnElement="SequenceFlow_0moyu92"> + <di:waypoint x="707" y="248" /> + <di:waypoint x="770" y="248" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0kruy8t_di" bpmnElement="SequenceFlow_0kruy8t"> + <di:waypoint x="870" y="248" /> + <di:waypoint x="939" y="248" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_0m4kmps_di" bpmnElement="PreProcessAbstractCDSProcessing"> + <dc:Bounds x="770" y="208" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_0duh80v_di" bpmnElement="ExclusiveGateway_0duh80v" isMarkerVisible="true"> + <dc:Bounds x="1089" y="223" width="50" height="50" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1tb7fs1_di" bpmnElement="SequenceFlow_1tb7fs1"> + <di:waypoint x="1139" y="248" /> + <di:waypoint x="1227" y="248" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1163" y="230" width="41" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0o50k2d_di" bpmnElement="SequenceFlow_0o50k2d"> + <di:waypoint x="1114" y="273" /> + <di:waypoint x="1114" y="348" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="EndEvent_1p3d0t4_di" bpmnElement="EndEvent_0wwnq4u"> + <dc:Bounds x="1096" y="348" width="36" height="36" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfDeleteBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfDeleteBB.bpmn new file mode 100644 index 0000000000..2d247365d0 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfDeleteBB.bpmn @@ -0,0 +1,62 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1as67q3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> + <bpmn:process id="EtsiVnfDeleteBB" name=" EtsiVnfDeleteBB" isExecutable="true"> + <bpmn:startEvent id="StartEvent_0i3wi1x"> + <bpmn:outgoing>SequenceFlow_01pwrcr</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:serviceTask id="ServiceTask_1d5jbsb" name=" Invoke VNFM Adaptor " camunda:asyncAfter="true" camunda:expression="${EtsiVnfDeleteTask.invokeVnfmAdapter(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_01pwrcr</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1064iul</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:endEvent id="EndEvent_1khf4qw"> + <bpmn:incoming>SequenceFlow_0503le2</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_1064iul" sourceRef="ServiceTask_1d5jbsb" targetRef="CallActivity_1f7uwws" /> + <bpmn:sequenceFlow id="SequenceFlow_01pwrcr" sourceRef="StartEvent_0i3wi1x" targetRef="ServiceTask_1d5jbsb" /> + <bpmn:callActivity id="CallActivity_1f7uwws" name="Monitor Delete Job" calledElement="MonitorVnfmDeleteJob"> + <bpmn:incoming>SequenceFlow_1064iul</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0qt5cvg</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_0qt5cvg" sourceRef="CallActivity_1f7uwws" targetRef="CallActivity_0udkzom" /> + <bpmn:callActivity id="CallActivity_0udkzom" name="Monitor Delete Node Status" calledElement="MonitorVnfmDeleteNodeStatus"> + <bpmn:incoming>SequenceFlow_0qt5cvg</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0503le2</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_0503le2" sourceRef="CallActivity_0udkzom" targetRef="EndEvent_1khf4qw" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="EtsiVnfDeleteBB"> + <bpmndi:BPMNShape id="StartEvent_0i3wi1x_di" bpmnElement="StartEvent_0i3wi1x"> + <dc:Bounds x="325" y="183" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1d5jbsa_di" bpmnElement="ServiceTask_1d5jbsb"> + <dc:Bounds x="503" y="161" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1khf4qw_di" bpmnElement="EndEvent_1khf4qw"> + <dc:Bounds x="1001" y="183" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1064iul_di" bpmnElement="SequenceFlow_1064iul"> + <di:waypoint x="603" y="201" /> + <di:waypoint x="659" y="201" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_01pwrcr_di" bpmnElement="SequenceFlow_01pwrcr"> + <di:waypoint x="361" y="201" /> + <di:waypoint x="503" y="201" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="CallActivity_1f7uwws_di" bpmnElement="CallActivity_1f7uwws"> + <dc:Bounds x="659" y="161" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0qt5cvg_di" bpmnElement="SequenceFlow_0qt5cvg"> + <di:waypoint x="759" y="201" /> + <di:waypoint x="812" y="201" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="CallActivity_0udkzom_di" bpmnElement="CallActivity_0udkzom"> + <dc:Bounds x="812" y="161" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0503le2_di" bpmnElement="SequenceFlow_0503le2"> + <di:waypoint x="912" y="201" /> + <di:waypoint x="1001" y="201" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfInstantiateBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfInstantiateBB.bpmn new file mode 100644 index 0000000000..13bd107fdb --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfInstantiateBB.bpmn @@ -0,0 +1,92 @@ +<?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0x13ohc" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> + <bpmn:process id="EtsiVnfInstantiateBB" name=" EtsiVnfInstantiateBB" isExecutable="true"> + <bpmn:serviceTask id="ServiceTask_02e82t2" name="Create CreateVnfRequest " camunda:expression="${VnfmAdapterCreateVnfTask.buildCreateVnfRequest(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_18fsqzd</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0f0vsnv</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:startEvent id="StartEvent_0ru3x55"> + <bpmn:outgoing>SequenceFlow_016sgof</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:sequenceFlow id="SequenceFlow_016sgof" sourceRef="StartEvent_0ru3x55" targetRef="ServiceTask_1jf7hlc" /> + <bpmn:endEvent id="EndEvent_001k15i"> + <bpmn:incoming>SequenceFlow_0n57z81</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_0f0vsnv" sourceRef="ServiceTask_02e82t2" targetRef="ServiceTask_06ao4xu" /> + <bpmn:serviceTask id="ServiceTask_06ao4xu" name=" Invoke VNFM Adaptor " camunda:asyncAfter="true" camunda:expression="${VnfmAdapterCreateVnfTask.invokeVnfmAdapter(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_0f0vsnv</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0hp0ka1</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:serviceTask id="ServiceTask_1jf7hlc" name=" Retrieve Input Parameters " camunda:asyncAfter="true" camunda:expression="${InputParameterRetrieverTask.getInputParameters(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_016sgof</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_18fsqzd</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_18fsqzd" sourceRef="ServiceTask_1jf7hlc" targetRef="ServiceTask_02e82t2" /> + <bpmn:sequenceFlow id="SequenceFlow_0hp0ka1" sourceRef="ServiceTask_06ao4xu" targetRef="CallActivity_0fuqfru" /> + <bpmn:callActivity id="CallActivity_0fuqfru" name="Monitor Instantiation Job" calledElement="MonitorVnfmCreateJob"> + <bpmn:extensionElements> + <camunda:in source="SDNCRequest" target="SDNCRequest" /> + <camunda:out source="SDNCResponse" target="SDNCResponse" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_0hp0ka1</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1owx4yu</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_1owx4yu" sourceRef="CallActivity_0fuqfru" targetRef="CallActivity_0agszsb" /> + <bpmn:callActivity id="CallActivity_0agszsb" name="Monitor Create Node Status" calledElement="MonitorVnfmCreateNodeStatus"> + <bpmn:incoming>SequenceFlow_1owx4yu</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0n57z81</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_0n57z81" sourceRef="CallActivity_0agszsb" targetRef="EndEvent_001k15i" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="EtsiVnfInstantiateBB"> + <bpmndi:BPMNShape id="ServiceTask_02e82t1_di" bpmnElement="ServiceTask_02e82t2"> + <dc:Bounds x="480" y="227" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="StartEvent_0ru3x55_di" bpmnElement="StartEvent_0ru3x55"> + <dc:Bounds x="232" y="249" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_016sgof_di" bpmnElement="SequenceFlow_016sgof"> + <di:waypoint x="268" y="267" /> + <di:waypoint x="332" y="267" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="EndEvent_001k15i_di" bpmnElement="EndEvent_001k15i"> + <dc:Bounds x="1097" y="249" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0f0vsnv_di" bpmnElement="SequenceFlow_0f0vsnv"> + <di:waypoint x="580" y="267" /> + <di:waypoint x="629" y="267" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_06ao4xu_di" bpmnElement="ServiceTask_06ao4xu"> + <dc:Bounds x="629" y="227" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1jf7hlc_di" bpmnElement="ServiceTask_1jf7hlc"> + <dc:Bounds x="332" y="227" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_18fsqzd_di" bpmnElement="SequenceFlow_18fsqzd"> + <di:waypoint x="432" y="267" /> + <di:waypoint x="480" y="267" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0hp0ka1_di" bpmnElement="SequenceFlow_0hp0ka1"> + <di:waypoint x="729" y="267" /> + <di:waypoint x="770" y="267" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="CallActivity_0fuqfru_di" bpmnElement="CallActivity_0fuqfru"> + <dc:Bounds x="770" y="227" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1owx4yu_di" bpmnElement="SequenceFlow_1owx4yu"> + <di:waypoint x="870" y="267" /> + <di:waypoint x="928" y="267" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="CallActivity_0agszsb_di" bpmnElement="CallActivity_0agszsb"> + <dc:Bounds x="928" y="227" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0n57z81_di" bpmnElement="SequenceFlow_0n57z81"> + <di:waypoint x="1028" y="267" /> + <di:waypoint x="1097" y="267" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn index 5189f8b48a..83363d48ba 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn @@ -1,5 +1,5 @@ <?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.2"> <bpmn:process id="ExecuteBuildingBlock" name="ExecuteBuildingBlock" isExecutable="true"> <bpmn:startEvent id="Start_ExecuteBuildingBlock" name="start"> <bpmn:outgoing>SequenceFlow_0rq4c5r</bpmn:outgoing> @@ -9,6 +9,7 @@ <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:out source="WorkflowExceptionErrorMessage" target="WorkflowExceptionErrorMessage" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_19wuics</bpmn:incoming> <bpmn:outgoing>SequenceFlow_01h9qmz</bpmn:outgoing> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateJob.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateJob.bpmn new file mode 100644 index 0000000000..fa9bf7ed3d --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateJob.bpmn @@ -0,0 +1,160 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_12gnsyw" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3"> + <bpmn:process id="MonitorVnfmCreateJob" name="MonitorVnfmCreateJob" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1"> + <bpmn:outgoing>SequenceFlow_1x3tbl0</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:endEvent id="EndEvent_0rf1gde"> + <bpmn:incoming>SequenceFlow_1543qy7</bpmn:incoming> + </bpmn:endEvent> + <bpmn:subProcess id="SubProcess_19j0v63"> + <bpmn:incoming>SequenceFlow_1x3tbl0</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1v4yr3f</bpmn:outgoing> + <bpmn:startEvent id="StartEvent_01r97z2"> + <bpmn:outgoing>SequenceFlow_0s1plu9</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:exclusiveGateway id="ExclusiveGateway_1hkl6yy" default="SequenceFlow_1vmxw9g"> + <bpmn:incoming>SequenceFlow_153a3kp</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1vmxw9g</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_0is7myf</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_1besn3n" name="Wait between checks" camunda:asyncAfter="true"> + <bpmn:incoming>SequenceFlow_1vmxw9g</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0etw572</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_0qgh11t"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT15S</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:intermediateCatchEvent> + <bpmn:endEvent id="EndEvent_1ohsce9"> + <bpmn:incoming>SequenceFlow_0is7myf</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_0s1plu9" sourceRef="StartEvent_01r97z2" targetRef="ServiceTask_17jlnng" /> + <bpmn:sequenceFlow id="SequenceFlow_0etw572" sourceRef="IntermediateCatchEvent_1besn3n" targetRef="ServiceTask_17jlnng" /> + <bpmn:serviceTask id="ServiceTask_17jlnng" name=" Get Current Operation Status " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmCreateJobTask.getCurrentOperationStatus(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_0etw572</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0s1plu9</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_153a3kp</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_1vmxw9g" sourceRef="ExclusiveGateway_1hkl6yy" targetRef="IntermediateCatchEvent_1besn3n" /> + <bpmn:sequenceFlow id="SequenceFlow_0is7myf" sourceRef="ExclusiveGateway_1hkl6yy" targetRef="EndEvent_1ohsce9"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${MonitorVnfmCreateJobTask.hasOperationFinished(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_153a3kp" sourceRef="ServiceTask_17jlnng" targetRef="ExclusiveGateway_1hkl6yy" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_1w3t3t0" name="Timeout Exception"> + <bpmn:incoming>SequenceFlow_0bcgtzj</bpmn:incoming> + <bpmn:terminateEventDefinition id="TerminateEventDefinition_0fjecl3" /> + </bpmn:endEvent> + <bpmn:boundaryEvent id="BoundaryEvent_0xiabzp" name="Overall Wait" attachedToRef="SubProcess_19j0v63"> + <bpmn:outgoing>SequenceFlow_1i1o9sh</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_10kqw61"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT3H</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:boundaryEvent> + <bpmn:sequenceFlow id="SequenceFlow_1v4yr3f" sourceRef="SubProcess_19j0v63" targetRef="ServiceTask_1gms128" /> + <bpmn:sequenceFlow id="SequenceFlow_1i1o9sh" sourceRef="BoundaryEvent_0xiabzp" targetRef="ServiceTask_1s87b92" /> + <bpmn:sequenceFlow id="SequenceFlow_1x3tbl0" sourceRef="StartEvent_1" targetRef="SubProcess_19j0v63" /> + <bpmn:serviceTask id="ServiceTask_1s87b92" name=" Time Out Log Failure " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmCreateJobTask.timeOutLogFailue(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_1i1o9sh</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0bcgtzj</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_0bcgtzj" sourceRef="ServiceTask_1s87b92" targetRef="EndEvent_1w3t3t0" /> + <bpmn:serviceTask id="ServiceTask_1gms128" name=" Check if operation was successful " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmCreateJobTask.checkIfOperationWasSuccessful(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_1v4yr3f</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1543qy7</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_1543qy7" sourceRef="ServiceTask_1gms128" targetRef="EndEvent_0rf1gde" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="MonitorVnfmCreateJob"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> + <dc:Bounds x="211" y="430" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0rf1gde_di" bpmnElement="EndEvent_0rf1gde"> + <dc:Bounds x="1152" y="200" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_19j0v63_di" bpmnElement="SubProcess_19j0v63" isExpanded="true"> + <dc:Bounds x="351" y="348" width="523" height="200" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1w3t3t0_di" bpmnElement="EndEvent_1w3t3t0"> + <dc:Bounds x="1152" y="422" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1145" y="382" width="49" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="BoundaryEvent_0xiabzp_di" bpmnElement="BoundaryEvent_0xiabzp"> + <dc:Bounds x="856" y="422" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="844" y="461" width="60" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1v4yr3f_di" bpmnElement="SequenceFlow_1v4yr3f"> + <di:waypoint x="613" y="348" /> + <di:waypoint x="613" y="218" /> + <di:waypoint x="973" y="218" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1i1o9sh_di" bpmnElement="SequenceFlow_1i1o9sh"> + <di:waypoint x="892" y="440" /> + <di:waypoint x="973" y="440" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_01r97z2_di" bpmnElement="StartEvent_01r97z2"> + <dc:Bounds x="380" y="406" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_1hkl6yy_di" bpmnElement="ExclusiveGateway_1hkl6yy" isMarkerVisible="true"> + <dc:Bounds x="659" y="399" width="50" height="50" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateCatchEvent_1besn3n_di" bpmnElement="IntermediateCatchEvent_1besn3n"> + <dc:Bounds x="600" y="478" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="587" y="521" width="66" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1ohsce9_di" bpmnElement="EndEvent_1ohsce9"> + <dc:Bounds x="772" y="406" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1x3tbl0_di" bpmnElement="SequenceFlow_1x3tbl0"> + <di:waypoint x="247" y="448" /> + <di:waypoint x="351" y="448" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_17jlnng_di" bpmnElement="ServiceTask_17jlnng"> + <dc:Bounds x="475" y="384" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0s1plu9_di" bpmnElement="SequenceFlow_0s1plu9"> + <di:waypoint x="416" y="424" /> + <di:waypoint x="475" y="424" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0etw572_di" bpmnElement="SequenceFlow_0etw572"> + <di:waypoint x="600" y="496" /> + <di:waypoint x="536" y="496" /> + <di:waypoint x="536" y="467" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1vmxw9g_di" bpmnElement="SequenceFlow_1vmxw9g"> + <di:waypoint x="684" y="449" /> + <di:waypoint x="684" y="496" /> + <di:waypoint x="636" y="496" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0is7myf_di" bpmnElement="SequenceFlow_0is7myf"> + <di:waypoint x="709" y="424" /> + <di:waypoint x="772" y="424" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_153a3kp_di" bpmnElement="SequenceFlow_153a3kp"> + <di:waypoint x="575" y="424" /> + <di:waypoint x="659" y="424" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_1s87b92_di" bpmnElement="ServiceTask_1s87b92"> + <dc:Bounds x="973" y="400" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0bcgtzj_di" bpmnElement="SequenceFlow_0bcgtzj"> + <di:waypoint x="1073" y="440" /> + <di:waypoint x="1152" y="440" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_1gms128_di" bpmnElement="ServiceTask_1gms128"> + <dc:Bounds x="973" y="178" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1543qy7_di" bpmnElement="SequenceFlow_1543qy7"> + <di:waypoint x="1073" y="218" /> + <di:waypoint x="1152" y="218" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn new file mode 100644 index 0000000000..6d54262dc5 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn @@ -0,0 +1,138 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1ko0frn" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> + <bpmn:process id="Process_1" isExecutable="true"> + <bpmn:startEvent id="StartEvent_0k0qfjb"> + <bpmn:outgoing>SequenceFlow_1miob62</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:subProcess id="SubProcess_10wotbc"> + <bpmn:incoming>SequenceFlow_1miob62</bpmn:incoming> + <bpmn:startEvent id="StartEvent_0r9qf43"> + <bpmn:outgoing>SequenceFlow_1moaz0q</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:exclusiveGateway id="ExclusiveGateway_00xtlfj" default="SequenceFlow_1luu31f"> + <bpmn:incoming>SequenceFlow_0qvy3sn</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1rxbeqi</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_1luu31f</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0xuznv9" name="Wait between checks" camunda:asyncAfter="true"> + <bpmn:incoming>SequenceFlow_1luu31f</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_09t51ao</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_0vrbrge"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT15S</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:intermediateCatchEvent> + <bpmn:endEvent id="EndEvent_0tei3i9"> + <bpmn:incoming>SequenceFlow_1rxbeqi</bpmn:incoming> + </bpmn:endEvent> + <bpmn:serviceTask id="ServiceTask_0y71su8" name=" Get node status " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmNodeTask.getNodeStatus(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_1moaz0q</bpmn:incoming> + <bpmn:incoming>SequenceFlow_09t51ao</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0qvy3sn</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_1rxbeqi" name=" create vnf success " sourceRef="ExclusiveGateway_00xtlfj" targetRef="EndEvent_0tei3i9"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("createVnfNodeStatus")}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_1luu31f" sourceRef="ExclusiveGateway_00xtlfj" targetRef="IntermediateCatchEvent_0xuznv9" /> + <bpmn:sequenceFlow id="SequenceFlow_1moaz0q" sourceRef="StartEvent_0r9qf43" targetRef="ServiceTask_0y71su8" /> + <bpmn:sequenceFlow id="SequenceFlow_0qvy3sn" sourceRef="ServiceTask_0y71su8" targetRef="ExclusiveGateway_00xtlfj" /> + <bpmn:sequenceFlow id="SequenceFlow_09t51ao" sourceRef="IntermediateCatchEvent_0xuznv9" targetRef="ServiceTask_0y71su8" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_1b83rci" name="Timeout Exception"> + <bpmn:incoming>SequenceFlow_0uiqnl8</bpmn:incoming> + <bpmn:terminateEventDefinition id="TerminateEventDefinition_12rjfva" /> + </bpmn:endEvent> + <bpmn:serviceTask id="ServiceTask_12qp0ty" name=" Time Out Log Failure " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmNodeTask.timeOutLogFailue(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_0qcc5x4</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0uiqnl8</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:boundaryEvent id="BoundaryEvent_1f5o5i9" name="Overall Wait" attachedToRef="SubProcess_10wotbc"> + <bpmn:outgoing>SequenceFlow_0qcc5x4</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_1t3ya63"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT3H</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:boundaryEvent> + <bpmn:sequenceFlow id="SequenceFlow_1miob62" sourceRef="StartEvent_0k0qfjb" targetRef="SubProcess_10wotbc" /> + <bpmn:sequenceFlow id="SequenceFlow_0uiqnl8" sourceRef="ServiceTask_12qp0ty" targetRef="EndEvent_1b83rci" /> + <bpmn:sequenceFlow id="SequenceFlow_0qcc5x4" sourceRef="BoundaryEvent_1f5o5i9" targetRef="ServiceTask_12qp0ty" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"> + <bpmndi:BPMNShape id="StartEvent_0k0qfjb_di" bpmnElement="StartEvent_0k0qfjb"> + <dc:Bounds x="155" y="219" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_10wotbc_di" bpmnElement="SubProcess_10wotbc" isExpanded="true"> + <dc:Bounds x="293" y="137" width="523" height="200" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1b83rci_di" bpmnElement="EndEvent_1b83rci"> + <dc:Bounds x="1096" y="211" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1089" y="171" width="49" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_12qp0ty_di" bpmnElement="ServiceTask_12qp0ty"> + <dc:Bounds x="917" y="189" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="BoundaryEvent_1f5o5i9_di" bpmnElement="BoundaryEvent_1f5o5i9"> + <dc:Bounds x="800" y="211" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="788" y="250" width="60" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1miob62_di" bpmnElement="SequenceFlow_1miob62"> + <di:waypoint x="191" y="237" /> + <di:waypoint x="293" y="237" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0uiqnl8_di" bpmnElement="SequenceFlow_0uiqnl8"> + <di:waypoint x="1017" y="229" /> + <di:waypoint x="1096" y="229" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0qcc5x4_di" bpmnElement="SequenceFlow_0qcc5x4"> + <di:waypoint x="836" y="229" /> + <di:waypoint x="917" y="229" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_0r9qf43_di" bpmnElement="StartEvent_0r9qf43"> + <dc:Bounds x="324" y="195" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_00xtlfj_di" bpmnElement="ExclusiveGateway_00xtlfj" isMarkerVisible="true"> + <dc:Bounds x="603" y="188" width="50" height="50" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateCatchEvent_0xuznv9_di" bpmnElement="IntermediateCatchEvent_0xuznv9"> + <dc:Bounds x="544" y="267" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="531" y="310" width="67" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0tei3i9_di" bpmnElement="EndEvent_0tei3i9"> + <dc:Bounds x="716" y="195" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0y71su8_di" bpmnElement="ServiceTask_0y71su8"> + <dc:Bounds x="412" y="173" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1rxbeqi_di" bpmnElement="SequenceFlow_1rxbeqi"> + <di:waypoint x="653" y="213" /> + <di:waypoint x="716" y="213" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="660" y="195" width="50" height="80" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1luu31f_di" bpmnElement="SequenceFlow_1luu31f"> + <di:waypoint x="628" y="238" /> + <di:waypoint x="628" y="285" /> + <di:waypoint x="580" y="285" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1moaz0q_di" bpmnElement="SequenceFlow_1moaz0q"> + <di:waypoint x="360" y="213" /> + <di:waypoint x="412" y="213" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0qvy3sn_di" bpmnElement="SequenceFlow_0qvy3sn"> + <di:waypoint x="512" y="213" /> + <di:waypoint x="603" y="213" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_09t51ao_di" bpmnElement="SequenceFlow_09t51ao"> + <di:waypoint x="544" y="285" /> + <di:waypoint x="451" y="285" /> + <di:waypoint x="452" y="253" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteJob.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteJob.bpmn new file mode 100644 index 0000000000..a35ff47c6d --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteJob.bpmn @@ -0,0 +1,160 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_12gnsyw" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> + <bpmn:process id="MonitorVnfmDeleteJob" name="MonitorVnfmDeleteJob" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1"> + <bpmn:outgoing>SequenceFlow_1x3tbl0</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:endEvent id="EndEvent_0rf1gde"> + <bpmn:incoming>SequenceFlow_1543qy7</bpmn:incoming> + </bpmn:endEvent> + <bpmn:subProcess id="SubProcess_19j0v63"> + <bpmn:incoming>SequenceFlow_1x3tbl0</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1v4yr3f</bpmn:outgoing> + <bpmn:startEvent id="StartEvent_01r97z2"> + <bpmn:outgoing>SequenceFlow_0s1plu9</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:exclusiveGateway id="ExclusiveGateway_1hkl6yy" default="SequenceFlow_1vmxw9g"> + <bpmn:incoming>SequenceFlow_153a3kp</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1vmxw9g</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_0is7myf</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_1besn3n" name="Wait between checks" camunda:asyncAfter="true"> + <bpmn:incoming>SequenceFlow_1vmxw9g</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0etw572</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_0qgh11t"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT15S</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:intermediateCatchEvent> + <bpmn:endEvent id="EndEvent_1ohsce9"> + <bpmn:incoming>SequenceFlow_0is7myf</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_0s1plu9" sourceRef="StartEvent_01r97z2" targetRef="ServiceTask_17jlnng" /> + <bpmn:sequenceFlow id="SequenceFlow_0etw572" sourceRef="IntermediateCatchEvent_1besn3n" targetRef="ServiceTask_17jlnng" /> + <bpmn:serviceTask id="ServiceTask_17jlnng" name=" Get Current Operation Status " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmDeleteJobTask.getCurrentOperationStatus(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_0etw572</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0s1plu9</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_153a3kp</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_1vmxw9g" sourceRef="ExclusiveGateway_1hkl6yy" targetRef="IntermediateCatchEvent_1besn3n" /> + <bpmn:sequenceFlow id="SequenceFlow_0is7myf" sourceRef="ExclusiveGateway_1hkl6yy" targetRef="EndEvent_1ohsce9"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${MonitorVnfmDeleteJobTask.hasOperationFinished(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_153a3kp" sourceRef="ServiceTask_17jlnng" targetRef="ExclusiveGateway_1hkl6yy" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_1w3t3t0" name="Timeout Exception"> + <bpmn:incoming>SequenceFlow_0bcgtzj</bpmn:incoming> + <bpmn:terminateEventDefinition id="TerminateEventDefinition_0fjecl3" /> + </bpmn:endEvent> + <bpmn:boundaryEvent id="BoundaryEvent_0xiabzp" name="Overall Wait" attachedToRef="SubProcess_19j0v63"> + <bpmn:outgoing>SequenceFlow_1i1o9sh</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_10kqw61"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT3H</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:boundaryEvent> + <bpmn:sequenceFlow id="SequenceFlow_1v4yr3f" sourceRef="SubProcess_19j0v63" targetRef="ServiceTask_1gms129" /> + <bpmn:sequenceFlow id="SequenceFlow_1i1o9sh" sourceRef="BoundaryEvent_0xiabzp" targetRef="ServiceTask_1s87b92" /> + <bpmn:sequenceFlow id="SequenceFlow_1x3tbl0" sourceRef="StartEvent_1" targetRef="SubProcess_19j0v63" /> + <bpmn:serviceTask id="ServiceTask_1s87b92" name=" Time Out Log Failure " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmDeleteJobTask.timeOutLogFailue(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_1i1o9sh</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0bcgtzj</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_0bcgtzj" sourceRef="ServiceTask_1s87b92" targetRef="EndEvent_1w3t3t0" /> + <bpmn:serviceTask id="ServiceTask_1gms129" name=" Check if operation was successful " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmDeleteJobTask.checkIfOperationWasSuccessful(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_1v4yr3f</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1543qy7</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_1543qy7" sourceRef="ServiceTask_1gms129" targetRef="EndEvent_0rf1gde" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="MonitorVnfmDeleteJob"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> + <dc:Bounds x="211" y="430" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0rf1gde_di" bpmnElement="EndEvent_0rf1gde"> + <dc:Bounds x="1152" y="200" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_19j0v63_di" bpmnElement="SubProcess_19j0v63" isExpanded="true"> + <dc:Bounds x="351" y="348" width="523" height="200" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1w3t3t0_di" bpmnElement="EndEvent_1w3t3t0"> + <dc:Bounds x="1152" y="422" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1145" y="382" width="49" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="BoundaryEvent_0xiabzp_di" bpmnElement="BoundaryEvent_0xiabzp"> + <dc:Bounds x="856" y="422" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="844" y="461" width="60" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1v4yr3f_di" bpmnElement="SequenceFlow_1v4yr3f"> + <di:waypoint x="613" y="348" /> + <di:waypoint x="613" y="218" /> + <di:waypoint x="973" y="218" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1i1o9sh_di" bpmnElement="SequenceFlow_1i1o9sh"> + <di:waypoint x="892" y="440" /> + <di:waypoint x="973" y="440" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_01r97z2_di" bpmnElement="StartEvent_01r97z2"> + <dc:Bounds x="380" y="406" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_1hkl6yy_di" bpmnElement="ExclusiveGateway_1hkl6yy" isMarkerVisible="true"> + <dc:Bounds x="659" y="399" width="50" height="50" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateCatchEvent_1besn3n_di" bpmnElement="IntermediateCatchEvent_1besn3n"> + <dc:Bounds x="600" y="478" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="587" y="521" width="66" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1ohsce9_di" bpmnElement="EndEvent_1ohsce9"> + <dc:Bounds x="772" y="406" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1x3tbl0_di" bpmnElement="SequenceFlow_1x3tbl0"> + <di:waypoint x="247" y="448" /> + <di:waypoint x="351" y="448" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_17jlnng_di" bpmnElement="ServiceTask_17jlnng"> + <dc:Bounds x="475" y="384" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0s1plu9_di" bpmnElement="SequenceFlow_0s1plu9"> + <di:waypoint x="416" y="424" /> + <di:waypoint x="475" y="424" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0etw572_di" bpmnElement="SequenceFlow_0etw572"> + <di:waypoint x="600" y="496" /> + <di:waypoint x="536" y="496" /> + <di:waypoint x="536" y="467" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1vmxw9g_di" bpmnElement="SequenceFlow_1vmxw9g"> + <di:waypoint x="684" y="449" /> + <di:waypoint x="684" y="496" /> + <di:waypoint x="636" y="496" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0is7myf_di" bpmnElement="SequenceFlow_0is7myf"> + <di:waypoint x="709" y="424" /> + <di:waypoint x="772" y="424" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_153a3kp_di" bpmnElement="SequenceFlow_153a3kp"> + <di:waypoint x="575" y="424" /> + <di:waypoint x="659" y="424" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_1s87b92_di" bpmnElement="ServiceTask_1s87b92"> + <dc:Bounds x="973" y="400" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0bcgtzj_di" bpmnElement="SequenceFlow_0bcgtzj"> + <di:waypoint x="1073" y="440" /> + <di:waypoint x="1152" y="440" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_1gms128_di" bpmnElement="ServiceTask_1gms129"> + <dc:Bounds x="973" y="178" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1543qy7_di" bpmnElement="SequenceFlow_1543qy7"> + <di:waypoint x="1073" y="218" /> + <di:waypoint x="1152" y="218" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn new file mode 100644 index 0000000000..8fababaffe --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn @@ -0,0 +1,138 @@ +<?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:di="http://www.omg.org/spec/DD/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" id="Definitions_15jp7td" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> + <bpmn:process id="MonitorVnfmDeleteNodeStatus" name="MonitorVnfmDeleteNodeStatus" isExecutable="true"> + <bpmn:startEvent id="StartEvent_0f7nbs2"> + <bpmn:outgoing>SequenceFlow_0spr34x</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:subProcess id="SubProcess_1q8fnjx"> + <bpmn:incoming>SequenceFlow_0spr34x</bpmn:incoming> + <bpmn:startEvent id="StartEvent_06pbazr"> + <bpmn:outgoing>SequenceFlow_17vvpzi</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:exclusiveGateway id="ExclusiveGateway_1j9jbtk" default="SequenceFlow_0zlblru"> + <bpmn:incoming>SequenceFlow_1unicf9</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_03pp1ee</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_0zlblru</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_15yl23y" name="Wait between checks" camunda:asyncAfter="true"> + <bpmn:incoming>SequenceFlow_0zlblru</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_11rfobu</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_0o69kn7"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT15S</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:intermediateCatchEvent> + <bpmn:endEvent id="EndEvent_1hukjy3"> + <bpmn:incoming>SequenceFlow_03pp1ee</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="SequenceFlow_03pp1ee" name=" delete vnf success " sourceRef="ExclusiveGateway_1j9jbtk" targetRef="EndEvent_1hukjy3"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("deleteVnfNodeStatus")}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_0zlblru" sourceRef="ExclusiveGateway_1j9jbtk" targetRef="IntermediateCatchEvent_15yl23y" /> + <bpmn:serviceTask id="ServiceTask_1ksqjjf" name=" Get node status " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmNodeTask.getNodeStatus(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_17vvpzi</bpmn:incoming> + <bpmn:incoming>SequenceFlow_11rfobu</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1unicf9</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_17vvpzi" sourceRef="StartEvent_06pbazr" targetRef="ServiceTask_1ksqjjf" /> + <bpmn:sequenceFlow id="SequenceFlow_1unicf9" sourceRef="ServiceTask_1ksqjjf" targetRef="ExclusiveGateway_1j9jbtk" /> + <bpmn:sequenceFlow id="SequenceFlow_11rfobu" sourceRef="IntermediateCatchEvent_15yl23y" targetRef="ServiceTask_1ksqjjf" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_1bhjbb4" name="Timeout Exception"> + <bpmn:incoming>SequenceFlow_1o7p21a</bpmn:incoming> + <bpmn:terminateEventDefinition id="TerminateEventDefinition_1bme4ej" /> + </bpmn:endEvent> + <bpmn:serviceTask id="ServiceTask_1wmy8ge" name=" Time Out Log Failure " camunda:asyncAfter="true" camunda:expression="${MonitorVnfmNodeTask.timeOutLogFailue(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>SequenceFlow_1suioy7</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1o7p21a</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:boundaryEvent id="BoundaryEvent_1frhcyq" name="Overall Wait" attachedToRef="SubProcess_1q8fnjx"> + <bpmn:outgoing>SequenceFlow_1suioy7</bpmn:outgoing> + <bpmn:timerEventDefinition id="TimerEventDefinition_1ish98h"> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT3H</bpmn:timeDuration> + </bpmn:timerEventDefinition> + </bpmn:boundaryEvent> + <bpmn:sequenceFlow id="SequenceFlow_0spr34x" sourceRef="StartEvent_0f7nbs2" targetRef="SubProcess_1q8fnjx" /> + <bpmn:sequenceFlow id="SequenceFlow_1o7p21a" sourceRef="ServiceTask_1wmy8ge" targetRef="EndEvent_1bhjbb4" /> + <bpmn:sequenceFlow id="SequenceFlow_1suioy7" sourceRef="BoundaryEvent_1frhcyq" targetRef="ServiceTask_1wmy8ge" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="MonitorVnfmDeleteNodeStatus"> + <bpmndi:BPMNShape id="StartEvent_0f7nbs2_di" bpmnElement="StartEvent_0f7nbs2"> + <dc:Bounds x="154" y="313" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_1q8fnjx_di" bpmnElement="SubProcess_1q8fnjx" isExpanded="true"> + <dc:Bounds x="293" y="231" width="523" height="200" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1bhjbb4_di" bpmnElement="EndEvent_1bhjbb4"> + <dc:Bounds x="1095" y="305" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1088" y="265" width="49" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1wmy8ge_di" bpmnElement="ServiceTask_1wmy8ge"> + <dc:Bounds x="916" y="283" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1ksqjjf_di" bpmnElement="ServiceTask_1ksqjjf"> + <dc:Bounds x="411" y="267" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="BoundaryEvent_1frhcyq_di" bpmnElement="BoundaryEvent_1frhcyq"> + <dc:Bounds x="799" y="305" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="787" y="344" width="60" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0spr34x_di" bpmnElement="SequenceFlow_0spr34x"> + <di:waypoint x="190" y="331" /> + <di:waypoint x="293" y="331" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1o7p21a_di" bpmnElement="SequenceFlow_1o7p21a"> + <di:waypoint x="1016" y="323" /> + <di:waypoint x="1095" y="323" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1suioy7_di" bpmnElement="SequenceFlow_1suioy7"> + <di:waypoint x="835" y="323" /> + <di:waypoint x="916" y="323" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_06pbazr_di" bpmnElement="StartEvent_06pbazr"> + <dc:Bounds x="323" y="289" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_1j9jbtk_di" bpmnElement="ExclusiveGateway_1j9jbtk" isMarkerVisible="true"> + <dc:Bounds x="602" y="282" width="50" height="50" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateCatchEvent_15yl23y_di" bpmnElement="IntermediateCatchEvent_15yl23y"> + <dc:Bounds x="543" y="361" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="530" y="404" width="67" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1hukjy3_di" bpmnElement="EndEvent_1hukjy3"> + <dc:Bounds x="715" y="289" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_03pp1ee_di" bpmnElement="SequenceFlow_03pp1ee"> + <di:waypoint x="652" y="307" /> + <di:waypoint x="715" y="307" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="660" y="289" width="49" height="93" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0zlblru_di" bpmnElement="SequenceFlow_0zlblru"> + <di:waypoint x="627" y="332" /> + <di:waypoint x="627" y="379" /> + <di:waypoint x="579" y="379" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_17vvpzi_di" bpmnElement="SequenceFlow_17vvpzi"> + <di:waypoint x="359" y="307" /> + <di:waypoint x="411" y="307" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1unicf9_di" bpmnElement="SequenceFlow_1unicf9"> + <di:waypoint x="511" y="307" /> + <di:waypoint x="602" y="307" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_11rfobu_di" bpmnElement="SequenceFlow_11rfobu"> + <di:waypoint x="543" y="379" /> + <di:waypoint x="450" y="379" /> + <di:waypoint x="451" y="347" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/SDNCHandler.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/SDNCHandler.bpmn index 0be7c55596..7339b23802 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/SDNCHandler.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/SDNCHandler.bpmn @@ -1,5 +1,5 @@ <?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3"> <bpmn:process id="SDNCHandler" name="SDNC" isExecutable="true"> <bpmn:startEvent id="SDNC_Start"> <bpmn:outgoing>SequenceFlow_1n0j3hz</bpmn:outgoing> @@ -38,7 +38,7 @@ <bpmn:boundaryEvent id="BoundaryEvent_1quvxva" name="Timeout" attachedToRef="SubProcess_0y8yozw"> <bpmn:outgoing>SequenceFlow_1yifu46</bpmn:outgoing> <bpmn:timerEventDefinition> - <bpmn:timeDuration xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("sdncTimeout")}]]></bpmn:timeDuration> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">${execution.getVariable("sdncTimeout")}</bpmn:timeDuration> </bpmn:timerEventDefinition> </bpmn:boundaryEvent> <bpmn:sequenceFlow id="SequenceFlow_1ecej8g" sourceRef="SubProcess_0y8yozw" targetRef="ExclusiveGateway_09ehhaf" /> @@ -48,7 +48,7 @@ <bpmn:outgoing>SequenceFlow_0i4u8g4</bpmn:outgoing> </bpmn:exclusiveGateway> <bpmn:sequenceFlow id="SequenceFlow_0rh24pq" name="Final Ack = N" sourceRef="ExclusiveGateway_09ehhaf" targetRef="SubProcess_0y8yozw"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isCallbackCompleted")}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isCallbackCompleted") == false}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="SequenceFlow_1yifu46" sourceRef="BoundaryEvent_1quvxva" targetRef="Task_1un0flc" /> <bpmn:sequenceFlow id="SequenceFlow_1n0j3hz" sourceRef="SDNC_Start" targetRef="SNDC_SetupCallback" /> @@ -62,7 +62,7 @@ <bpmn:sequenceFlow id="SequenceFlow_0flbj8a" sourceRef="SNDC_SetupCallback" targetRef="Call_SDNC" /> <bpmn:sequenceFlow id="SequenceFlow_0i4u8g4" name="Final Ack = Y" sourceRef="ExclusiveGateway_09ehhaf" targetRef="SDNC_End" /> <bpmn:sequenceFlow id="SequenceFlow_0puiqga" name="Final Ack = Y" sourceRef="isAsync_Gateway" targetRef="SDNC_End"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isSDNCCompleted")}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isSDNCCompleted")}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:serviceTask id="SNDC_SetupCallback" name="Setup Callback Variables" camunda:expression="${SDNCRequestTasks.createCorrelationVariables(execution)}"> <bpmn:incoming>SequenceFlow_1n0j3hz</bpmn:incoming> @@ -72,7 +72,7 @@ <bpmn:incoming>SequenceFlow_1yifu46</bpmn:incoming> </bpmn:serviceTask> </bpmn:process> - <bpmn:message id="Message_06oc4iz" name="SDNCCallbackMessage" /> + <bpmn:message id="Message_06oc4iz" name="WorkflowMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="SDNCHandler"> <bpmndi:BPMNShape id="StartEvent_0kxwniy_di" bpmnElement="SDNC_Start"> @@ -118,23 +118,23 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1qxm8ot_di" bpmnElement="SequenceFlow_1qxm8ot"> - <di:waypoint xsi:type="dc:Point" x="347" y="-72" /> - <di:waypoint xsi:type="dc:Point" x="376" y="-72" /> + <di:waypoint x="347" y="-72" /> + <di:waypoint x="376" y="-72" /> <bpmndi:BPMNLabel> <dc:Bounds x="316.5" y="-93.5" width="90" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_05eggbt_di" bpmnElement="SequenceFlow_05eggbt"> - <di:waypoint xsi:type="dc:Point" x="412" y="-72" /> - <di:waypoint xsi:type="dc:Point" x="438" y="-72" /> + <di:waypoint x="412" y="-72" /> + <di:waypoint x="438" y="-72" /> <bpmndi:BPMNLabel> <dc:Bounds x="380" y="-93.5" width="90" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1ecej8g_di" bpmnElement="SequenceFlow_1ecej8g"> - <di:waypoint xsi:type="dc:Point" x="618" y="-67" /> - <di:waypoint xsi:type="dc:Point" x="798" y="-67" /> - <di:waypoint xsi:type="dc:Point" x="798" y="28" /> + <di:waypoint x="618" y="-67" /> + <di:waypoint x="798" y="-67" /> + <di:waypoint x="798" y="28" /> <bpmndi:BPMNLabel> <dc:Bounds x="663" y="-88.5" width="90" height="13" /> </bpmndi:BPMNLabel> @@ -146,23 +146,23 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0rh24pq_di" bpmnElement="SequenceFlow_0rh24pq"> - <di:waypoint xsi:type="dc:Point" x="773" y="53" /> - <di:waypoint xsi:type="dc:Point" x="449" y="53" /> - <di:waypoint xsi:type="dc:Point" x="449" y="9" /> + <di:waypoint x="773" y="53" /> + <di:waypoint x="449" y="53" /> + <di:waypoint x="449" y="9" /> <bpmndi:BPMNLabel> <dc:Bounds x="579.9877300613497" y="32" width="66" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1yifu46_di" bpmnElement="SequenceFlow_1yifu46"> - <di:waypoint xsi:type="dc:Point" x="636" y="-144" /> - <di:waypoint xsi:type="dc:Point" x="748" y="-145" /> + <di:waypoint x="636" y="-144" /> + <di:waypoint x="748" y="-145" /> <bpmndi:BPMNLabel> <dc:Bounds x="647" y="-166" width="90" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1n0j3hz_di" bpmnElement="SequenceFlow_1n0j3hz"> - <di:waypoint xsi:type="dc:Point" x="-231" y="152" /> - <di:waypoint xsi:type="dc:Point" x="-171" y="152" /> + <di:waypoint x="-231" y="152" /> + <di:waypoint x="-171" y="152" /> <bpmndi:BPMNLabel> <dc:Bounds x="-201" y="130.5" width="0" height="13" /> </bpmndi:BPMNLabel> @@ -174,47 +174,47 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0yve6l6_di" bpmnElement="SequenceFlow_0yve6l6"> - <di:waypoint xsi:type="dc:Point" x="253" y="127" /> - <di:waypoint xsi:type="dc:Point" x="253" y="92" /> - <di:waypoint xsi:type="dc:Point" x="253" y="92" /> - <di:waypoint xsi:type="dc:Point" x="253" y="-67" /> - <di:waypoint xsi:type="dc:Point" x="278" y="-67" /> + <di:waypoint x="253" y="127" /> + <di:waypoint x="253" y="92" /> + <di:waypoint x="253" y="92" /> + <di:waypoint x="253" y="-67" /> + <di:waypoint x="278" y="-67" /> <bpmndi:BPMNLabel> <dc:Bounds x="263" y="57" width="65" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_07vnhri_di" bpmnElement="SequenceFlow_07vnhri"> - <di:waypoint xsi:type="dc:Point" x="115" y="152" /> - <di:waypoint xsi:type="dc:Point" x="228" y="152" /> + <di:waypoint x="115" y="152" /> + <di:waypoint x="228" y="152" /> <bpmndi:BPMNLabel> <dc:Bounds x="171.5" y="130" width="0" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0flbj8a_di" bpmnElement="SequenceFlow_0flbj8a"> - <di:waypoint xsi:type="dc:Point" x="-71" y="152" /> - <di:waypoint xsi:type="dc:Point" x="15" y="152" /> + <di:waypoint x="-71" y="152" /> + <di:waypoint x="15" y="152" /> <bpmndi:BPMNLabel> <dc:Bounds x="-28" y="130.5" width="0" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0i4u8g4_di" bpmnElement="SequenceFlow_0i4u8g4"> - <di:waypoint xsi:type="dc:Point" x="798" y="78" /> - <di:waypoint xsi:type="dc:Point" x="798" y="174" /> + <di:waypoint x="798" y="78" /> + <di:waypoint x="798" y="174" /> <bpmndi:BPMNLabel> <dc:Bounds x="809" y="119" width="66" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0puiqga_di" bpmnElement="SequenceFlow_0puiqga"> - <di:waypoint xsi:type="dc:Point" x="253" y="177" /> - <di:waypoint xsi:type="dc:Point" x="253" y="192" /> - <di:waypoint xsi:type="dc:Point" x="780" y="192" /> + <di:waypoint x="253" y="177" /> + <di:waypoint x="253" y="192" /> + <di:waypoint x="780" y="192" /> <bpmndi:BPMNLabel> <dc:Bounds x="310" y="161" width="66" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0oh3ye4_di" bpmnElement="SequenceFlow_0oh3ye4"> - <di:waypoint xsi:type="dc:Point" x="538" y="-72" /> - <di:waypoint xsi:type="dc:Point" x="562" y="-72" /> + <di:waypoint x="538" y="-72" /> + <di:waypoint x="562" y="-72" /> <bpmndi:BPMNLabel> <dc:Bounds x="550" y="-93.5" width="0" height="13" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn index 2437476b59..76ca2a89cc 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn @@ -1,5 +1,5 @@ <?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:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/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" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.2"> <bpmn:process id="WorkflowActionBB" name="WorkflowActionBB" isExecutable="true"> <bpmn:startEvent id="Start_WorkflowActionBB" name="start"> <bpmn:outgoing>SequenceFlow_15s0okp</bpmn:outgoing> @@ -88,7 +88,7 @@ </bpmn:serviceTask> </bpmn:subProcess> <bpmn:sequenceFlow id="SequenceFlow_0v588sm" name="Rollback = true" sourceRef="ExclusiveGateway_Finished" targetRef="Task_RollbackExecutionPath"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Rollback"||execution.getVariable("handlingCode")=="RollbackToAssigned"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Rollback"||execution.getVariable("handlingCode")=="RollbackToAssigned"||execution.getVariable("handlingCode")=="RollbackToCreated"}]]></bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="SequenceFlow_1atzsgn" sourceRef="Task_RollbackExecutionPath" targetRef="Task_SelectBB"> <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isRollbackNeeded")==true}]]></bpmn:conditionExpression> diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/AllTestSuites.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/AllTestSuites.java index 98e613efe6..8c8981e6e6 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/AllTestSuites.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/AllTestSuites.java @@ -19,14 +19,14 @@ */ package org.onap.so; -import org.junit.runner.RunWith; +import org.junit.runner.RunWith; import com.googlecode.junittoolbox.SuiteClasses; import com.googlecode.junittoolbox.WildcardPatternSuite; @RunWith(WildcardPatternSuite.class) @SuiteClasses({"**/*Test.class"}) public class AllTestSuites { - // the class remains empty, - // used only as a holder for the above annotations + // the class remains empty, + // used only as a holder for the above annotations } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseTest.java index 73aa0a7201..5451860a90 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseTest.java @@ -26,7 +26,6 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; - import org.camunda.bpm.engine.RepositoryService; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.model.bpmn.Bpmn; @@ -62,7 +61,6 @@ import org.springframework.http.HttpHeaders; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -74,134 +72,126 @@ import com.fasterxml.jackson.databind.ObjectMapper; public abstract class BaseTest extends BuildingBlockTestDataSetup { - protected Map<String, Object> variables = new HashMap<>(); - - protected TestRestTemplate restTemplate = new TestRestTemplate(); - - protected HttpHeaders headers = new HttpHeaders(); - - @Value("${wiremock.server.port}") - protected String wireMockPort; + protected Map<String, Object> variables = new HashMap<>(); - @Autowired - protected RuntimeService runtimeService; + protected TestRestTemplate restTemplate = new TestRestTemplate(); - @Autowired - private RepositoryService repositoryService; - /* - * Mocked for injection via autowiring - */ + protected HttpHeaders headers = new HttpHeaders(); - @Value("${mso.catalog.db.spring.endpoint}") - protected String endpoint; + @Value("${wiremock.server.port}") + protected String wireMockPort; - @MockBean - protected CatalogDbClient MOCK_catalogDbClient; + @Autowired + protected RuntimeService runtimeService; - @SpyBean - protected InjectionHelper MOCK_injectionHelper; + @Autowired + private RepositoryService repositoryService; + /* + * Mocked for injection via autowiring + */ - @SpyBean - protected NetworkAdapterObjectMapper MOCK_networkAdapterObjectMapper; + @Value("${mso.catalog.db.spring.endpoint}") + protected String endpoint; - @SpyBean - protected AAIObjectMapper MOCK_aaiObjectMapper; - @SpyBean - protected NetworkAdapterClientImpl MOCK_networkAdapterClient; - @SpyBean - protected SDNCClient MOCK_sdncClient; + @MockBean + protected CatalogDbClient MOCK_catalogDbClient; - @SpyBean - protected AAIFlagTasks aaiFlagTasks; + @SpyBean + protected InjectionHelper MOCK_injectionHelper; - @SpyBean - protected AAIVnfResources aaiVnfResources; + @SpyBean + protected NetworkAdapterObjectMapper MOCK_networkAdapterObjectMapper; - @SpyBean - protected ExceptionBuilder exceptionUtil; + @SpyBean + protected AAIObjectMapper MOCK_aaiObjectMapper; + @SpyBean + protected NetworkAdapterClientImpl MOCK_networkAdapterClient; + @SpyBean + protected SDNCClient MOCK_sdncClient; - @SpyBean - protected SDNOHealthCheckResources MOCK_sdnoHealthCheckResources; + @SpyBean + protected AAIFlagTasks aaiFlagTasks; + @SpyBean + protected AAIVnfResources aaiVnfResources; + @SpyBean + protected ExceptionBuilder exceptionUtil; + @SpyBean + protected SDNOHealthCheckResources MOCK_sdnoHealthCheckResources; - /* - * Classes that cannot be simply mocked because they are both - * needed for testing another class, and must be autowired when - * being tested themselves....or classes with private methods that - * must be stubbed during testing - */ + /* + * Classes that cannot be simply mocked because they are both needed for testing another class, and must be + * autowired when being tested themselves....or classes with private methods that must be stubbed during testing + */ + @SpyBean + protected BBInputSetupMapperLayer SPY_bbInputSetupMapperLayer; + @SpyBean + protected BBInputSetupUtils SPY_bbInputSetupUtils; + @SpyBean + protected BBInputSetup SPY_bbInputSetup; + @SpyBean + protected SniroHomingV2 sniroHoming; - @SpyBean - protected BBInputSetupMapperLayer SPY_bbInputSetupMapperLayer; - @SpyBean - protected BBInputSetupUtils SPY_bbInputSetupUtils; - @SpyBean - protected BBInputSetup SPY_bbInputSetup; - @SpyBean - protected SniroHomingV2 sniroHoming; + @SpyBean + protected SniroClient sniroClient; - @SpyBean - protected SniroClient sniroClient; + @SpyBean + protected SDNOHealthCheckTasks sdnoHealthCheckTasks; - @SpyBean - protected SDNOHealthCheckTasks sdnoHealthCheckTasks; + /* + * Mocked for injection via the IntectionHelper + */ - /* - * Mocked for injection via the IntectionHelper - */ + @Before + public void baseTestBefore() { + variables.put("gBuildingBlockExecution", new DelegateExecutionImpl(new HashMap<>())); - @Before - public void baseTestBefore() { - variables.put("gBuildingBlockExecution", new DelegateExecutionImpl(new HashMap<>())); + } - } + @LocalServerPort + private int port; - @LocalServerPort - private int port; + protected String readFile(String path) throws IOException { + return readFile(path, Charset.defaultCharset()); + } - protected String readFile(String path) throws IOException { - return readFile(path, Charset.defaultCharset()); - } + protected String readFile(String path, Charset encoding) throws IOException { + byte[] encoded = Files.readAllBytes(Paths.get(path)); + return new String(encoded, encoding); + } - protected String readFile(String path, Charset encoding) throws IOException { - byte[] encoded = Files.readAllBytes(Paths.get(path)); - return new String(encoded, encoding); - } + protected String readJsonFileAsString(String fileLocation) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonNode = mapper.readTree(new File(fileLocation)); + return jsonNode.asText(); + } - protected String readJsonFileAsString(String fileLocation) throws IOException{ - ObjectMapper mapper = new ObjectMapper(); - JsonNode jsonNode = mapper.readTree(new File(fileLocation)); - return jsonNode.asText(); - } + protected String createURLWithPort(String uri) { + return "http://localhost:" + port + uri; + } - protected String createURLWithPort(String uri) { - return "http://localhost:" + port + uri; - } - /** - * Create and deploy a process model with one logger delegate as service task. - * - * @param origProcessKey - * key to call - * @param mockProcessName - * process name - * @param fileName - * file name without extension - */ - protected void mockSubprocess(String origProcessKey, String mockProcessName, String fileName) { - BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(origProcessKey).name(mockProcessName) - .startEvent().name("Start Point").serviceTask().name("Log Something for Test") - .camundaClass(MockLoggerDelegate.class.getName()).endEvent().name("End Point").done(); - repositoryService.createDeployment().addModelInstance(fileName + ".bpmn", modelInstance).deploy(); - } + /** + * Create and deploy a process model with one logger delegate as service task. + * + * @param origProcessKey key to call + * @param mockProcessName process name + * @param fileName file name without extension + */ + protected void mockSubprocess(String origProcessKey, String mockProcessName, String fileName) { + BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(origProcessKey).name(mockProcessName) + .startEvent().name("Start Point").serviceTask().name("Log Something for Test") + .camundaClass(MockLoggerDelegate.class.getName()).endEvent().name("End Point").done(); + repositoryService.createDeployment().addModelInstance(fileName + ".bpmn", modelInstance).deploy(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseUnitTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseUnitTest.java index 5719ce15e2..fc5709d1be 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseUnitTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BaseUnitTest.java @@ -20,6 +20,6 @@ package org.onap.so; -public abstract class BaseUnitTest extends BuildingBlockTestDataSetup{ +public abstract class BaseUnitTest extends BuildingBlockTestDataSetup { } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java index cd2b46bf70..47b05f9690 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java @@ -21,15 +21,12 @@ package org.onap.so; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; - - import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl; import org.junit.Before; @@ -72,507 +69,509 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource; import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoAllottedResource; import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy; -public class BuildingBlockTestDataSetup{ - private int collectionCounter; - private int configurationCounter; - private int customerCounter; - private int genericVnfCounter; - private int instanceGroupCounter; - private int l3NetworkCounter; - private int owningEntityCounter; - private int pnfCounter; - private int projectCounter; - private int serviceInstanceCounter; - private int serviceProxyCounter; - private int serviceSubscriptionCounter; - private int vfModuleCounter; - private int volumeGroupCounter; - private int vpnBindingCounter; - private int vpnBondingLinkCounter; - - protected BuildingBlockExecution execution; - - protected GeneralBuildingBlock gBBInput; - - protected HashMap<ResourceKey, String> lookupKeyMap; - - protected ExtractPojosForBB extractPojosForBB = new ExtractPojosForBB(); - - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - protected DelegateExecution delegateExecution; - - @Before - public void buildingBlockTestDataSetupBefore() { - collectionCounter = 0; - configurationCounter = 0; - customerCounter = 0; - genericVnfCounter = 0; - instanceGroupCounter = 0; - l3NetworkCounter = 0; - owningEntityCounter = 0; - pnfCounter = 0; - projectCounter = 0; - serviceInstanceCounter = 0; - serviceProxyCounter = 0; - serviceSubscriptionCounter = 0; - vfModuleCounter = 0; - volumeGroupCounter = 0; - vpnBindingCounter = 0; - vpnBondingLinkCounter = 0; - - execution = new DelegateExecutionImpl(new ExecutionImpl()); - execution.setVariable("testProcessKey", "testProcessKeyValue"); - - gBBInput = new GeneralBuildingBlock(); - execution.setVariable("gBBInput", gBBInput); - - lookupKeyMap = new HashMap<ResourceKey, String>(); - execution.setVariable("lookupKeyMap", lookupKeyMap); - - ExecutionImpl mockExecutionImpl = mock(ExecutionImpl.class); - doReturn("test").when(mockExecutionImpl).getProcessInstanceId(); - - ExecutionImpl executionImpl = new ExecutionImpl(); - executionImpl.setProcessInstance(mockExecutionImpl); - - delegateExecution = (DelegateExecution) executionImpl; - delegateExecution.setVariable("testProcessKey", "testProcessKeyValue"); - } - - public Map<String, String> buildUserInput() { - Map<String, String> userInput = new HashMap<>(); - userInput.put("testUserInputKey", "testUserInputValue"); - - return userInput; - } - - public Map<String, String> setUserInput() { - Map<String, String> userInput = buildUserInput(); - - gBBInput.setUserInput(userInput); - - return userInput; - } - - public RequestContext buildRequestContext() { - RequestContext requestContext = new RequestContext(); - requestContext.setMsoRequestId(UUID.randomUUID().toString()); - requestContext.setProductFamilyId("testProductFamilyId"); - requestContext.setRequestorId("testRequestorId"); - - requestContext.setUserParams(new HashMap<>()); - - Map<String,Object> dataMap = new HashMap<>(); - dataMap.put("vpnId","testVpnId"); - dataMap.put("vpnRegion","testVpnRegion"); - dataMap.put("vpnRt","testVpnRt"); - dataMap.put("vpnName","vpnName"); +public class BuildingBlockTestDataSetup { + private int collectionCounter; + private int configurationCounter; + private int customerCounter; + private int genericVnfCounter; + private int instanceGroupCounter; + private int l3NetworkCounter; + private int owningEntityCounter; + private int pnfCounter; + private int projectCounter; + private int serviceInstanceCounter; + private int serviceProxyCounter; + private int serviceSubscriptionCounter; + private int vfModuleCounter; + private int volumeGroupCounter; + private int vpnBindingCounter; + private int vpnBondingLinkCounter; + + protected BuildingBlockExecution execution; + + protected GeneralBuildingBlock gBBInput; + + protected HashMap<ResourceKey, String> lookupKeyMap; + + protected ExtractPojosForBB extractPojosForBB = new ExtractPojosForBB(); + + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + protected DelegateExecution delegateExecution; + + @Before + public void buildingBlockTestDataSetupBefore() { + collectionCounter = 0; + configurationCounter = 0; + customerCounter = 0; + genericVnfCounter = 0; + instanceGroupCounter = 0; + l3NetworkCounter = 0; + owningEntityCounter = 0; + pnfCounter = 0; + projectCounter = 0; + serviceInstanceCounter = 0; + serviceProxyCounter = 0; + serviceSubscriptionCounter = 0; + vfModuleCounter = 0; + volumeGroupCounter = 0; + vpnBindingCounter = 0; + vpnBondingLinkCounter = 0; + + execution = new DelegateExecutionImpl(new ExecutionImpl()); + execution.setVariable("testProcessKey", "testProcessKeyValue"); + + gBBInput = new GeneralBuildingBlock(); + execution.setVariable("gBBInput", gBBInput); + + lookupKeyMap = new HashMap<ResourceKey, String>(); + execution.setVariable("lookupKeyMap", lookupKeyMap); + + ExecutionImpl mockExecutionImpl = mock(ExecutionImpl.class); + doReturn("test").when(mockExecutionImpl).getProcessInstanceId(); + + ExecutionImpl executionImpl = new ExecutionImpl(); + executionImpl.setProcessInstance(mockExecutionImpl); + + delegateExecution = (DelegateExecution) executionImpl; + delegateExecution.setVariable("testProcessKey", "testProcessKeyValue"); + } + + public Map<String, String> buildUserInput() { + Map<String, String> userInput = new HashMap<>(); + userInput.put("testUserInputKey", "testUserInputValue"); + + return userInput; + } + + public Map<String, String> setUserInput() { + Map<String, String> userInput = buildUserInput(); + + gBBInput.setUserInput(userInput); + + return userInput; + } + + public RequestContext buildRequestContext() { + RequestContext requestContext = new RequestContext(); + requestContext.setMsoRequestId(UUID.randomUUID().toString()); + requestContext.setProductFamilyId("testProductFamilyId"); + requestContext.setRequestorId("testRequestorId"); + + requestContext.setUserParams(new HashMap<>()); + + Map<String, Object> dataMap = new HashMap<>(); + dataMap.put("vpnId", "testVpnId"); + dataMap.put("vpnRegion", "testVpnRegion"); + dataMap.put("vpnRt", "testVpnRt"); + dataMap.put("vpnName", "vpnName"); dataMap.put("vpnRegion", Arrays.asList(new String[] {"USA", "EMEA", "APAC"})); - HashMap<String,Object> userParams = new HashMap<>(); - userParams.put("vpnData",dataMap); + HashMap<String, Object> userParams = new HashMap<>(); + userParams.put("vpnData", dataMap); - List<Map<String,Object>> userParamsList = new ArrayList<>(); - userParamsList.add(userParams); + List<Map<String, Object>> userParamsList = new ArrayList<>(); + userParamsList.add(userParams); - RequestParameters requestParameters = new RequestParameters(); - requestParameters.setUserParams(userParamsList); - requestContext.setRequestParameters(requestParameters); + RequestParameters requestParameters = new RequestParameters(); + requestParameters.setUserParams(userParamsList); + requestContext.setRequestParameters(requestParameters); - return requestContext; - } + return requestContext; + } - public RequestContext setRequestContext() { - RequestContext requestContext = buildRequestContext(); + public RequestContext setRequestContext() { + RequestContext requestContext = buildRequestContext(); - gBBInput.setRequestContext(requestContext); + gBBInput.setRequestContext(requestContext); - return requestContext; - } + return requestContext; + } - public CloudRegion buildCloudRegion() { - CloudRegion cloudRegion = new CloudRegion(); - cloudRegion.setLcpCloudRegionId("testLcpCloudRegionId"); - cloudRegion.setTenantId("testTenantId"); - cloudRegion.setCloudOwner("testCloudOwner"); + public CloudRegion buildCloudRegion() { + CloudRegion cloudRegion = new CloudRegion(); + cloudRegion.setLcpCloudRegionId("testLcpCloudRegionId"); + cloudRegion.setTenantId("testTenantId"); + cloudRegion.setCloudOwner("testCloudOwner"); - return cloudRegion; - } + return cloudRegion; + } - public CloudRegion setCloudRegion() { - CloudRegion cloudRegion = buildCloudRegion(); + public CloudRegion setCloudRegion() { + CloudRegion cloudRegion = buildCloudRegion(); - gBBInput.setCloudRegion(cloudRegion); + gBBInput.setCloudRegion(cloudRegion); - return cloudRegion; - } + return cloudRegion; + } - public OrchestrationContext buildOrchestrationContext() { - OrchestrationContext orchestrationContext = new OrchestrationContext(); + public OrchestrationContext buildOrchestrationContext() { + OrchestrationContext orchestrationContext = new OrchestrationContext(); - return orchestrationContext; - } + return orchestrationContext; + } - public OrchestrationContext setOrchestrationContext() { - OrchestrationContext orchestrationContext = buildOrchestrationContext(); + public OrchestrationContext setOrchestrationContext() { + OrchestrationContext orchestrationContext = buildOrchestrationContext(); - gBBInput.setOrchContext(orchestrationContext); + gBBInput.setOrchContext(orchestrationContext); - return orchestrationContext; - } + return orchestrationContext; + } - public Collection buildCollection() { - collectionCounter++; + public Collection buildCollection() { + collectionCounter++; - Collection collection = new Collection(); - collection.setId("testId" + collectionCounter); - collection.setInstanceGroup(buildInstanceGroup()); + Collection collection = new Collection(); + collection.setId("testId" + collectionCounter); + collection.setInstanceGroup(buildInstanceGroup()); - return collection; - } + return collection; + } - public Configuration buildConfiguration() { - configurationCounter++; + public Configuration buildConfiguration() { + configurationCounter++; - Configuration configuration = new Configuration(); - configuration.setConfigurationId("testConfigurationId" + configurationCounter); - configuration.setConfigurationName("testConfigurationName" + configurationCounter); + Configuration configuration = new Configuration(); + configuration.setConfigurationId("testConfigurationId" + configurationCounter); + configuration.setConfigurationName("testConfigurationName" + configurationCounter); - ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration(); - modelInfoConfiguration.setModelVersionId("testModelVersionId" + configurationCounter); - modelInfoConfiguration.setModelInvariantId("testModelInvariantId" + configurationCounter); - modelInfoConfiguration.setModelCustomizationId("testModelCustomizationId" + configurationCounter); + ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration(); + modelInfoConfiguration.setModelVersionId("testModelVersionId" + configurationCounter); + modelInfoConfiguration.setModelInvariantId("testModelInvariantId" + configurationCounter); + modelInfoConfiguration.setModelCustomizationId("testModelCustomizationId" + configurationCounter); - configuration.setModelInfoConfiguration(modelInfoConfiguration); + configuration.setModelInfoConfiguration(modelInfoConfiguration); - return configuration; - } + return configuration; + } - public OwningEntity buildOwningEntity() { - owningEntityCounter++; + public OwningEntity buildOwningEntity() { + owningEntityCounter++; - OwningEntity owningEntity = new OwningEntity(); - owningEntity.setOwningEntityId("testOwningEntityId" + owningEntityCounter); - owningEntity.setOwningEntityName("testOwningEntityName" + owningEntityCounter); + OwningEntity owningEntity = new OwningEntity(); + owningEntity.setOwningEntityId("testOwningEntityId" + owningEntityCounter); + owningEntity.setOwningEntityName("testOwningEntityName" + owningEntityCounter); - return owningEntity; - } + return owningEntity; + } - public Project buildProject() { - projectCounter++; + public Project buildProject() { + projectCounter++; - Project project = new Project(); - project.setProjectName("testProjectName" + projectCounter); + Project project = new Project(); + project.setProjectName("testProjectName" + projectCounter); - return project; - } + return project; + } - public ServiceSubscription buildServiceSubscription() { - serviceSubscriptionCounter++; + public ServiceSubscription buildServiceSubscription() { + serviceSubscriptionCounter++; - ServiceSubscription serviceSubscription = new ServiceSubscription(); - serviceSubscription.setTempUbSubAccountId("testTempUbSubAccountId" + serviceSubscriptionCounter); - serviceSubscription.setServiceType("testServiceType" + serviceSubscriptionCounter); + ServiceSubscription serviceSubscription = new ServiceSubscription(); + serviceSubscription.setTempUbSubAccountId("testTempUbSubAccountId" + serviceSubscriptionCounter); + serviceSubscription.setServiceType("testServiceType" + serviceSubscriptionCounter); - return serviceSubscription; - } + return serviceSubscription; + } - public Customer buildCustomer() { - customerCounter++; + public Customer buildCustomer() { + customerCounter++; - Customer customer = new Customer(); - customer.setGlobalCustomerId("testGlobalCustomerId" + customerCounter); - customer.setSubscriberType("testSubscriberType" + customerCounter); + Customer customer = new Customer(); + customer.setGlobalCustomerId("testGlobalCustomerId" + customerCounter); + customer.setSubscriberType("testSubscriberType" + customerCounter); - customer.setServiceSubscription(buildServiceSubscription()); + customer.setServiceSubscription(buildServiceSubscription()); - return customer; - } + return customer; + } - public ServiceInstance buildServiceInstance() { - serviceInstanceCounter++; + public ServiceInstance buildServiceInstance() { + serviceInstanceCounter++; - ServiceInstance serviceInstance = new ServiceInstance(); - serviceInstance.setServiceInstanceId("testServiceInstanceId" + serviceInstanceCounter); - serviceInstance.setServiceInstanceName("testServiceInstanceName" + serviceInstanceCounter); + ServiceInstance serviceInstance = new ServiceInstance(); + serviceInstance.setServiceInstanceId("testServiceInstanceId" + serviceInstanceCounter); + serviceInstance.setServiceInstanceName("testServiceInstanceName" + serviceInstanceCounter); - ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance(); - modelInfoServiceInstance.setModelInvariantUuid("testModelInvariantUUID" + serviceInstanceCounter); - modelInfoServiceInstance.setModelUuid("testModelUUID" + serviceInstanceCounter); - modelInfoServiceInstance.setModelVersion("testModelVersion" + serviceInstanceCounter); - modelInfoServiceInstance.setModelName("testModelName" + serviceInstanceCounter); - modelInfoServiceInstance.setServiceType("testServiceType" + serviceInstanceCounter); - serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance); + ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance(); + modelInfoServiceInstance.setModelInvariantUuid("testModelInvariantUUID" + serviceInstanceCounter); + modelInfoServiceInstance.setModelUuid("testModelUUID" + serviceInstanceCounter); + modelInfoServiceInstance.setModelVersion("testModelVersion" + serviceInstanceCounter); + modelInfoServiceInstance.setModelName("testModelName" + serviceInstanceCounter); + modelInfoServiceInstance.setServiceType("testServiceType" + serviceInstanceCounter); + serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance); - serviceInstance.setProject(buildProject()); + serviceInstance.setProject(buildProject()); - serviceInstance.setOwningEntity(buildOwningEntity()); + serviceInstance.setOwningEntity(buildOwningEntity()); - serviceInstance.setCollection(buildCollection()); + serviceInstance.setCollection(buildCollection()); - serviceInstance.getConfigurations().add(buildConfiguration()); + serviceInstance.getConfigurations().add(buildConfiguration()); - return serviceInstance; - } + return serviceInstance; + } - public ServiceInstance setServiceInstance() { - ServiceInstance serviceInstance = buildServiceInstance(); + public ServiceInstance setServiceInstance() { + ServiceInstance serviceInstance = buildServiceInstance(); - if(gBBInput.getCustomer() == null) { - gBBInput.setCustomer(buildCustomer()); - } - gBBInput.getCustomer().getServiceSubscription().getServiceInstances().add(serviceInstance); - lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstance.getServiceInstanceId()); + if (gBBInput.getCustomer() == null) { + gBBInput.setCustomer(buildCustomer()); + } + gBBInput.getCustomer().getServiceSubscription().getServiceInstances().add(serviceInstance); + lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstance.getServiceInstanceId()); - return serviceInstance; - } + return serviceInstance; + } - public Customer setCustomer() { - if(gBBInput.getCustomer() != null) return gBBInput.getCustomer(); - Customer customer = new Customer(); - customer.setGlobalCustomerId("testGlobalCustomerId"); - customer.setSubscriberType("testSubscriberType"); + public Customer setCustomer() { + if (gBBInput.getCustomer() != null) + return gBBInput.getCustomer(); + Customer customer = new Customer(); + customer.setGlobalCustomerId("testGlobalCustomerId"); + customer.setSubscriberType("testSubscriberType"); - customer.setServiceSubscription(buildServiceSubscription()); + customer.setServiceSubscription(buildServiceSubscription()); - gBBInput.setCustomer(customer); + gBBInput.setCustomer(customer); - return customer; - } + return customer; + } - public Collection setCollection() { - Collection collection = new Collection(); - collection.setId("testId"); + public Collection setCollection() { + Collection collection = new Collection(); + collection.setId("testId"); - ServiceInstance serviceInstance = null; + ServiceInstance serviceInstance = null; - try { - serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); - } catch(BBObjectNotFoundException e) { - serviceInstance = setServiceInstance(); - } + try { + serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); + } catch (BBObjectNotFoundException e) { + serviceInstance = setServiceInstance(); + } - serviceInstance.setCollection(collection); + serviceInstance.setCollection(collection); - return collection; - } + return collection; + } - public InstanceGroup setInstanceGroup() { - InstanceGroup instanceGroup = new InstanceGroup(); - instanceGroup.setId("testId"); - instanceGroup.setInstanceGroupFunction("testInstanceGroupFunction"); + public InstanceGroup setInstanceGroup() { + InstanceGroup instanceGroup = new InstanceGroup(); + instanceGroup.setId("testId"); + instanceGroup.setInstanceGroupFunction("testInstanceGroupFunction"); - Collection collection = null; + Collection collection = null; - try { - ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); - collection = serviceInstance.getCollection(); + try { + ServiceInstance serviceInstance = + extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); + collection = serviceInstance.getCollection(); - if (collection == null) { - collection = setCollection(); - } - } catch(BBObjectNotFoundException e) { - collection = setCollection(); - } + if (collection == null) { + collection = setCollection(); + } + } catch (BBObjectNotFoundException e) { + collection = setCollection(); + } - collection.setInstanceGroup(instanceGroup); + collection.setInstanceGroup(instanceGroup); - return instanceGroup; - } + return instanceGroup; + } - public VpnBinding buildVpnBinding() { - vpnBindingCounter++; + public VpnBinding buildVpnBinding() { + vpnBindingCounter++; - VpnBinding vpnBinding = new VpnBinding(); - vpnBinding.setVpnId("testVpnId" + vpnBindingCounter); - vpnBinding.setVpnName("testVpnName" + vpnBindingCounter); - vpnBinding.setCustomerVpnId("testCustomerVpnId" + vpnBindingCounter); + VpnBinding vpnBinding = new VpnBinding(); + vpnBinding.setVpnId("testVpnId" + vpnBindingCounter); + vpnBinding.setVpnName("testVpnName" + vpnBindingCounter); + vpnBinding.setCustomerVpnId("testCustomerVpnId" + vpnBindingCounter); - return vpnBinding; - } + return vpnBinding; + } - public VpnBinding setVpnBinding() { - VpnBinding vpnBinding = buildVpnBinding(); + public VpnBinding setVpnBinding() { + VpnBinding vpnBinding = buildVpnBinding(); - Customer customer = gBBInput.getCustomer(); + Customer customer = gBBInput.getCustomer(); - if(customer == null){ - customer = buildCustomer(); - } + if (customer == null) { + customer = buildCustomer(); + } - customer.getVpnBindings().add(vpnBinding); - lookupKeyMap.put(ResourceKey.VPN_ID, vpnBinding.getVpnId()); + customer.getVpnBindings().add(vpnBinding); + lookupKeyMap.put(ResourceKey.VPN_ID, vpnBinding.getVpnId()); - return vpnBinding; - } + return vpnBinding; + } - public InstanceGroup buildInstanceGroup() { - instanceGroupCounter++; + public InstanceGroup buildInstanceGroup() { + instanceGroupCounter++; - InstanceGroup instanceGroup = new InstanceGroup(); - instanceGroup.setId("testId" + instanceGroupCounter); - instanceGroup.setInstanceGroupFunction("testInstanceGroupFunction" + instanceGroupCounter); + InstanceGroup instanceGroup = new InstanceGroup(); + instanceGroup.setId("testId" + instanceGroupCounter); + instanceGroup.setInstanceGroupFunction("testInstanceGroupFunction" + instanceGroupCounter); - return instanceGroup; - } + return instanceGroup; + } - public L3Network buildL3Network() { - l3NetworkCounter++; + public L3Network buildL3Network() { + l3NetworkCounter++; - L3Network network = new L3Network(); - network.setNetworkId("testNetworkId" + l3NetworkCounter); - network.setNetworkName("testNetworkName" + l3NetworkCounter); - network.setNetworkType("testNetworkType" + l3NetworkCounter); + L3Network network = new L3Network(); + network.setNetworkId("testNetworkId" + l3NetworkCounter); + network.setNetworkName("testNetworkName" + l3NetworkCounter); + network.setNetworkType("testNetworkType" + l3NetworkCounter); - ModelInfoNetwork modelInfoNetwork = new ModelInfoNetwork(); - modelInfoNetwork.setModelInvariantUUID("testModelInvariantUUID" + l3NetworkCounter); - modelInfoNetwork.setModelName("testModelName" + l3NetworkCounter); - modelInfoNetwork.setModelVersion("testModelVersion" + l3NetworkCounter); - modelInfoNetwork.setModelUUID("testModelUUID" + l3NetworkCounter); - network.setModelInfoNetwork(modelInfoNetwork); + ModelInfoNetwork modelInfoNetwork = new ModelInfoNetwork(); + modelInfoNetwork.setModelInvariantUUID("testModelInvariantUUID" + l3NetworkCounter); + modelInfoNetwork.setModelName("testModelName" + l3NetworkCounter); + modelInfoNetwork.setModelVersion("testModelVersion" + l3NetworkCounter); + modelInfoNetwork.setModelUUID("testModelUUID" + l3NetworkCounter); + network.setModelInfoNetwork(modelInfoNetwork); - return network; - } + return network; + } - public L3Network setL3Network() { - L3Network network = buildL3Network(); + public L3Network setL3Network() { + L3Network network = buildL3Network(); - ServiceInstance serviceInstance = null; + ServiceInstance serviceInstance = null; - try { - serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); - } catch(BBObjectNotFoundException e) { - serviceInstance = setServiceInstance(); - } + try { + serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); + } catch (BBObjectNotFoundException e) { + serviceInstance = setServiceInstance(); + } - serviceInstance.getNetworks().add(network); - lookupKeyMap.put(ResourceKey.NETWORK_ID, network.getNetworkId()); + serviceInstance.getNetworks().add(network); + lookupKeyMap.put(ResourceKey.NETWORK_ID, network.getNetworkId()); - return network; - } + return network; + } - public GenericVnf buildGenericVnf() { - genericVnfCounter++; + public GenericVnf buildGenericVnf() { + genericVnfCounter++; - GenericVnf genericVnf = new GenericVnf(); - genericVnf.setVnfId("testVnfId" + genericVnfCounter); - genericVnf.setVnfName("testVnfName" + genericVnfCounter); - genericVnf.setVnfType("testVnfType" + genericVnfCounter); + GenericVnf genericVnf = new GenericVnf(); + genericVnf.setVnfId("testVnfId" + genericVnfCounter); + genericVnf.setVnfName("testVnfName" + genericVnfCounter); + genericVnf.setVnfType("testVnfType" + genericVnfCounter); - Platform platform = new Platform(); - platform.setPlatformName("testPlatformName"); - genericVnf.setPlatform(platform); + Platform platform = new Platform(); + platform.setPlatformName("testPlatformName"); + genericVnf.setPlatform(platform); - LineOfBusiness lob = new LineOfBusiness(); - lob.setLineOfBusinessName("testLineOfBusinessName"); - genericVnf.setLineOfBusiness(lob); + LineOfBusiness lob = new LineOfBusiness(); + lob.setLineOfBusinessName("testLineOfBusinessName"); + genericVnf.setLineOfBusiness(lob); - ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf(); - modelInfoGenericVnf.setModelName("testModelName" + genericVnfCounter); - modelInfoGenericVnf.setModelCustomizationUuid("testModelCustomizationUUID" + genericVnfCounter); - modelInfoGenericVnf.setModelInvariantUuid("testModelInvariantUUID" + genericVnfCounter); - modelInfoGenericVnf.setModelVersion("testModelVersion" + genericVnfCounter); - modelInfoGenericVnf.setModelUuid("testModelUUID" + genericVnfCounter); - modelInfoGenericVnf.setModelInstanceName("testModelInstanceName" + genericVnfCounter); - genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf); + ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf(); + modelInfoGenericVnf.setModelName("testModelName" + genericVnfCounter); + modelInfoGenericVnf.setModelCustomizationUuid("testModelCustomizationUUID" + genericVnfCounter); + modelInfoGenericVnf.setModelInvariantUuid("testModelInvariantUUID" + genericVnfCounter); + modelInfoGenericVnf.setModelVersion("testModelVersion" + genericVnfCounter); + modelInfoGenericVnf.setModelUuid("testModelUUID" + genericVnfCounter); + modelInfoGenericVnf.setModelInstanceName("testModelInstanceName" + genericVnfCounter); + genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf); - return genericVnf; - } + return genericVnf; + } - public GenericVnf setGenericVnf() { - GenericVnf genericVnf = buildGenericVnf(); + public GenericVnf setGenericVnf() { + GenericVnf genericVnf = buildGenericVnf(); - ServiceInstance serviceInstance = null; + ServiceInstance serviceInstance = null; - try { - serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); - } catch(BBObjectNotFoundException e) { - serviceInstance = setServiceInstance(); - } + try { + serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); + } catch (BBObjectNotFoundException e) { + serviceInstance = setServiceInstance(); + } - serviceInstance.getVnfs().add(genericVnf); - lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, genericVnf.getVnfId()); + serviceInstance.getVnfs().add(genericVnf); + lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, genericVnf.getVnfId()); - return genericVnf; - } + return genericVnf; + } - public VfModule buildVfModule() { - vfModuleCounter++; + public VfModule buildVfModule() { + vfModuleCounter++; - VfModule vfModule = new VfModule(); - vfModule.setVfModuleId("testVfModuleId" + vfModuleCounter); - vfModule.setVfModuleName("testVfModuleName" + vfModuleCounter); + VfModule vfModule = new VfModule(); + vfModule.setVfModuleId("testVfModuleId" + vfModuleCounter); + vfModule.setVfModuleName("testVfModuleName" + vfModuleCounter); - ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule(); - modelInfoVfModule.setModelInvariantUUID("testModelInvariantUUID" + vfModuleCounter); - modelInfoVfModule.setModelVersion("testModelVersion" + vfModuleCounter); - modelInfoVfModule.setModelUUID("testModelUUID" + vfModuleCounter); - modelInfoVfModule.setModelName("testModelName" + vfModuleCounter); - modelInfoVfModule.setModelCustomizationUUID("testModelCustomizationUUID" + vfModuleCounter); - vfModule.setModelInfoVfModule(modelInfoVfModule); + ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule(); + modelInfoVfModule.setModelInvariantUUID("testModelInvariantUUID" + vfModuleCounter); + modelInfoVfModule.setModelVersion("testModelVersion" + vfModuleCounter); + modelInfoVfModule.setModelUUID("testModelUUID" + vfModuleCounter); + modelInfoVfModule.setModelName("testModelName" + vfModuleCounter); + modelInfoVfModule.setModelCustomizationUUID("testModelCustomizationUUID" + vfModuleCounter); + vfModule.setModelInfoVfModule(modelInfoVfModule); - return vfModule; - } + return vfModule; + } - public VfModule setVfModule() { - VfModule vfModule = buildVfModule(); + public VfModule setVfModule() { + VfModule vfModule = buildVfModule(); - GenericVnf genericVnf = null; + GenericVnf genericVnf = null; - try { - genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID)); - } catch(BBObjectNotFoundException e) { - genericVnf = setGenericVnf(); - } + try { + genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); + } catch (BBObjectNotFoundException e) { + genericVnf = setGenericVnf(); + } - genericVnf.getVfModules().add(vfModule); - lookupKeyMap.put(ResourceKey.VF_MODULE_ID, vfModule.getVfModuleId()); + genericVnf.getVfModules().add(vfModule); + lookupKeyMap.put(ResourceKey.VF_MODULE_ID, vfModule.getVfModuleId()); - return vfModule; - } + return vfModule; + } - public VolumeGroup buildVolumeGroup() { - volumeGroupCounter++; + public VolumeGroup buildVolumeGroup() { + volumeGroupCounter++; - VolumeGroup volumeGroup = new VolumeGroup(); - volumeGroup.setVolumeGroupId("testVolumeGroupId" + volumeGroupCounter); - volumeGroup.setVolumeGroupName("testVolumeGroupName" + volumeGroupCounter); - volumeGroup.setHeatStackId("testHeatStackId" + volumeGroupCounter); + VolumeGroup volumeGroup = new VolumeGroup(); + volumeGroup.setVolumeGroupId("testVolumeGroupId" + volumeGroupCounter); + volumeGroup.setVolumeGroupName("testVolumeGroupName" + volumeGroupCounter); + volumeGroup.setHeatStackId("testHeatStackId" + volumeGroupCounter); - return volumeGroup; - } + return volumeGroup; + } - public VolumeGroup setVolumeGroup() { - VolumeGroup volumeGroup = buildVolumeGroup(); + public VolumeGroup setVolumeGroup() { + VolumeGroup volumeGroup = buildVolumeGroup(); - GenericVnf genericVnf = null; + GenericVnf genericVnf = null; - try { - genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID)); - } catch(BBObjectNotFoundException e) { - genericVnf = setGenericVnf(); - } + try { + genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); + } catch (BBObjectNotFoundException e) { + genericVnf = setGenericVnf(); + } - genericVnf.getVolumeGroups().add(volumeGroup); - lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, volumeGroup.getVolumeGroupId()); + genericVnf.getVolumeGroups().add(volumeGroup); + lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, volumeGroup.getVolumeGroupId()); - return volumeGroup; - } + return volumeGroup; + } - public Pnf buildPnf() { - pnfCounter++; + public Pnf buildPnf() { + pnfCounter++; - Pnf pnf = new Pnf(); - pnf.setPnfId("testPnfId" + pnfCounter); - pnf.setPnfName("testPnfName" + pnfCounter); + Pnf pnf = new Pnf(); + pnf.setPnfId("testPnfId" + pnfCounter); + pnf.setPnfName("testPnfName" + pnfCounter); - return pnf; - } + return pnf; + } - public ServiceProxy buildServiceProxy() { - serviceProxyCounter++; + public ServiceProxy buildServiceProxy() { + serviceProxyCounter++; ServiceProxy serviceProxy = new ServiceProxy(); serviceProxy.setServiceInstance(buildServiceInstance()); @@ -587,83 +586,83 @@ public class BuildingBlockTestDataSetup{ serviceProxy.getServiceInstance().getPnfs().add(secondaryPnf); return serviceProxy; - } + } - public VpnBondingLink buildVpnBondingLink() { - vpnBondingLinkCounter++; + public VpnBondingLink buildVpnBondingLink() { + vpnBondingLinkCounter++; - VpnBondingLink vpnBondingLink = new VpnBondingLink(); - vpnBondingLink.setVpnBondingLinkId("testVpnBondingLinkId" + vpnBondingLinkCounter); + VpnBondingLink vpnBondingLink = new VpnBondingLink(); + vpnBondingLink.setVpnBondingLinkId("testVpnBondingLinkId" + vpnBondingLinkCounter); - Configuration vnrConfiguration = buildConfiguration(); - vnrConfiguration.setNetwork(buildL3Network()); - vpnBondingLink.setVnrConfiguration(vnrConfiguration); + Configuration vnrConfiguration = buildConfiguration(); + vnrConfiguration.setNetwork(buildL3Network()); + vpnBondingLink.setVnrConfiguration(vnrConfiguration); - vpnBondingLink.setVrfConfiguration(buildConfiguration()); + vpnBondingLink.setVrfConfiguration(buildConfiguration()); vpnBondingLink.setInfrastructureServiceProxy(buildServiceProxy()); vpnBondingLink.setTransportServiceProxy(buildServiceProxy()); - return vpnBondingLink; - } + return vpnBondingLink; + } - public VpnBondingLink setVpnBondingLink() { - VpnBondingLink vpnBondingLink = buildVpnBondingLink(); + public VpnBondingLink setVpnBondingLink() { + VpnBondingLink vpnBondingLink = buildVpnBondingLink(); - ServiceInstance serviceInstance = null; + ServiceInstance serviceInstance = null; - try { - serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); - } catch(BBObjectNotFoundException e) { - serviceInstance = setServiceInstance(); - } + try { + serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); + } catch (BBObjectNotFoundException e) { + serviceInstance = setServiceInstance(); + } - serviceInstance.getVpnBondingLinks().add(vpnBondingLink); - lookupKeyMap.put(ResourceKey.VPN_BONDING_LINK_ID, vpnBondingLink.getVpnBondingLinkId()); + serviceInstance.getVpnBondingLinks().add(vpnBondingLink); + lookupKeyMap.put(ResourceKey.VPN_BONDING_LINK_ID, vpnBondingLink.getVpnBondingLinkId()); - return vpnBondingLink; - } + return vpnBondingLink; + } - public Customer setAvpnCustomer() { - Customer customer = buildCustomer(); + public Customer setAvpnCustomer() { + Customer customer = buildCustomer(); - gBBInput.setCustomer(customer); + gBBInput.setCustomer(customer); - return customer; - } + return customer; + } - public ServiceProxy setServiceProxy(String uniqueIdentifier, String type) { - ServiceProxy serviceProxy = new ServiceProxy(); - serviceProxy.setId("testProxyId" + uniqueIdentifier); - serviceProxy.setType(type); + public ServiceProxy setServiceProxy(String uniqueIdentifier, String type) { + ServiceProxy serviceProxy = new ServiceProxy(); + serviceProxy.setId("testProxyId" + uniqueIdentifier); + serviceProxy.setType(type); - ModelInfoServiceProxy modelInfo = new ModelInfoServiceProxy(); - modelInfo.setModelInvariantUuid("testProxyModelInvariantUuid" + uniqueIdentifier); - modelInfo.setModelName("testProxyModelName" + uniqueIdentifier); - modelInfo.setModelUuid("testProxyModelUuid" + uniqueIdentifier); - modelInfo.setModelVersion("testProxyModelVersion" + uniqueIdentifier); - modelInfo.setModelInstanceName("testProxyModelInstanceName" + uniqueIdentifier); + ModelInfoServiceProxy modelInfo = new ModelInfoServiceProxy(); + modelInfo.setModelInvariantUuid("testProxyModelInvariantUuid" + uniqueIdentifier); + modelInfo.setModelName("testProxyModelName" + uniqueIdentifier); + modelInfo.setModelUuid("testProxyModelUuid" + uniqueIdentifier); + modelInfo.setModelVersion("testProxyModelVersion" + uniqueIdentifier); + modelInfo.setModelInstanceName("testProxyModelInstanceName" + uniqueIdentifier); - serviceProxy.setModelInfoServiceProxy(modelInfo); + serviceProxy.setModelInfoServiceProxy(modelInfo); - return serviceProxy; - } + return serviceProxy; + } - public AllottedResource setAllottedResource(String uniqueIdentifier) { - AllottedResource ar = new AllottedResource(); - ar.setId("testAllottedResourceId" + uniqueIdentifier); + public AllottedResource setAllottedResource(String uniqueIdentifier) { + AllottedResource ar = new AllottedResource(); + ar.setId("testAllottedResourceId" + uniqueIdentifier); - ModelInfoAllottedResource modelInfo = new ModelInfoAllottedResource(); - modelInfo.setModelInvariantUuid("testAllottedModelInvariantUuid" + uniqueIdentifier); - modelInfo.setModelName("testAllottedModelName" + uniqueIdentifier); - modelInfo.setModelUuid("testAllottedModelUuid" + uniqueIdentifier); - modelInfo.setModelVersion("testAllottedModelVersion" + uniqueIdentifier); - modelInfo.setModelInstanceName("testAllottedModelInstanceName" + uniqueIdentifier); + ModelInfoAllottedResource modelInfo = new ModelInfoAllottedResource(); + modelInfo.setModelInvariantUuid("testAllottedModelInvariantUuid" + uniqueIdentifier); + modelInfo.setModelName("testAllottedModelName" + uniqueIdentifier); + modelInfo.setModelUuid("testAllottedModelUuid" + uniqueIdentifier); + modelInfo.setModelVersion("testAllottedModelVersion" + uniqueIdentifier); + modelInfo.setModelInstanceName("testAllottedModelInstanceName" + uniqueIdentifier); - ar.setModelInfoAllottedResource(modelInfo); + ar.setModelInfoAllottedResource(modelInfo); - return ar; - } -}
\ No newline at end of file + return ar; + } +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java index fb08e5e830..62d9ecee44 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java @@ -19,6 +19,7 @@ */ package org.onap.so; + import ch.vorburger.exec.ManagedProcessException; import ch.vorburger.mariadb4j.DBConfigurationBuilder; import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService; @@ -35,30 +36,25 @@ public class EmbeddedMariaDbConfig { @Bean MariaDB4jSpringService mariaDB4jSpringService() { - MariaDB4jSpringService service = new MariaDB4jSpringService(); - - - service.getConfiguration().addArg("--lower_case_table_names=1"); + MariaDB4jSpringService service = new MariaDB4jSpringService(); + + + service.getConfiguration().addArg("--lower_case_table_names=1"); return service; } @Bean DataSource dataSource(MariaDB4jSpringService mariaDB4jSpringService, - @Value("${mariaDB4j.databaseName}") String databaseName, - @Value("${spring.datasource.username}") String datasourceUsername, - @Value("${spring.datasource.password}") String datasourcePassword, - @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException { - //Create our database with default root user and no password + @Value("${mariaDB4j.databaseName}") String databaseName, + @Value("${spring.datasource.username}") String datasourceUsername, + @Value("${spring.datasource.password}") String datasourcePassword, + @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException { + // Create our database with default root user and no password mariaDB4jSpringService.getDB().createDB(databaseName); DBConfigurationBuilder config = mariaDB4jSpringService.getConfiguration(); - return DataSourceBuilder - .create() - .username(datasourceUsername) - .password(datasourcePassword) - .url(config.getURL(databaseName)) - .driverClassName(datasourceDriver) - .build(); + return DataSourceBuilder.create().username(datasourceUsername).password(datasourcePassword) + .url(config.getURL(databaseName)).driverClassName(datasourceDriver).build(); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/MockLoggerDelegate.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/MockLoggerDelegate.java index 5d4d923426..7b049c63e3 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/MockLoggerDelegate.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/MockLoggerDelegate.java @@ -24,12 +24,12 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; public class MockLoggerDelegate implements JavaDelegate { - @Override - public void execute(DelegateExecution execution) throws Exception { - System.out.println("\n\n ..." + MockLoggerDelegate.class.getName() + " invoked by " + "processDefinitionId=" - + execution.getProcessDefinitionId() + ", activtyId=" + execution.getCurrentActivityId() - + ", activtyName='" + execution.getCurrentActivityName() + "'" + ", processInstanceId=" - + execution.getProcessInstanceId() + ", businessKey=" + execution.getProcessBusinessKey() - + ", executionId=" + execution.getId() + " \n\n"); - } + @Override + public void execute(DelegateExecution execution) throws Exception { + System.out.println("\n\n ..." + MockLoggerDelegate.class.getName() + " invoked by " + "processDefinitionId=" + + execution.getProcessDefinitionId() + ", activtyId=" + execution.getCurrentActivityId() + + ", activtyName='" + execution.getCurrentActivityName() + "'" + ", processInstanceId=" + + execution.getProcessInstanceId() + ", businessKey=" + execution.getProcessBusinessKey() + + ", executionId=" + execution.getId() + " \n\n"); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java index 97c17d5238..47ddea1b4f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java @@ -29,78 +29,65 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -public final class SerializableChecker -{ - public static class SerializationFailure - { +public final class SerializableChecker { + public static class SerializationFailure { private final String mContainingClass; private final String mMemberName; - public SerializationFailure(String inNonSerializableClass, String inMemberName) - { + public SerializationFailure(String inNonSerializableClass, String inMemberName) { mContainingClass = inNonSerializableClass; mMemberName = inMemberName; } - public String getContainingClass() - { + public String getContainingClass() { return mContainingClass; } - public String getMemberName() - { + public String getMemberName() { return mMemberName; } - public String getBadMemberString() - { + public String getBadMemberString() { if (mMemberName == null) return mContainingClass; return mContainingClass + "." + mMemberName; } @Override - public String toString() - { - return "SerializationFailure [mNonSerializableClass=" + mContainingClass + ", mMemberName=" + mMemberName + "]"; + public String toString() { + return "SerializationFailure [mNonSerializableClass=" + mContainingClass + ", mMemberName=" + mMemberName + + "]"; } } - private static class SerializationCheckerData - { + private static class SerializationCheckerData { private Set<Class<?>> mSerializableClasses; - SerializationCheckerData() - { + SerializationCheckerData() { mSerializableClasses = new HashSet<Class<?>>(); } - boolean isAlreadyChecked(Class<?> inClass) - { + boolean isAlreadyChecked(Class<?> inClass) { return mSerializableClasses.contains(inClass); } - void addSerializableClass(Class<?> inClass) - { + void addSerializableClass(Class<?> inClass) { mSerializableClasses.add(inClass); } } - private SerializableChecker() - { } + private SerializableChecker() {} - public static SerializationFailure isFullySerializable(Class<?> inClass) - { + public static SerializationFailure isFullySerializable(Class<?> inClass) { if (!isSerializable(inClass)) return new SerializationFailure(inClass.getName(), null); return isFullySerializable(inClass, new SerializationCheckerData()); } - private static SerializationFailure isFullySerializable(Class<?> inClass, SerializationCheckerData inSerializationCheckerData) - { - for (Field field : declaredFields(inClass)) - { + private static SerializationFailure isFullySerializable(Class<?> inClass, + SerializationCheckerData inSerializationCheckerData) { + for (Field field : declaredFields(inClass)) { Class<?> fieldDeclaringClass = field.getType(); if (field.getType() == Object.class) @@ -121,8 +108,7 @@ public final class SerializableChecker if (inSerializationCheckerData.isAlreadyChecked(fieldDeclaringClass)) continue; - if (isSerializable(fieldDeclaringClass)) - { + if (isSerializable(fieldDeclaringClass)) { inSerializationCheckerData.addSerializableClass(inClass); SerializationFailure failure = isFullySerializable(field.getType(), inSerializationCheckerData); @@ -140,8 +126,7 @@ public final class SerializableChecker return null; } - private static boolean isSerializable(Class<?> inClass) - { + private static boolean isSerializable(Class<?> inClass) { Set<Class<?>> interfaces = getInterfaces(inClass); if (interfaces == null) return false; @@ -149,8 +134,7 @@ public final class SerializableChecker if (isSerializable) return true; - for (Class<?> classInterface : interfaces) - { + for (Class<?> classInterface : interfaces) { if (isSerializable(classInterface)) return true; } @@ -161,13 +145,11 @@ public final class SerializableChecker return false; } - private static Set<Class<?>> getInterfaces(Class<?> inFieldDeclaringClass) - { + private static Set<Class<?>> getInterfaces(Class<?> inFieldDeclaringClass) { return new HashSet<Class<?>>(Arrays.asList(inFieldDeclaringClass.getInterfaces())); } - private static List<Field> declaredFields(Class<?> inClass) - { + private static List<Field> declaredFields(Class<?> inClass) { List<Field> fields = new ArrayList<Field>(Arrays.asList(inClass.getDeclaredFields())); Class<?> parentClasses = inClass.getSuperclass(); @@ -177,5 +159,5 @@ public final class SerializableChecker fields.addAll(declaredFields(parentClasses)); return fields; - } } +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/TestApplication.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/TestApplication.java index 11309914ef..029b77319b 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/TestApplication.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/TestApplication.java @@ -30,14 +30,14 @@ import org.springframework.context.annotation.Profile; @SpringBootApplication @Profile("test") -@ComponentScan(basePackages = {"org.onap.so"}, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class, excludeFilters = { - @Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)}) +@ComponentScan(basePackages = {"org.onap.so"}, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class, + excludeFilters = {@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)}) public class TestApplication { - public static void main(String... args) { - SpringApplication.run(TestApplication.class, args); - System.getProperties().setProperty("mso.db", "MARIADB"); - System.getProperties().setProperty("server.name", "Springboot"); - - - } + public static void main(String... args) { + SpringApplication.run(TestApplication.class, args); + System.getProperties().setProperty("mso.db", "MARIADB"); + System.getProperties().setProperty("server.name", "Springboot"); + + + } } 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 deb985c62b..2a0fef0caa 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 @@ -94,217 +94,209 @@ import org.springframework.test.context.junit4.SpringRunner; @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public abstract class BaseBPMNTest { - @Autowired - protected RuntimeService runtimeService; + @Autowired + protected RuntimeService runtimeService; - @Autowired - protected ExternalTaskService externalTaskService; - - @Autowired - private RepositoryService repositoryService; + @Autowired + protected ExternalTaskService externalTaskService; - protected Map<String, Object> variables = new HashMap<>(); + @Autowired + private RepositoryService repositoryService; - protected List<String> mockedSubprocessList = new ArrayList<>(); + protected Map<String, Object> variables = new HashMap<>(); - protected TestRestTemplate restTemplate = new TestRestTemplate(); + protected List<String> mockedSubprocessList = new ArrayList<>(); - protected HttpHeaders headers = new HttpHeaders(); + protected TestRestTemplate restTemplate = new TestRestTemplate(); - @MockBean - protected AAIUpdateTasks aaiUpdateTasks; + protected HttpHeaders headers = new HttpHeaders(); - @MockBean - protected AAICreateTasks aaiCreateTasks; + @MockBean + protected AAIUpdateTasks aaiUpdateTasks; - @MockBean - protected AAIQueryTasks aaiQueryTasks; + @MockBean + protected AAICreateTasks aaiCreateTasks; - @MockBean - protected AAIDeleteTasks aaiDeleteTasks; + @MockBean + protected AAIQueryTasks aaiQueryTasks; - @MockBean - protected AAIFlagTasks aaiFlagTasks; + @MockBean + protected AAIDeleteTasks aaiDeleteTasks; + @MockBean + protected AAIFlagTasks aaiFlagTasks; - @MockBean - protected AppcRunTasks appcRunTasks; - @MockBean - protected SDNCActivateTasks sdncActivateTasks; + @MockBean + protected AppcRunTasks appcRunTasks; - @MockBean - protected SDNCAssignTasks sdncAssignTasks; + @MockBean + protected SDNCActivateTasks sdncActivateTasks; - @MockBean - protected SDNCUnassignTasks sdncUnassignTasks; + @MockBean + protected SDNCAssignTasks sdncAssignTasks; - @MockBean - protected SDNCDeactivateTasks sdncDeactivateTasks; + @MockBean + protected SDNCUnassignTasks sdncUnassignTasks; - @MockBean - protected SDNCQueryTasks sdncQueryTasks; + @MockBean + protected SDNCDeactivateTasks sdncDeactivateTasks; - @MockBean - protected SDNCChangeAssignTasks sdncChangeAssignTasks; + @MockBean + protected SDNCQueryTasks sdncQueryTasks; - @MockBean - protected NetworkAdapterDeleteTasks networkAdapterDeleteTasks; + @MockBean + protected SDNCChangeAssignTasks sdncChangeAssignTasks; - @MockBean - protected NetworkAdapterUpdateTasks networkAdapterUpdateTasks; + @MockBean + protected NetworkAdapterDeleteTasks networkAdapterDeleteTasks; - @MockBean - protected VnfAdapterCreateTasks vnfAdapterCreateTasks; + @MockBean + protected NetworkAdapterUpdateTasks networkAdapterUpdateTasks; - @MockBean - protected NetworkAdapterCreateTasks networkAdapterCreateTasks; + @MockBean + protected VnfAdapterCreateTasks vnfAdapterCreateTasks; - @MockBean - protected CreateNetwork createNetwork; + @MockBean + protected NetworkAdapterCreateTasks networkAdapterCreateTasks; - @MockBean - protected AssignNetworkBBUtils assignNetworkBBUtils; + @MockBean + protected CreateNetwork createNetwork; - @MockBean - protected AssignNetwork assignNetwork; + @MockBean + protected AssignNetworkBBUtils assignNetworkBBUtils; - @MockBean - protected CreateNetworkCollection createNetworkCollection; + @MockBean + protected AssignNetwork assignNetwork; - @MockBean - protected VnfAdapterDeleteTasks vnfAdapterDeleteTasks; + @MockBean + protected CreateNetworkCollection createNetworkCollection; - @MockBean - protected AAICommonTasks aaiCommonTasks; + @MockBean + protected VnfAdapterDeleteTasks vnfAdapterDeleteTasks; - @MockBean - protected ActivateVfModule activateVfModule; - - @MockBean - protected AssignVnf assignVnf; + @MockBean + protected AAICommonTasks aaiCommonTasks; - @MockBean - protected UnassignVnf unassignVnf; + @MockBean + protected ActivateVfModule activateVfModule; - @MockBean - protected VnfAdapterImpl vnfAdapterImpl; + @MockBean + protected AssignVnf assignVnf; - @MockBean - protected UnassignNetworkBB unassignNetworkBB; + @MockBean + protected UnassignVnf unassignVnf; - @MockBean - protected OrchestrationStatusValidator orchestrationStatusValidator; + @MockBean + protected VnfAdapterImpl vnfAdapterImpl; - @MockBean - protected BBInputSetup bbInputSetup; + @MockBean + protected UnassignNetworkBB unassignNetworkBB; - @MockBean - protected BBInputSetupUtils bbInputSetupUtils; + @MockBean + protected OrchestrationStatusValidator orchestrationStatusValidator; - @MockBean - protected ExecuteBuildingBlockRainyDay executeBuildingBlockRainyDay; + @MockBean + protected BBInputSetup bbInputSetup; - @MockBean - protected WorkflowAction workflowAction; - - @MockBean - protected WorkflowActionBBTasks workflowActionBBTasks; - - @MockBean - protected GenericVnfHealthCheck genericVnfHealthCheck; - - @MockBean - protected ConfigurationScaleOut configurationScaleOut; - - @MockBean - protected FlowCompletionTasks flowCompletionTasks; - - @MockBean - protected BuildingBlockValidatorRunner buildingBlockValidatorRunner; - - @MockBean - protected SDNOHealthCheckTasks sdnoHealthCheckTasks; - - @MockBean - protected SDNCClient sdncClient; - - @MockBean - protected SniroHomingV2 sniroHoming; - - @MockBean - protected NamingServiceDeleteTasks namingServiceDeleteTasks; - - @MockBean - protected NamingServiceCreateTasks namingServiceCreateTasks; - - @MockBean - protected WorkflowActionBBFailure workflowActionBBFailure; - - @MockBean - protected AuditTasks auditTasks; - - @MockBean - protected ManualHandlingTasks manualHandlingTasks; - - @LocalServerPort - protected int port; - - protected String createURLWithPort(String uri) { - return "http://localhost:" + port + uri; - } - - @Before - public void baseBefore() { - variables.put("gBuildingBlockExecution", new DelegateExecutionImpl(new HashMap<>())); - } - - @After - public void baseAfter() { - for (String deploymentId : mockedSubprocessList) { - repositoryService.deleteDeployment(deploymentId); - } - mockedSubprocessList.clear(); - } - - /** - * Create and deploy a process model with one logger delegate as service task. - * - * @param origProcessKey - * key to call - * @param mockProcessName - * process name - * @param fileName - * file name without extension - */ - protected void mockSubprocess(String origProcessKey, String mockProcessName, String fileName) { - mockSubprocess(origProcessKey, mockProcessName, fileName, new HashMap<String, String>()); - } - - /** - * Create and deploy a process model with one logger delegate as service task. - * - * @param origProcessKey - * key to call - * @param mockProcessName - * process name - * @param fileName - * file name without extension - * @param outParam - * output parameters - */ - protected void mockSubprocess(String origProcessKey, String mockProcessName, String fileName, Map<String, String> outParam) { - ServiceTaskBuilder builder = Bpmn - .createExecutableProcess(origProcessKey).name(mockProcessName) - .startEvent().name("Start_Event") - .serviceTask().name("Mock_Delegate") - .camundaClass(FluentJavaDelegateMock.class); - - for (String key : outParam.keySet()) { - builder.camundaOutputParameter(key, outParam.get(key)); - } - - BpmnModelInstance modelInstance = builder.endEvent().name("End_Event").done(); - mockedSubprocessList.add(repositoryService.createDeployment().addModelInstance(fileName + ".bpmn", modelInstance).deploy().getId()); - } + @MockBean + protected BBInputSetupUtils bbInputSetupUtils; + + @MockBean + protected ExecuteBuildingBlockRainyDay executeBuildingBlockRainyDay; + + @MockBean + protected WorkflowAction workflowAction; + + @MockBean + protected WorkflowActionBBTasks workflowActionBBTasks; + + @MockBean + protected GenericVnfHealthCheck genericVnfHealthCheck; + + @MockBean + protected ConfigurationScaleOut configurationScaleOut; + + @MockBean + protected FlowCompletionTasks flowCompletionTasks; + + @MockBean + protected BuildingBlockValidatorRunner buildingBlockValidatorRunner; + + @MockBean + protected SDNOHealthCheckTasks sdnoHealthCheckTasks; + + @MockBean + protected SDNCClient sdncClient; + + @MockBean + protected SniroHomingV2 sniroHoming; + + @MockBean + protected NamingServiceDeleteTasks namingServiceDeleteTasks; + + @MockBean + protected NamingServiceCreateTasks namingServiceCreateTasks; + + @MockBean + protected WorkflowActionBBFailure workflowActionBBFailure; + + @MockBean + protected AuditTasks auditTasks; + + @MockBean + protected ManualHandlingTasks manualHandlingTasks; + + @LocalServerPort + protected int port; + + protected String createURLWithPort(String uri) { + return "http://localhost:" + port + uri; + } + + @Before + public void baseBefore() { + variables.put("gBuildingBlockExecution", new DelegateExecutionImpl(new HashMap<>())); + } + + @After + public void baseAfter() { + for (String deploymentId : mockedSubprocessList) { + repositoryService.deleteDeployment(deploymentId); + } + mockedSubprocessList.clear(); + } + + /** + * Create and deploy a process model with one logger delegate as service task. + * + * @param origProcessKey key to call + * @param mockProcessName process name + * @param fileName file name without extension + */ + protected void mockSubprocess(String origProcessKey, String mockProcessName, String fileName) { + mockSubprocess(origProcessKey, mockProcessName, fileName, new HashMap<String, String>()); + } + + /** + * Create and deploy a process model with one logger delegate as service task. + * + * @param origProcessKey key to call + * @param mockProcessName process name + * @param fileName file name without extension + * @param outParam output parameters + */ + protected void mockSubprocess(String origProcessKey, String mockProcessName, String fileName, + Map<String, String> outParam) { + ServiceTaskBuilder builder = Bpmn.createExecutableProcess(origProcessKey).name(mockProcessName).startEvent() + .name("Start_Event").serviceTask().name("Mock_Delegate").camundaClass(FluentJavaDelegateMock.class); + + for (String key : outParam.keySet()) { + builder.camundaOutputParameter(key, outParam.get(key)); + } + + BpmnModelInstance modelInstance = builder.endEvent().name("End_Event").done(); + mockedSubprocessList.add(repositoryService.createDeployment() + .addModelInstance(fileName + ".bpmn", modelInstance).deploy().getId()); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAICheckVnfInMaintBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAICheckVnfInMaintBBTest.java index 1101fc85f5..11e6d7798d 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAICheckVnfInMaintBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAICheckVnfInMaintBBTest.java @@ -23,37 +23,36 @@ package org.onap.so.bpmn.common; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - 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; -public class AAICheckVnfInMaintBBTest extends BaseBPMNTest{ - - - @Test - public void sunnyDayAAICheckVnfInMaintBBTest() throws InterruptedException, IOException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAICheckVnfInMaintBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_AAICheckVnfInMaintBB", "Task_CheckVnfInMaint", "End_AAICheckVnfInMaintBB"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayAAISetVnfInMaintBBTest() { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks).checkVnfInMaintFlag(any(BuildingBlockExecution.class)); - - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("AAICheckVnfInMaintBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted() - .hasPassedInOrder("Start_AAICheckVnfInMaintBB", "Task_CheckVnfInMaint") - .hasNotPassed("End_AAICheckVnfInMaintBB"); - assertThat(processInstance).isEnded(); - } +public class AAICheckVnfInMaintBBTest extends BaseBPMNTest { + + + @Test + public void sunnyDayAAICheckVnfInMaintBBTest() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAICheckVnfInMaintBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_AAICheckVnfInMaintBB", "Task_CheckVnfInMaint", + "End_AAICheckVnfInMaintBB"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayAAISetVnfInMaintBBTest() { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .checkVnfInMaintFlag(any(BuildingBlockExecution.class)); + + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("AAICheckVnfInMaintBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("Start_AAICheckVnfInMaintBB", "Task_CheckVnfInMaint") + .hasNotPassed("End_AAICheckVnfInMaintBB"); + assertThat(processInstance).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetVnfInMaintBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetVnfInMaintBBTest.java index effd50fcf1..64aa06cd20 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetVnfInMaintBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetVnfInMaintBBTest.java @@ -23,9 +23,7 @@ package org.onap.so.bpmn.common; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Ignore; @@ -33,25 +31,26 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; public class AAISetVnfInMaintBBTest extends BaseBPMNTest { - - - @Test - public void sunnyDayAAISetVnfInMaintBBTest() throws InterruptedException, IOException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAISetVnfInMaintBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_AAISetVnfInMaintBB", "Task_SetInMaint", "End_AAISetVnfInMaintBB"); - } - - @Test - public void rainyDayAAISetVnfInMaintBBTest() { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks).modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); - - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("AAISetVnfInMaintBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted() - .hasPassedInOrder("Start_AAISetVnfInMaintBB", "Task_SetInMaint") - .hasNotPassed("End_AAISetVnfInMaintBB"); - assertThat(processInstance).isEnded(); - } - - + + + @Test + public void sunnyDayAAISetVnfInMaintBBTest() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAISetVnfInMaintBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_AAISetVnfInMaintBB", "Task_SetInMaint", + "End_AAISetVnfInMaintBB"); + } + + @Test + public void rainyDayAAISetVnfInMaintBBTest() { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); + + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("AAISetVnfInMaintBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("Start_AAISetVnfInMaintBB", "Task_SetInMaint") + .hasNotPassed("End_AAISetVnfInMaintBB"); + assertThat(processInstance).isEnded(); + } + + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAIUnsetVnfInMaintBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAIUnsetVnfInMaintBBTest.java index 7da8823c56..c67db438d9 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAIUnsetVnfInMaintBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAIUnsetVnfInMaintBBTest.java @@ -23,9 +23,7 @@ package org.onap.so.bpmn.common; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Ignore; @@ -33,27 +31,28 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; public class AAIUnsetVnfInMaintBBTest extends BaseBPMNTest { - - - @Test - public void sunnyDayAAISetVnftInMaintBBTest() throws InterruptedException, IOException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAIUnsetVnfInMaintBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_AAIUnsetVnfInMaintBB", "Task_UnsetInMaint", "End_AAIUnsetVnfInMaintBB"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayAAISetVnfInMaintBBTest() { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks).modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); - - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("AAIUnsetVnfInMaintBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted() - .hasPassedInOrder("Start_AAIUnsetVnfInMaintBB", "Task_UnsetInMaint") - .hasNotPassed("End_AAIUnsetVnfInMaintBB"); - assertThat(processInstance).isEnded(); - } - - + + + @Test + public void sunnyDayAAISetVnftInMaintBBTest() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAIUnsetVnfInMaintBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_AAIUnsetVnfInMaintBB", "Task_UnsetInMaint", + "End_AAIUnsetVnfInMaintBB"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayAAISetVnfInMaintBBTest() { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); + + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("AAIUnsetVnfInMaintBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("Start_AAIUnsetVnfInMaintBB", "Task_UnsetInMaint") + .hasNotPassed("End_AAIUnsetVnfInMaintBB"); + assertThat(processInstance).isEnded(); + } + + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/SDNOHealthCheckBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/SDNOHealthCheckBBTest.java index 70351f9aad..ed1fb3fd91 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/SDNOHealthCheckBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/SDNOHealthCheckBBTest.java @@ -23,9 +23,7 @@ package org.onap.so.bpmn.common; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Ignore; @@ -33,27 +31,28 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; public class SDNOHealthCheckBBTest extends BaseBPMNTest { - - @Test - - public void sunnyDaySDNOHealthCheckTest() throws InterruptedException, IOException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("SDNOVnfHealthCheckBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_SDNOHealthCheckBB", "Task_SDNOHealthCheck", "End_SDNOHealthCheckBB"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDaySDNOHealthCheckTest() { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdnoHealthCheckTasks).sdnoHealthCheck(any(BuildingBlockExecution.class)); - - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("SDNOVnfHealthCheckBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted() - .hasPassedInOrder("Start_SDNOHealthCheckBB", "Task_SDNOHealthCheck") - .hasNotPassed("End_SDNOHealthCheckBB"); - assertThat(processInstance).isEnded(); - } - - + + @Test + + public void sunnyDaySDNOHealthCheckTest() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("SDNOVnfHealthCheckBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_SDNOHealthCheckBB", "Task_SDNOHealthCheck", + "End_SDNOHealthCheckBB"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDaySDNOHealthCheckTest() { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdnoHealthCheckTasks) + .sdnoHealthCheck(any(BuildingBlockExecution.class)); + + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("SDNOVnfHealthCheckBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("Start_SDNOHealthCheckBB", "Task_SDNOHealthCheck") + .hasNotPassed("End_SDNOHealthCheckBB"); + assertThat(processInstance).isEnded(); + } + + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java index a346aaf571..64c0e54a10 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java @@ -24,7 +24,6 @@ import static org.junit.Assert.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - import org.apache.http.HttpResponse; import org.apache.http.ProtocolVersion; import org.apache.http.client.HttpClient; @@ -35,34 +34,34 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; -public class DeployActivitySpecsTest extends BaseBPMNTest{ - private static final String RESULT_STRING = "HTTP/1.1 404 "; +public class DeployActivitySpecsTest extends BaseBPMNTest { + private static final String RESULT_STRING = "HTTP/1.1 404 "; + - - @Test - public void DeployActivitySpecsMain_Test() throws Exception { - String HOSTNAME = createURLWithPort(""); - ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1); - HttpResponse response = new BasicHttpResponse(protocolVersion, 1, ""); - response.setStatusCode(404); - response.setStatusLine(protocolVersion, 1, ""); - HttpClient clientMock = mock(HttpClient.class); - when(clientMock.execute(any(HttpPost.class))).thenReturn(response); - String[] args = new String[] {HOSTNAME}; - DeployActivitySpecs.main(args); + @Test + public void DeployActivitySpecsMain_Test() throws Exception { + String HOSTNAME = createURLWithPort(""); + ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1); + HttpResponse response = new BasicHttpResponse(protocolVersion, 1, ""); + response.setStatusCode(404); + response.setStatusLine(protocolVersion, 1, ""); + HttpClient clientMock = mock(HttpClient.class); + when(clientMock.execute(any(HttpPost.class))).thenReturn(response); + String[] args = new String[] {HOSTNAME}; + DeployActivitySpecs.main(args); } - - @Test - @Ignore - public void DeployActivitySpec_Test() throws Exception { - String HOSTNAME = createURLWithPort(""); - ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1); - HttpResponse response = new BasicHttpResponse(protocolVersion, 1, ""); - response.setStatusCode(404); - response.setStatusLine(protocolVersion, 1, ""); - HttpClient clientMock = mock(HttpClient.class); - when(clientMock.execute(any(HttpPost.class))).thenReturn(response); ; - String result = DeployActivitySpecs.deployActivitySpec(HOSTNAME, "VNFQuiesceTrafficActivitySpec.json"); - assertEquals(result, RESULT_STRING); + + @Test + @Ignore + public void DeployActivitySpec_Test() throws Exception { + String HOSTNAME = createURLWithPort(""); + ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1); + HttpResponse response = new BasicHttpResponse(protocolVersion, 1, ""); + response.setStatusCode(404); + response.setStatusLine(protocolVersion, 1, ""); + HttpClient clientMock = mock(HttpClient.class); + when(clientMock.execute(any(HttpPost.class))).thenReturn(response);; + String result = DeployActivitySpecs.deployActivitySpec(HOSTNAME, "VNFQuiesceTrafficActivitySpec.json"); + assertEquals(result, RESULT_STRING); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java index 3ab1c76ee6..051f373eaf 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java @@ -23,11 +23,9 @@ package org.onap.so.bpmn.infrastructure.bpmn.process; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; import java.util.HashMap; import java.util.Map; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.runtime.ProcessInstance; @@ -37,99 +35,117 @@ import org.onap.so.bpmn.BaseBPMNTest; @Ignore public class WorkflowActionBBTest extends BaseBPMNTest { - - @Test - public void sunnyDaySuccessIsTopLevelFlow() throws InterruptedException, IOException { - variables.put("isTopLevelFlow", true); - variables.put("completed", true); - - Map<String, String> map = new HashMap<>(); - map.put("handlingCode", "Success"); - mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", "Task_SendSync", - "Task_SelectBB", "Call_ExecuteBB", "ExclusiveGateway_Finished", "ExclusiveGateway_isTopLevelFlowCompleted", "Task_UpdateRequestComplete", - "End_WorkflowActionBB"); - - } - - @Test - public void sunnyDaySuccessNotTopLevelFlow() throws InterruptedException, IOException { - variables.put("isTopLevelFlow", false); - variables.put("completed", true); - - Map<String, String> map = new HashMap<>(); - map.put("handlingCode", "Success"); - mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", - "Task_SelectBB", "Call_ExecuteBB", "ExclusiveGateway_Finished", "ExclusiveGateway_isTopLevelFlowCompleted", "End_WorkflowActionBB"); - } - - @Test - public void sunnyDayRollback() throws InterruptedException, IOException { - variables.put("isTopLevelFlow", false); - variables.put("isRollbackNeeded", false); - - Map<String, String> map = new HashMap<>(); - map.put("handlingCode", "Rollback"); - mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", - "Task_SelectBB", "Call_ExecuteBB", "ExclusiveGateway_Finished", "Task_RollbackExecutionPath", "Task_UpdateRequestToFailed", "End_RollbackFailed"); - - } - - @Test - public void rainyDayAbort() throws Exception { - variables.put("isTopLevelFlow", true); - variables.put("completed", false); - - Map<String, String> map = new HashMap<>(); - map.put("handlingCode", "Abort"); - - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBFailure).abortCallErrorHandling(any(DelegateExecution.class)); - mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", "Task_SendSync", - "Task_SelectBB", "Call_ExecuteBB", "ExclusiveGateway_Finished", "ExclusiveGateway_isTopLevelFlowAbort", "Task_AbortAndCallErrorHandling", "ErrorStart", - "Task_UpdateDb", "ErrorEnd"); - - } - - @Test - public void retrieveBBExecutionListerrorHandling() throws Exception { - variables.put("isTopLevelFlow", true); - variables.put("sentSyncResponse", false); - doThrow(new IllegalStateException("TESTING ERRORS")).when(workflowAction).selectExecutionList(any(DelegateExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList", "StartEvent_runtimeError", "ServiceTask_HandleRuntimeError", "EndEvent__runtimeError", "SubProcess_0rze15o"); - - } - - @Test - public void errorCatchSubprocessHandlingTest() throws Exception { - variables.put("isTopLevelFlow", true); - variables.put("sentSyncResponse", false); - doThrow(new IllegalStateException("TESTING ERRORS")).when(workflowAction).selectExecutionList(any(DelegateExecution.class)); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowAction).handleRuntimeException(any(DelegateExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList", "StartEvent_runtimeError", "ServiceTask_HandleRuntimeError", "SubProcess_0fuugr9", "ErrorStart", "ExclusiveGateway_10q79b6", "Task_SendSyncAckError", "Task_UpdateDb", "ErrorEnd", "SubProcess_18226x4"); - - } - - @Test - public void errorCatchBpmnSubprocessHandlingTest() throws Exception { - variables.put("isTopLevelFlow", true); - variables.put("sentSyncResponse", false); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBTasks).selectBB(any(DelegateExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList","ExclusiveGateway_isTopLevelFlow","Task_SendSync","Task_SelectBB", "ErrorStart", "ExclusiveGateway_10q79b6", "Task_SendSyncAckError", "Task_UpdateDb", "ErrorEnd", "SubProcess_18226x4"); - - } + + @Test + public void sunnyDaySuccessIsTopLevelFlow() throws InterruptedException, IOException { + variables.put("isTopLevelFlow", true); + variables.put("completed", true); + + Map<String, String> map = new HashMap<>(); + map.put("handlingCode", "Success"); + mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", + "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", "Task_SendSync", "Task_SelectBB", + "Call_ExecuteBB", "ExclusiveGateway_Finished", "ExclusiveGateway_isTopLevelFlowCompleted", + "Task_UpdateRequestComplete", "End_WorkflowActionBB"); + + } + + @Test + public void sunnyDaySuccessNotTopLevelFlow() throws InterruptedException, IOException { + variables.put("isTopLevelFlow", false); + variables.put("completed", true); + + Map<String, String> map = new HashMap<>(); + map.put("handlingCode", "Success"); + mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", + "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", "Task_SelectBB", "Call_ExecuteBB", + "ExclusiveGateway_Finished", "ExclusiveGateway_isTopLevelFlowCompleted", "End_WorkflowActionBB"); + } + + @Test + public void sunnyDayRollback() throws InterruptedException, IOException { + variables.put("isTopLevelFlow", false); + variables.put("isRollbackNeeded", false); + + Map<String, String> map = new HashMap<>(); + map.put("handlingCode", "Rollback"); + mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", + "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", "Task_SelectBB", "Call_ExecuteBB", + "ExclusiveGateway_Finished", "Task_RollbackExecutionPath", "Task_UpdateRequestToFailed", + "End_RollbackFailed"); + + } + + @Test + public void rainyDayAbort() throws Exception { + variables.put("isTopLevelFlow", true); + variables.put("completed", false); + + Map<String, String> map = new HashMap<>(); + map.put("handlingCode", "Abort"); + + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBFailure) + .abortCallErrorHandling(any(DelegateExecution.class)); + mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", + "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", "Task_SendSync", "Task_SelectBB", + "Call_ExecuteBB", "ExclusiveGateway_Finished", "ExclusiveGateway_isTopLevelFlowAbort", + "Task_AbortAndCallErrorHandling", "ErrorStart", "Task_UpdateDb", "ErrorEnd"); + + } + + @Test + public void retrieveBBExecutionListerrorHandling() throws Exception { + variables.put("isTopLevelFlow", true); + variables.put("sentSyncResponse", false); + doThrow(new IllegalStateException("TESTING ERRORS")).when(workflowAction) + .selectExecutionList(any(DelegateExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_WorkflowActionBB", "Task_RetrieveBBExectuionList", + "StartEvent_runtimeError", "ServiceTask_HandleRuntimeError", "EndEvent__runtimeError", + "SubProcess_0rze15o"); + + } + + @Test + public void errorCatchSubprocessHandlingTest() throws Exception { + variables.put("isTopLevelFlow", true); + variables.put("sentSyncResponse", false); + doThrow(new IllegalStateException("TESTING ERRORS")).when(workflowAction) + .selectExecutionList(any(DelegateExecution.class)); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowAction) + .handleRuntimeException(any(DelegateExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", + "Task_RetrieveBBExectuionList", "StartEvent_runtimeError", "ServiceTask_HandleRuntimeError", + "SubProcess_0fuugr9", "ErrorStart", "ExclusiveGateway_10q79b6", "Task_SendSyncAckError", + "Task_UpdateDb", "ErrorEnd", "SubProcess_18226x4"); + + } + + @Test + public void errorCatchBpmnSubprocessHandlingTest() throws Exception { + variables.put("isTopLevelFlow", true); + variables.put("sentSyncResponse", false); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBTasks) + .selectBB(any(DelegateExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_WorkflowActionBB", + "Task_RetrieveBBExectuionList", "ExclusiveGateway_isTopLevelFlow", "Task_SendSync", "Task_SelectBB", + "ErrorStart", "ExclusiveGateway_10q79b6", "Task_SendSyncAckError", "Task_UpdateDb", "ErrorEnd", + "SubProcess_18226x4"); + + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkBBTest.java index dcf679610e..affe1857bd 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkBBTest.java @@ -23,30 +23,30 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class ActivateNetworkBBTest extends BaseBPMNTest{ +public class ActivateNetworkBBTest extends BaseBPMNTest { @Test public void sunnyDayActivateNetwork_Test() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("activateNetwork_startEvent","Activate_Network_SDNC_ServiceTask","CallActivity_sdncHandler","Activate_Network_AAI_ServiceTask","activateNetwork_EndEvent"); + assertThat(pi).isStarted().hasPassedInOrder("activateNetwork_startEvent", "Activate_Network_SDNC_ServiceTask", + "CallActivity_sdncHandler", "Activate_Network_AAI_ServiceTask", "activateNetwork_EndEvent"); assertThat(pi).isEnded(); } - @Test - public void rainyDayActivateNetwork_Test() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusActiveNetwork(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkBB", variables); - assertThat(pi).isStarted() - .hasPassedInOrder("activateNetwork_startEvent","Activate_Network_SDNC_ServiceTask","Activate_Network_AAI_ServiceTask") - .hasNotPassed("activateNetwork_EndEvent").isEnded(); - } + @Test + public void rainyDayActivateNetwork_Test() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusActiveNetwork(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkBB", variables); + assertThat(pi).isStarted().hasPassedInOrder("activateNetwork_startEvent", "Activate_Network_SDNC_ServiceTask", + "Activate_Network_AAI_ServiceTask").hasNotPassed("activateNetwork_EndEvent").isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkCollectionBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkCollectionBBTest.java index c6c301476e..0f0c373c03 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkCollectionBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateNetworkCollectionBBTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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; @@ -30,22 +30,23 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class ActivateNetworkCollectionBBTest extends BaseBPMNTest{ +public class ActivateNetworkCollectionBBTest extends BaseBPMNTest { @Test public void sunnyDayActivateNetworkCollection_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkCollectionBB",variables); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkCollectionBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("activateNetworkCollection_startEvent","Activate_Network_Collection_AAI_ServiceTask","activateNetworkCollection_EndEvent"); + assertThat(pi).isStarted().hasPassedInOrder("activateNetworkCollection_startEvent", + "Activate_Network_Collection_AAI_ServiceTask", "activateNetworkCollection_EndEvent"); assertThat(pi).isEnded(); } - @Test - - public void rainyDayActivateNetworkCollection_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusActiveNetworkCollection(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkCollectionBB", variables); - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("activateNetworkCollection_startEvent") - .hasNotPassed("activateNetworkCollection_EndEvent"); - } + @Test + + public void rainyDayActivateNetworkCollection_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusActiveNetworkCollection(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateNetworkCollectionBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("activateNetworkCollection_startEvent") + .hasNotPassed("activateNetworkCollection_EndEvent"); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateServiceInstanceBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateServiceInstanceBBTest.java index efe7d87fb2..9eefaded9c 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateServiceInstanceBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateServiceInstanceBBTest.java @@ -19,22 +19,21 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import java.io.IOException; - import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; -public class ActivateServiceInstanceBBTest extends BaseBPMNTest{ - - @Test - public void sunnyDaySDNC() throws InterruptedException, IOException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateServiceInstanceBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_ActivateServiceInstanceBB", "Task_NoOpServiceInstance", - "Task_UpdateServiceOrchestrationStatusToActive", "End_ActivateServiceInstanceBB"); - assertThat(pi).isEnded(); - } +public class ActivateServiceInstanceBBTest extends BaseBPMNTest { + + @Test + public void sunnyDaySDNC() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateServiceInstanceBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_ActivateServiceInstanceBB", "Task_NoOpServiceInstance", + "Task_UpdateServiceOrchestrationStatusToActive", "End_ActivateServiceInstanceBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java index 2dae1173d6..6f89f3c738 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java @@ -19,13 +19,13 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import java.io.IOException; import java.util.List; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; @@ -34,51 +34,55 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class ActivateVfModuleBBTest extends BaseBPMNTest{ - - @Before - public void before() { - variables.put("vfModuleActivateTimerDuration", "PT2S"); - variables.put("auditInventoryNeeded", "true"); - } +public class ActivateVfModuleBBTest extends BaseBPMNTest { + + @Before + public void before() { + variables.put("vfModuleActivateTimerDuration", "PT2S"); + variables.put("auditInventoryNeeded", "true"); + variables.put("auditIsSuccessful", "true"); + } - @Test - public void sunnyDay() throws InterruptedException, IOException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); - List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") + @Test + public void sunnyDay() throws InterruptedException, IOException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); + List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") .topic("InventoryAddAudit", 60L * 1000L).execute(); while (!tasks.isEmpty()) { for (LockedExternalTask task : tasks) { externalTaskService.complete(task.getId(), "externalWorkerId"); } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryAddAudit", 60L * 1000L).execute(); + tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L) + .execute(); } - - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start","ExclusiveGateway_1v8bmbu","Setup_AAI_Inventory_Audit", "Audit_AAI_Inventory", "ActivateVfModule", "CallActivity_sdncHandler", - "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDay() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(BpmnError.class).when(aaiUpdateTasks).updateOrchestrationStatusActivateVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); - List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") + + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu", + "Setup_AAI_Inventory_Audit", "Audit_AAI_Inventory", "ActivateVfModule", "CallActivity_sdncHandler", + "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDay() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(BpmnError.class).when(aaiUpdateTasks) + .updateOrchestrationStatusActivateVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); + List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") .topic("InventoryAddAudit", 60L * 1000L).execute(); while (!tasks.isEmpty()) { for (LockedExternalTask task : tasks) { externalTaskService.complete(task.getId(), "externalWorkerId"); } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryAddAudit", 60L * 1000L).execute(); + tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L) + .execute(); } - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("ActivateVfModuleBB_Start","ExclusiveGateway_1v8bmbu","Setup_AAI_Inventory_Audit", "Audit_AAI_Inventory", "ActivateVfModule", "UpdateVfModuleActiveStatus") - .hasNotPassed("ActivateVfModuleBB_End"); - } + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu", "Setup_AAI_Inventory_Audit", + "Audit_AAI_Inventory", "ActivateVfModule", "UpdateVfModuleActiveStatus") + .hasNotPassed("ActivateVfModuleBB_End"); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVnfBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVnfBBTest.java index d1d95fee71..7a78a6a6e2 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVnfBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVnfBBTest.java @@ -19,23 +19,22 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import java.io.IOException; - import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; -public class ActivateVnfBBTest extends BaseBPMNTest{ - @Test - public void sunnyDay() throws InterruptedException, IOException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_ActivateVnfBB", "Task_SDNCAdapterVnfTopologyActivate", - "CallActivity_sdncHandler", "Task_ActivateOrchestrationStatusVnf", "End_ActivateVnfBB"); - assertThat(pi).isEnded(); - } +public class ActivateVnfBBTest extends BaseBPMNTest { + @Test + public void sunnyDay() throws InterruptedException, IOException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_ActivateVnfBB", "Task_SDNCAdapterVnfTopologyActivate", + "CallActivity_sdncHandler", "Task_ActivateOrchestrationStatusVnf", "End_ActivateVnfBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVolumeGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVolumeGroupBBTest.java index 8fc198ffcd..602f1c874f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVolumeGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVolumeGroupBBTest.java @@ -19,33 +19,34 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class ActivateVolumeGroupBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("ActivateVolumeGroupBB_Start", "ActivateVolumeGroup", "ActivateVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } +public class ActivateVolumeGroupBBTest extends BaseBPMNTest { + @Test + public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("ActivateVolumeGroupBB_Start", "ActivateVolumeGroup", + "ActivateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayAssignVolumeGroup_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusActiveVolumeGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("ActivateVolumeGroupBB_Start", "ActivateVolumeGroup") - .hasNotPassed("ActivateVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayAssignVolumeGroup_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusActiveVolumeGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("ActivateVolumeGroupBB_Start", "ActivateVolumeGroup") + .hasNotPassed("ActivateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignNetworkBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignNetworkBBTest.java index c581a16349..42291a9593 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignNetworkBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignNetworkBBTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.camunda.bpm.engine.test.Deployment; @@ -30,26 +30,33 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class AssignNetworkBBTest extends BaseBPMNTest{ +public class AssignNetworkBBTest extends BaseBPMNTest { @Test - @Deployment(resources = { "subprocess/AssignNetworkRollbackBB.bpmn"}) + @Deployment(resources = {"subprocess/AssignNetworkRollbackBB.bpmn"}) public void sunnyDayAssignNetwork_Test() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignNetworkBB",variables); + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignNetworkBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("AssignNetworkBB_start","networkFoundByName_ExclusiveGateway","ServiceTask_put_network_in_AAI","ServiceTask_connect_to_Tenant","ServiceTask_connect_to_CloudRegion","ServiceTask_connect_to_NCIG","ServiceTask_connect_to_NCSI","ServiceTask_get_cloud_region","ServiceTask_assign_network_sdnc","CallActivity_sdncHandlerCall","ServiceTask_assign_network_aai","AssignNetworkBB_end"); + assertThat(pi).isStarted().hasPassedInOrder("AssignNetworkBB_start", "networkFoundByName_ExclusiveGateway", + "ServiceTask_put_network_in_AAI", "ServiceTask_connect_to_Tenant", "ServiceTask_connect_to_CloudRegion", + "ServiceTask_connect_to_NCIG", "ServiceTask_connect_to_NCSI", "ServiceTask_get_cloud_region", + "ServiceTask_assign_network_sdnc", "CallActivity_sdncHandlerCall", "ServiceTask_assign_network_aai", + "AssignNetworkBB_end"); assertThat(pi).isEnded(); } - @Test - public void rainyDayAssignNetwork_Test() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusAssignedNetwork(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignNetworkBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("AssignNetworkBB_start", "networkFoundByName_ExclusiveGateway", "ServiceTask_put_network_in_AAI","ServiceTask_connect_to_Tenant","ServiceTask_connect_to_CloudRegion","ServiceTask_connect_to_NCIG","ServiceTask_connect_to_NCSI", "ServiceTask_get_cloud_region", "ServiceTask_assign_network_sdnc", "ServiceTask_assign_network_aai") - .hasNotPassed("AssignNetworkBB_end"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayAssignNetwork_Test() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusAssignedNetwork(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignNetworkBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("AssignNetworkBB_start", "networkFoundByName_ExclusiveGateway", + "ServiceTask_put_network_in_AAI", "ServiceTask_connect_to_Tenant", "ServiceTask_connect_to_CloudRegion", + "ServiceTask_connect_to_NCIG", "ServiceTask_connect_to_NCSI", "ServiceTask_get_cloud_region", + "ServiceTask_assign_network_sdnc", "ServiceTask_assign_network_aai") + .hasNotPassed("AssignNetworkBB_end"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignServiceInstanceBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignServiceInstanceBBTest.java index 2624cc0ccb..f45ed935a6 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignServiceInstanceBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignServiceInstanceBBTest.java @@ -19,24 +19,23 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import java.io.IOException; - import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; -public class AssignServiceInstanceBBTest extends BaseBPMNTest{ - - @Test - public void sunnyDaySDNC() throws InterruptedException, IOException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignServiceInstanceBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_AssignServiceInstanceBB", "Task_CreateServiceInstance", - "Task_CreateProject", "Task_CreateOwningEntity", "Task_AssignServiceInstance", "CallActivity_sdncHandler", - "Task_UpdateServiceOstatusToAssigned", "End_AssignServiceInstanceBB"); - assertThat(pi).isEnded(); - } +public class AssignServiceInstanceBBTest extends BaseBPMNTest { + + @Test + public void sunnyDaySDNC() throws InterruptedException, IOException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignServiceInstanceBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_AssignServiceInstanceBB", "Task_CreateServiceInstance", + "Task_CreateProject", "Task_CreateOwningEntity", "Task_AssignServiceInstance", + "CallActivity_sdncHandler", "Task_UpdateServiceOstatusToAssigned", "End_AssignServiceInstanceBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVfModuleBBTest.java index 44d17a350c..358d1a2789 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVfModuleBBTest.java @@ -19,40 +19,36 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class AssignVfModuleBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayAssignVfModule_Test() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("AssignVfModuleBB_Start", - "CreateVfModule", - "ConnectVfModuleToVolumeGroup", - "AssignVfModule", - "CallActivity_sdncHandlerCall", - "UpdateVfModuleStatus", - "AssignVfModuleBB_End"); - assertThat(pi).isEnded(); - } +public class AssignVfModuleBBTest extends BaseBPMNTest { + @Test + public void sunnyDayAssignVfModule_Test() throws InterruptedException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("AssignVfModuleBB_Start", "CreateVfModule", + "ConnectVfModuleToVolumeGroup", "AssignVfModule", "CallActivity_sdncHandlerCall", + "UpdateVfModuleStatus", "AssignVfModuleBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayAssignVfModule_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks).createVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("AssignVfModuleBB_Start", "CreateVfModule") - .hasNotPassed("ConnectVfModuleToVolumeGroup", "AssignVfModule", "UpdateVfModuleStatus", "AssignVfModuleBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayAssignVfModule_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks) + .createVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("AssignVfModuleBB_Start", "CreateVfModule").hasNotPassed( + "ConnectVfModuleToVolumeGroup", "AssignVfModule", "UpdateVfModuleStatus", "AssignVfModuleBB_End"); + assertThat(pi).isEnded(); + } } 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 f4258f46b8..9943e39ef6 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 @@ -19,12 +19,11 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; @@ -32,27 +31,28 @@ import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; public class AssignVnfBBTest extends BaseBPMNTest { - @Test - public void sunnyDayAssignVnfBBTest() throws InterruptedException, IOException { - variables.put("callHoming", true); - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_AssignVnfBB", "Task_CreateVnf", "ServiceTask_ConnectVnfToCloudRegion", "ServiceTask_ConnectVnfToTenant", "Task_createPlatform", "Task_createLineOfBusiness", "Task_createInstanceGroups", - "Task_callHoming", "Task_SDNCAdapterVnfTopologyAssign","CallActivity_sdncAssign", "Task_UpdateVnfOrchestrationStatusAssigned", - "End_AssignVnfBB"); - assertThat(pi).isEnded(); - } + @Test + public void sunnyDayAssignVnfBBTest() throws InterruptedException, IOException { + variables.put("callHoming", true); + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_AssignVnfBB", "Task_CreateVnf", + "ServiceTask_ConnectVnfToCloudRegion", "ServiceTask_ConnectVnfToTenant", "Task_createPlatform", + "Task_createLineOfBusiness", "Task_createInstanceGroups", "Task_callHoming", "Task_SDNCCreateRequest", + "CallActivity_SDNCAssignVnf", "Task_UpdateVnfOrchestrationStatusAssigned", "End_AssignVnfBB"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayAssignVnfBBTest() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks) - .createVnf(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_AssignVnfBB", "Task_CreateVnf").hasNotPassed( - "Task_createPlatform", "Task_createLineOfBusiness", "Task_createInstanceGroups", "Task_SDNCAdapterVnfTopologyAssign", - "Task_UpdateVnfOrchestrationStatusAssigned", "End_AssignVnfBB"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayAssignVnfBBTest() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks) + .createVnf(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_AssignVnfBB", "Task_CreateVnf").hasNotPassed( + "Task_createPlatform", "Task_createLineOfBusiness", "Task_createInstanceGroups", + "Task_SDNCAdapterVnfTopologyAssign", "Task_UpdateVnfOrchestrationStatusAssigned", "End_AssignVnfBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVolumeGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVolumeGroupBBTest.java index e39370b951..0de657ed7f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVolumeGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/AssignVolumeGroupBBTest.java @@ -19,33 +19,34 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class AssignVolumeGroupBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("AssignVolumeGroupBB_Start", "AssignVolumeGroup", "AssignVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } +public class AssignVolumeGroupBBTest extends BaseBPMNTest { + @Test + public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("AssignVolumeGroupBB_Start", "AssignVolumeGroup", + "AssignVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayAssignVolumeGroup_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks).createVolumeGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("AssignVolumeGroupBB_Start", "AssignVolumeGroup") - .hasNotPassed("AssignVolumeGroupBB_End"); - assertThat(pi).isEnded();; - } + @Test + public void rainyDayAssignVolumeGroup_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks) + .createVolumeGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AssignVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("AssignVolumeGroupBB_Start", "AssignVolumeGroup") + .hasNotPassed("AssignVolumeGroupBB_End"); + assertThat(pi).isEnded();; + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/BuildingBlockValidatorRunnerTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/BuildingBlockValidatorRunnerTest.java index a241ae5eff..a036f6713e 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/BuildingBlockValidatorRunnerTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/BuildingBlockValidatorRunnerTest.java @@ -27,16 +27,16 @@ import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; -public class BuildingBlockValidatorRunnerTest extends BaseBPMNTest{ +public class BuildingBlockValidatorRunnerTest extends BaseBPMNTest { @Test public void sunnyDayActivateNetwork_Test() throws InterruptedException { - variables.put("flowToBeCalled","CreateVolumeGroupBB"); + variables.put("flowToBeCalled", "CreateVolumeGroupBB"); ProcessInstance pi = runtimeService.startProcessInstanceByKey("BuildingBlockValidatorRunnerTest", variables); assertThat(pi).isNotNull(); - + execute(job()); execute(job()); - assertThat(pi).isStarted().hasPassedInOrder("ServiceTask_1","ServiceTask_2","ServiceTask_3"); + assertThat(pi).isStarted().hasPassedInOrder("ServiceTask_1", "ServiceTask_2", "ServiceTask_3"); assertThat(pi).isEnded(); } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelServiceInstanceBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelServiceInstanceBBTest.java index 1772a3af4b..832ee528a1 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelServiceInstanceBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelServiceInstanceBBTest.java @@ -19,35 +19,40 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class ChangeModelServiceInstanceBBTest extends BaseBPMNTest{ - @Test - public void changeModelVnfBBTest() { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("ChangeModelServiceInstanceBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted().hasPassedInOrder("ChangeModelServiceInstance_Start" ,"SDNCChangeModelServiceInstance", "CallActivity_sdncHandlerReq", "AAIUpdateModelServiceInstance", "ChangeModelServiceInstance_End"); - assertThat(processInstance).isEnded(); - } - - @Test - public void changeModelVnfBBExceptionTest() { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncChangeAssignTasks).changeModelServiceInstance(any(BuildingBlockExecution.class)); - - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("ChangeModelServiceInstanceBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted() - .hasPassedInOrder("ChangeModelServiceInstance_Start", "SDNCChangeModelServiceInstance") - .hasNotPassed("AAIUpdateModel", "ChangeModelServiceInstance_End"); - assertThat(processInstance).isEnded(); - } +public class ChangeModelServiceInstanceBBTest extends BaseBPMNTest { + @Test + public void changeModelVnfBBTest() { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance processInstance = + runtimeService.startProcessInstanceByKey("ChangeModelServiceInstanceBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("ChangeModelServiceInstance_Start", + "SDNCChangeModelServiceInstance", "CallActivity_sdncHandlerReq", "AAIUpdateModelServiceInstance", + "ChangeModelServiceInstance_End"); + assertThat(processInstance).isEnded(); + } + + @Test + public void changeModelVnfBBExceptionTest() { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncChangeAssignTasks) + .changeModelServiceInstance(any(BuildingBlockExecution.class)); + + ProcessInstance processInstance = + runtimeService.startProcessInstanceByKey("ChangeModelServiceInstanceBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted() + .hasPassedInOrder("ChangeModelServiceInstance_Start", "SDNCChangeModelServiceInstance") + .hasNotPassed("AAIUpdateModel", "ChangeModelServiceInstance_End"); + assertThat(processInstance).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVfModuleBBTest.java index 8549b6bc5a..42be6a5711 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVfModuleBBTest.java @@ -19,36 +19,37 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class ChangeModelVfModuleBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayChangeModelVfModuleTest() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ChangeModelVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("ChangeModelVfModuleBB_Start", "ChangeModelVfModule", "CallActivity_sdncHandler", "UpdateVfModuleModel", "ChangeModelVfModuleBB_End"); - assertThat(pi).isEnded(); - } +public class ChangeModelVfModuleBBTest extends BaseBPMNTest { + @Test + public void sunnyDayChangeModelVfModuleTest() throws InterruptedException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ChangeModelVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("ChangeModelVfModuleBB_Start", "ChangeModelVfModule", + "CallActivity_sdncHandler", "UpdateVfModuleModel", "ChangeModelVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayChangeModelVfModuleTest() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncChangeAssignTasks) + .changeAssignModelVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ChangeModelVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("ChangeModelVfModuleBB_Start", "ChangeModelVfModule") + .hasNotPassed("ChangeModelVfModuleBB_End"); + assertThat(pi).isEnded(); + } + - @Test - public void rainyDayChangeModelVfModuleTest() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncChangeAssignTasks).changeAssignModelVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ChangeModelVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("ChangeModelVfModuleBB_Start", "ChangeModelVfModule") - .hasNotPassed("ChangeModelVfModuleBB_End"); - assertThat(pi).isEnded(); - } - - } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVnfBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVnfBBTest.java index 43ac1630df..a7835e30f0 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVnfBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ChangeModelVnfBBTest.java @@ -19,35 +19,36 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class ChangeModelVnfBBTest extends BaseBPMNTest{ - @Test - public void changeModelVnfBBTest() { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("ChangeModelVnfBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted().hasPassedInOrder("ChangeModelVnf_Start" ,"SDNCChangeModel", "CallActivity_sdncHandlerCall", "AAIUpdateModel", "ChangeModelVnf_End"); - assertThat(processInstance).isEnded(); - } - - @Test - public void changeModelVnfBBExceptionTest() { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncChangeAssignTasks).changeModelVnf(any(BuildingBlockExecution.class)); - - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("ChangeModelVnfBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted() - .hasPassedInOrder("ChangeModelVnf_Start", "SDNCChangeModel") - .hasNotPassed("AAIUpdateModel", "ChangeModelVnf_End"); - assertThat(processInstance).isEnded(); - } +public class ChangeModelVnfBBTest extends BaseBPMNTest { + @Test + public void changeModelVnfBBTest() { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("ChangeModelVnfBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("ChangeModelVnf_Start", "SDNCChangeModel", + "CallActivity_sdncHandlerCall", "AAIUpdateModel", "ChangeModelVnf_End"); + assertThat(processInstance).isEnded(); + } + + @Test + public void changeModelVnfBBExceptionTest() { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncChangeAssignTasks) + .changeModelVnf(any(BuildingBlockExecution.class)); + + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("ChangeModelVnfBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("ChangeModelVnf_Start", "SDNCChangeModel") + .hasNotPassed("AAIUpdateModel", "ChangeModelVnf_End"); + assertThat(processInstance).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ConfigurationScaleOutBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ConfigurationScaleOutBBTest.java index 4602ff97ce..8a19bc2561 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ConfigurationScaleOutBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ConfigurationScaleOutBBTest.java @@ -19,15 +19,13 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; - import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; @@ -36,23 +34,23 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; public class ConfigurationScaleOutBBTest extends BaseBPMNTest { - @Test - public void sunnyDayConfigurationScaleOutBBTest() throws InterruptedException, IOException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule", "GetConfigScaleOutParams", - "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB"); - assertThat(pi).isEnded(); - } - - @Test - public void configurationScaleOutBBExceptionTest() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks).queryVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule") - .hasNotPassed("GetConfigScaleOutParams", "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB"); - assertThat(pi).isEnded(); - } + @Test + public void sunnyDayConfigurationScaleOutBBTest() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule", + "GetConfigScaleOutParams", "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB"); + assertThat(pi).isEnded(); + } + + @Test + public void configurationScaleOutBBExceptionTest() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks) + .queryVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule") + .hasNotPassed("GetConfigScaleOutParams", "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateCustomerBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateCustomerBBTest.java index 91d3fd20a2..ee85f9bc05 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateCustomerBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateCustomerBBTest.java @@ -19,34 +19,35 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class CreateCustomerBBTest extends BaseBPMNTest{ - @Test - public void createCustomerBBTest() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateCustomerBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("CreateCustomerBB_Start", "CreateCustomerAAI", "CreateCustomerBB_End"); - assertThat(pi).isEnded(); - } +public class CreateCustomerBBTest extends BaseBPMNTest { + @Test + public void createCustomerBBTest() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateCustomerBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("CreateCustomerBB_Start", "CreateCustomerAAI", + "CreateCustomerBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void createCustomerBBExceptionTest() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks).createCustomer(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateCustomerBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateCustomerBB_Start", "CreateCustomerAAI") - .hasNotPassed("CreateCustomer_End"); - assertThat(pi).isEnded(); - } + @Test + public void createCustomerBBExceptionTest() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks) + .createCustomer(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateCustomerBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("CreateCustomerBB_Start", "CreateCustomerAAI") + .hasNotPassed("CreateCustomer_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkBBTest.java index 0aba1cc484..ece5b93ee2 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkBBTest.java @@ -19,35 +19,37 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class CreateNetworkBBTest extends BaseBPMNTest{ +public class CreateNetworkBBTest extends BaseBPMNTest { @Test public void sunnyDayCreateNetwork_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkBB",variables); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("createNetwork_startEvent", "ServiceTask_get_cloud_region", "QueryVpnBinding_ServiceTask", "QueryNetworkPolicy_ServiceTask", "QueryNetworkTableRef_ServiceTask", "QueryNetworkSubnet_ServiceTask", "Create_Network_ServiceTask", "Update_Network_AAI_ServiceTask", "createNetwork_EndEvent"); + assertThat(pi).isStarted().hasPassedInOrder("createNetwork_startEvent", "ServiceTask_get_cloud_region", + "QueryVpnBinding_ServiceTask", "QueryNetworkPolicy_ServiceTask", "QueryNetworkTableRef_ServiceTask", + "QueryNetworkSubnet_ServiceTask", "Create_Network_ServiceTask", "Update_Network_AAI_ServiceTask", + "createNetwork_EndEvent"); assertThat(pi).isEnded(); } - @Test - public void rainyDayCreateNetwork_Test() throws Exception { - - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(createNetwork).buildCreateNetworkRequest(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("createNetwork_startEvent") - .hasNotPassed("End Flow"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayCreateNetwork_Test() throws Exception { + + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(createNetwork) + .buildCreateNetworkRequest(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("createNetwork_startEvent").hasNotPassed("End Flow"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkCollectionBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkCollectionBBTest.java index 5c67324e0a..1d9cf5ad69 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkCollectionBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateNetworkCollectionBBTest.java @@ -19,33 +19,36 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class CreateNetworkCollectionBBTest extends BaseBPMNTest{ +public class CreateNetworkCollectionBBTest extends BaseBPMNTest { @Test public void sunnyDayCreateNetworkCollection_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB",variables); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask", "ServiceTask_create_NetworkCollection", "ServiceTask_create_NetworkCollectionInstanceGroup", "ServiceTask_Connect_Collection_to_InstanceGroup", "ServiceTask_Connect_InstanceGroup_to_CloudRegion", "ServiceTask_Connect_Collection_to_ServiceInstance", "createNetworkCollection_EndEvent"); + assertThat(pi).isStarted().hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask", + "ServiceTask_create_NetworkCollection", "ServiceTask_create_NetworkCollectionInstanceGroup", + "ServiceTask_Connect_Collection_to_InstanceGroup", "ServiceTask_Connect_InstanceGroup_to_CloudRegion", + "ServiceTask_Connect_Collection_to_ServiceInstance", "createNetworkCollection_EndEvent"); assertThat(pi).isEnded(); } - @Test - public void rainyDayCreateNetworkCollection_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks).createNetworkCollectionInstanceGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask", "ServiceTask_create_NetworkCollection") - .hasNotPassed("createNetworkCollection_EndEvent"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayCreateNetworkCollection_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks) + .createNetworkCollectionInstanceGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask", + "ServiceTask_create_NetworkCollection").hasNotPassed("createNetworkCollection_EndEvent"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java index 8c44309cca..4c5edade6e 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java @@ -19,100 +19,99 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class CreateVfModuleBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayCreateVfModule_Test() throws InterruptedException { - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("CreateVfModuleBB_Start", - "QueryVnf", - "QueryVfModule", - "CreateVfModule", - "VnfAdapter", - "CreateNetworkPolicies", - "UpdateVnfIpv4OamAddress", - "UpdateVnfManagementV6Address", - "UpdateVfModuleContrailServiceInstanceFqdn", - "UpdateVfModuleHeatStackId", - "UpdateVfModuleStatus", - "CreateVfModuleBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayCreateVfModuleSDNCQueryVnfError_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks).queryVnf(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf") - .hasNotPassed("QueryVfModule", "CreateVfModule", "VnfAdapter", "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", - "UpdateVnfManagementV6Address","UpdateVfModuleContrailServiceInstanceFqdn","UpdateVfModuleHeatStackId", - "UpdateVfModuleStatus", "CreateVfModuleBB_End"); - assertThat(pi).isEnded(); - } +public class CreateVfModuleBBTest extends BaseBPMNTest { + @Test + public void sunnyDayCreateVfModule_Test() throws InterruptedException { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", + "CreateVfModule", "VnfAdapter", "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", + "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn", + "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayCreateVfModuleSDNCQueryVnfError_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks) + .queryVnf(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf").hasNotPassed("QueryVfModule", + "CreateVfModule", "VnfAdapter", "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", + "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn", + "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayCreateVfModuleSDNCQueryVnfModuleError_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks) + .queryVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule").hasNotPassed( + "CreateVfModule", "VnfAdapter", "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", + "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn", + "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayCreateVfModuleVnfAdapterCreateError_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterCreateTasks) + .createVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule") + .hasNotPassed("VnfAdapter", "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", + "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn", + "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayCreateVfModuleUpdateVfModuleHeatStackIdError_Test() throws Exception { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateHeatStackIdVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule", "VnfAdapter", + "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", + "UpdateVfModuleContrailServiceInstanceFqdn", "UpdateVfModuleHeatStackId") + .hasNotPassed("UpdateVfModuleStatus", "CreateVfModuleBB_End"); + assertThat(pi).isEnded(); - @Test - public void rainyDayCreateVfModuleSDNCQueryVnfModuleError_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks).queryVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule") - .hasNotPassed("CreateVfModule", "VnfAdapter", "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", - "UpdateVfModuleContrailServiceInstanceFqdn","UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayCreateVfModuleVnfAdapterCreateError_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterCreateTasks).createVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule") - .hasNotPassed("VnfAdapter", "CreateNetworkPolicies","UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", - "UpdateVfModuleContrailServiceInstanceFqdn","UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayCreateVfModuleUpdateVfModuleHeatStackIdError_Test() throws Exception { - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + } - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateHeatStackIdVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule", "VnfAdapter", "CreateNetworkPolicies", - "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn","UpdateVfModuleHeatStackId") - .hasNotPassed("UpdateVfModuleStatus", "CreateVfModuleBB_End"); - assertThat(pi).isEnded(); - - } - - @Test - public void rainyDayCreateVfModuleUpdateVfModuleStatusError_Test() throws Exception { - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusCreatedVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule", "VnfAdapter", "CreateNetworkPolicies", - "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn","UpdateVfModuleHeatStackId", - "UpdateVfModuleStatus") - .hasNotPassed("CreateVfModuleBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayCreateVfModuleUpdateVfModuleStatusError_Test() throws Exception { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusCreatedVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule", "VnfAdapter", + "CreateNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", + "UpdateVfModuleContrailServiceInstanceFqdn", "UpdateVfModuleHeatStackId", + "UpdateVfModuleStatus") + .hasNotPassed("CreateVfModuleBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java index 34a17cbb89..c7eb2ac3d1 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java @@ -19,48 +19,54 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class CreateVolumeGroupBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayCreateVolumeGroup_Test() throws InterruptedException { - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter", "Vnf_Adapter", "UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); - assertThat(pi).isEnded(); - assertThat(pi).hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter", "Vnf_Adapter","UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); - } +public class CreateVolumeGroupBBTest extends BaseBPMNTest { + @Test + public void sunnyDayCreateVolumeGroup_Test() throws InterruptedException { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", + "CreateVolumeGroupVnfAdapter", "Vnf_Adapter", "UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", + "CreateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + assertThat(pi).hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter", + "Vnf_Adapter", "UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); + } + + @Test + public void rainyDayCreateVolumeGroup_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterCreateTasks) + .createVolumeGroupRequest(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter") + .hasNotPassed("UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayCreateVolumeGroup_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterCreateTasks).createVolumeGroupRequest(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter") - .hasNotPassed("UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayCreateVolumeGroupUpdateHeatStackIdError_Test() throws Exception { - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateHeatStackIdVolumeGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter", "Vnf_Adapter") - .hasNotPassed("UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayCreateVolumeGroupUpdateHeatStackIdError_Test() throws Exception { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateHeatStackIdVolumeGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi) + .isStarted().hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", + "CreateVolumeGroupVnfAdapter", "Vnf_Adapter") + .hasNotPassed("UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateNetworkBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateNetworkBBTest.java index ad93eec514..548dca2225 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateNetworkBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateNetworkBBTest.java @@ -19,35 +19,36 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class DeactivateNetworkBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayDeactivateNetworkBB_Test() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateNetworkBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("DeactivateNetworkBB_Start", "DeactivateNetworkSDNC", "CallActivity_sdncHandler","DeactivateNetworkAAI", "DeactivateNetworkBB_End"); - assertThat(pi).isEnded(); - } +public class DeactivateNetworkBBTest extends BaseBPMNTest { + @Test + public void sunnyDayDeactivateNetworkBB_Test() throws InterruptedException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateNetworkBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeactivateNetworkBB_Start", "DeactivateNetworkSDNC", + "CallActivity_sdncHandler", "DeactivateNetworkAAI", "DeactivateNetworkBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayDeactivateNetworkBB_Test() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncDeactivateTasks).deactivateNetwork(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateNetworkBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("DeactivateNetworkBB_Start", "DeactivateNetworkSDNC") - .hasNotPassed("DeactivateNetworkAAI", "DeactivateNetworkBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayDeactivateNetworkBB_Test() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncDeactivateTasks) + .deactivateNetwork(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateNetworkBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeactivateNetworkBB_Start", "DeactivateNetworkSDNC") + .hasNotPassed("DeactivateNetworkAAI", "DeactivateNetworkBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateServiceInstanceBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateServiceInstanceBBTest.java index 428713d9a7..ba9beabce7 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateServiceInstanceBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateServiceInstanceBBTest.java @@ -19,8 +19,8 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; @@ -28,13 +28,15 @@ import org.onap.so.bpmn.BaseBPMNTest; /** * Unit test cases for DeActivateServiceInstanceTest.bpmn */ -public class DeactivateServiceInstanceBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayDeactivateServiceInstanceSDNC() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateServiceInstanceBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_DeactivateServiceInstanceBB", "Task_DeactivateServiceInstance_SDNC", "CallActivity_sdncHandler", "Task_DeactivateServiceInstance_AAI", "End_DeactivateServiceInstanceBB"); - assertThat(pi).isEnded(); - } +public class DeactivateServiceInstanceBBTest extends BaseBPMNTest { + @Test + public void sunnyDayDeactivateServiceInstanceSDNC() throws InterruptedException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateServiceInstanceBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_DeactivateServiceInstanceBB", + "Task_DeactivateServiceInstance_SDNC", "CallActivity_sdncHandler", "Task_DeactivateServiceInstance_AAI", + "End_DeactivateServiceInstanceBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVfModuleBBTest.java index c7232e504e..945c212f90 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVfModuleBBTest.java @@ -19,39 +19,39 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class DeactivateVfModuleBBTest extends BaseBPMNTest{ - @Test - public void sunnyDay() throws InterruptedException, IOException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("DeactivateVfModuleBB_Start", "DeactivateVfModule", "CallActivity_sdncHandler", - "UpdateVfModuleDeactivateStatus", "DeactivateVfModuleBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDay() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(BpmnError.class).when(aaiUpdateTasks).updateOrchestrationStatusDeactivateVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("DeactivateVfModuleBB_Start", "DeactivateVfModule", "UpdateVfModuleDeactivateStatus") - .hasNotPassed("DeActivateVfModuleBB_End"); - assertThat(pi).isEnded(); - - } +public class DeactivateVfModuleBBTest extends BaseBPMNTest { + @Test + public void sunnyDay() throws InterruptedException, IOException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeactivateVfModuleBB_Start", "DeactivateVfModule", + "CallActivity_sdncHandler", "UpdateVfModuleDeactivateStatus", "DeactivateVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDay() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(BpmnError.class).when(aaiUpdateTasks) + .updateOrchestrationStatusDeactivateVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("DeactivateVfModuleBB_Start", "DeactivateVfModule", "UpdateVfModuleDeactivateStatus") + .hasNotPassed("DeActivateVfModuleBB_End"); + assertThat(pi).isEnded(); + + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVnfBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVnfBBTest.java index bf5e228cbf..0ecf0448e2 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVnfBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVnfBBTest.java @@ -19,49 +19,48 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class DeactivateVnfBBTest extends BaseBPMNTest{ - @Test - public void sunnyDay() throws InterruptedException, IOException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_DeactivateVnfBB","Task_SDNCAdapterVnfTopologyDeactivate", - "CallActivity_sdncHandler", "Task_DeactivateOrchestrationStatusVnf", "End_DeactivateVnfBB"); - assertThat(pi).isEnded(); - } +public class DeactivateVnfBBTest extends BaseBPMNTest { + @Test + public void sunnyDay() throws InterruptedException, IOException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_DeactivateVnfBB", "Task_SDNCAdapterVnfTopologyDeactivate", + "CallActivity_sdncHandler", "Task_DeactivateOrchestrationStatusVnf", "End_DeactivateVnfBB"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayDeactivateVnfSDNCError_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncDeactivateTasks).deactivateVnf(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_DeactivateVnfBB", "Task_SDNCAdapterVnfTopologyDeactivate") - .hasNotPassed("Task_DeactivateOrchestrationStatusVnf", "End_DeactivateVnfBB"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayDeactivateVnfSDNCError_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncDeactivateTasks) + .deactivateVnf(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_DeactivateVnfBB", "Task_SDNCAdapterVnfTopologyDeactivate") + .hasNotPassed("Task_DeactivateOrchestrationStatusVnf", "End_DeactivateVnfBB"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayDeactivateVnfAAIError_Test() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusAssignedVnf(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_DeactivateVnfBB", "Task_SDNCAdapterVnfTopologyDeactivate","Task_DeactivateOrchestrationStatusVnf") - .hasNotPassed("End_DeactivateVnfBB"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayDeactivateVnfAAIError_Test() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusAssignedVnf(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_DeactivateVnfBB", "Task_SDNCAdapterVnfTopologyDeactivate", + "Task_DeactivateOrchestrationStatusVnf").hasNotPassed("End_DeactivateVnfBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVolumeGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVolumeGroupBBTest.java index 8ed3e0710f..ab0903d645 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVolumeGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeactivateVolumeGroupBBTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,22 +30,23 @@ import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; public class DeactivateVolumeGroupBBTest extends BaseBPMNTest { - @Test - public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("DeactivateVolumeGroupBB_Start", "DeactivateVolumeGroup", "DeactivateVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void sunnyDayAssignVolumeGroup_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeactivateVolumeGroupBB_Start", "DeactivateVolumeGroup", + "DeactivateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayAssignVolumeGroup_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusCreatedVolumeGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("DeactivateVolumeGroupBB_Start", "DeactivateVolumeGroup") - .hasNotPassed("DeactivateVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayAssignVolumeGroup_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusCreatedVolumeGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeactivateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeactivateVolumeGroupBB_Start", "DeactivateVolumeGroup") + .hasNotPassed("DeactivateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteInstanceGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteInstanceGroupBBTest.java index 6dc36ae100..b527e8887e 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteInstanceGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteInstanceGroupBBTest.java @@ -18,36 +18,35 @@ * ============LICENSE_END========================================================= */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class DeleteInstanceGroupBBTest extends BaseBPMNTest{ - @Test - public void sunnyDay() throws InterruptedException, IOException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteInstanceGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("DeleteInstanceGroupBB_Start", "DeleteInstanceGroupNaming", "DeleteInstanceGroupAAI", - "DeleteInstanceGroupBB_End"); - assertThat(pi).isEnded(); - } +public class DeleteInstanceGroupBBTest extends BaseBPMNTest { + @Test + public void sunnyDay() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteInstanceGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeleteInstanceGroupBB_Start", "DeleteInstanceGroupNaming", + "DeleteInstanceGroupAAI", "DeleteInstanceGroupBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDay() throws Exception { - doThrow(BpmnError.class).when(aaiDeleteTasks).deleteInstanceGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteInstanceGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("DeleteInstanceGroupBB_Start", "DeleteInstanceGroupNaming", "DeleteInstanceGroupAAI") - .hasNotPassed("DeleteInstanceGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDay() throws Exception { + doThrow(BpmnError.class).when(aaiDeleteTasks).deleteInstanceGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteInstanceGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("DeleteInstanceGroupBB_Start", "DeleteInstanceGroupNaming", "DeleteInstanceGroupAAI") + .hasNotPassed("DeleteInstanceGroupBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkBBTest.java index ce25a42a26..5a62436bfc 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkBBTest.java @@ -19,33 +19,34 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class DeleteNetworkBBTest extends BaseBPMNTest{ +public class DeleteNetworkBBTest extends BaseBPMNTest { @Test public void sunnyDayDeleteNetwork_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkBB",variables); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("deleteNetwork_startEvent", "deleteNetworkAIC", "updateNetworkAAI", + "deleteNetwork_endEvent"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayDeleteNetwork_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(networkAdapterDeleteTasks) + .deleteNetwork(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("deleteNetwork_startEvent", "deleteNetworkAIC", "updateNetworkAAI", "deleteNetwork_endEvent"); + assertThat(pi).isStarted().hasPassedInOrder("deleteNetwork_startEvent", "deleteNetworkAIC") + .hasNotPassed("updateNetworkAAI", "deleteNetwork_endEvent"); assertThat(pi).isEnded(); } - - @Test - public void rainyDayDeleteNetwork_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(networkAdapterDeleteTasks).deleteNetwork(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("deleteNetwork_startEvent", "deleteNetworkAIC") - .hasNotPassed("updateNetworkAAI", "deleteNetwork_endEvent"); - assertThat(pi).isEnded(); - } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkCollectionBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkCollectionBBTest.java index 388f169b9c..f1da33d75a 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkCollectionBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteNetworkCollectionBBTest.java @@ -19,34 +19,36 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class DeleteNetworkCollectionBBTest extends BaseBPMNTest{ +public class DeleteNetworkCollectionBBTest extends BaseBPMNTest { @Test public void sunnyDayCreateNetworkCollection_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkCollectionBB",variables); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkCollectionBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("deleteNetworkCollection_startEvent", "ServiceTask_delete_NetworkCollectionInstanceGroup", "ServiceTask_delete_NetworkCollection", "deleteNetworkCollection_EndEvent"); + assertThat(pi).isStarted().hasPassedInOrder("deleteNetworkCollection_startEvent", + "ServiceTask_delete_NetworkCollectionInstanceGroup", "ServiceTask_delete_NetworkCollection", + "deleteNetworkCollection_EndEvent"); assertThat(pi).isEnded(); } - @Test - public void rainyDayCreateNetworkCollection_Test() throws Exception { - - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks).deleteInstanceGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkCollectionBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("deleteNetworkCollection_startEvent") - .hasNotPassed("deleteNetworkCollection_EndEvent"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayCreateNetworkCollection_Test() throws Exception { + + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks) + .deleteInstanceGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteNetworkCollectionBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("deleteNetworkCollection_startEvent") + .hasNotPassed("deleteNetworkCollection_EndEvent"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java index 48ae22cb1a..e88df73f39 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java @@ -18,13 +18,12 @@ * ============LICENSE_END========================================================= */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; import java.util.List; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; @@ -33,55 +32,54 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class DeleteVfModuleBBTest extends BaseBPMNTest{ +public class DeleteVfModuleBBTest extends BaseBPMNTest { - @Before - public void before() { - variables.put("auditInventoryNeeded", true); - } + @Before + public void before() { + variables.put("auditInventoryNeeded", true); + } - @Test - public void sunnyDay() throws InterruptedException, IOException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables); - List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") + @Test + public void sunnyDay() throws InterruptedException, IOException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables); + List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") .topic("InventoryDeleteAudit", 60L * 1000L).execute(); while (!tasks.isEmpty()) { for (LockedExternalTask task : tasks) { externalTaskService.complete(task.getId(), "externalWorkerId"); } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryDeleteAudit", 60L * 1000L).execute(); + tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryDeleteAudit", 60L * 1000L) + .execute(); } - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start","ExclusiveGateway_0xrgzm7","ExclusiveGateway_1yvh16a","Check_Audit", - "Setup_Audit_Variable","Audit_Inventory","DeleteVfModuleVnfAdapter", "VnfAdapter", - "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", - "UpdateVfModuleContrailServiceInstanceFqdn", - "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", "DeleteVfModuleBB_End"); - assertThat(pi).isEnded(); - } + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "ExclusiveGateway_0xrgzm7", + "ExclusiveGateway_1yvh16a", "Check_Audit", "Setup_Audit_Variable", "Audit_Inventory", + "DeleteVfModuleVnfAdapter", "VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", + "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn", + "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", "DeleteVfModuleBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDay() throws Exception { - doThrow(BpmnError.class).when(vnfAdapterDeleteTasks).deleteVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables); - List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") + @Test + public void rainyDay() throws Exception { + doThrow(BpmnError.class).when(vnfAdapterDeleteTasks).deleteVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables); + List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") .topic("InventoryDeleteAudit", 60L * 1000L).execute(); while (!tasks.isEmpty()) { for (LockedExternalTask task : tasks) { externalTaskService.complete(task.getId(), "externalWorkerId"); } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryDeleteAudit", 60L * 1000L).execute(); + tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryDeleteAudit", 60L * 1000L) + .execute(); } - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassed("DeleteVfModuleBB_Start", "DeleteVfModuleVnfAdapter") - .hasNotPassed("VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", - "UpdateVfModuleContrailServiceInstanceFqdn","UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", - "DeleteVfModuleBB_End"); - assertThat(pi).isEnded(); - } + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "DeleteVfModuleVnfAdapter").hasNotPassed( + "VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", + "UpdateVfModuleContrailServiceInstanceFqdn", "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", + "DeleteVfModuleBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVolumeGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVolumeGroupBBTest.java index 2336bb54ca..00adcd2c59 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVolumeGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVolumeGroupBBTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,24 +30,26 @@ import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; public class DeleteVolumeGroupBBTest extends BaseBPMNTest { - @Test - public void sunnyDayDeleteVolumeGroup_Test() throws InterruptedException { - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("DeleteVolumeGroupBB_Start", "DeleteVolumeGroupVnfAdapter", "VnfAdapter", "UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", "DeleteVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void sunnyDayDeleteVolumeGroup_Test() throws InterruptedException { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeleteVolumeGroupBB_Start", "DeleteVolumeGroupVnfAdapter", + "VnfAdapter", "UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", "DeleteVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayDeleteVolumeGroup_Test() throws Exception { - mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateOrchestrationStatusAssignedVolumeGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("DeleteVolumeGroupBB_Start", "DeleteVolumeGroupVnfAdapter", "VnfAdapter", "UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI") - .hasNotPassed("DeleteVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayDeleteVolumeGroup_Test() throws Exception { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks) + .updateOrchestrationStatusAssignedVolumeGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DeleteVolumeGroupBB_Start", "DeleteVolumeGroupVnfAdapter", + "VnfAdapter", "UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI") + .hasNotPassed("DeleteVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java new file mode 100644 index 0000000000..8306de4794 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +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.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; +import org.onap.appc.client.lcm.model.Action; + +public class DistributeTrafficActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayDistributeTrafficActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity", + "TaskDistributeTraffic", "DistributeTrafficActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayDistributeTrafficActivity_Test() throws Exception { + variables.put("actionDistributeTraffic", Action.DistributeTraffic); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity", "TaskDistributeTraffic") + .hasNotPassed("DistributeTrafficActivity_End"); + } + +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java new file mode 100644 index 0000000000..195a1ed809 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +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.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; +import org.onap.appc.client.lcm.model.Action; + +public class DistributeTrafficCheckActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayDistributeTrafficCheckActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("DistributeTrafficCheckActivity_Start", "TaskPreProcessActivity", + "TaskDistributeTrafficCheck", "DistributeTrafficCheckActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayDistributeTrafficActivity_Test() throws Exception { + variables.put("actionDistributeTrafficCheck", Action.DistributeTrafficCheck); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables); + assertThat(pi) + .isNotNull().isStarted().hasPassedInOrder("DistributeTrafficCheckActivity_Start", + "TaskPreProcessActivity", "TaskDistributeTrafficCheck") + .hasNotPassed("DistributeTrafficCheckActivity_End"); + } + +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ExecuteBuildingBlockTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ExecuteBuildingBlockTest.java index 03e50591c7..07554cdf97 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ExecuteBuildingBlockTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ExecuteBuildingBlockTest.java @@ -19,14 +19,13 @@ */ 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; @@ -46,86 +45,98 @@ import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective; import org.springframework.beans.factory.annotation.Autowired; public class ExecuteBuildingBlockTest extends BaseBPMNTest { - @Autowired - private TaskService taskService; - @Autowired - private ManagementService managementService; - - @Test - public void runExecuteFlowTest() { - - variables.put("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.CONTINUE); - variables.put("flowToBeCalled", "MockFlow"); - - mockSubprocess("MockFlow", "My Mock Process Name", "GenericStub"); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); - - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StatusPolicy", "CheckOrchestrationStatusValidationResults", "Task_PreValidate", "Call_BBToExecute", "Task_PostValidate", "Task_setHandlingCodeSuccess", "End_ExecuteBuildingBlock"); - assertThat(pi).isEnded(); - - - } - @Test - public void test_sunnyDayExecuteBuildingBlock_silentSuccess() throws Exception { - variables.put("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StatusPolicy", "CheckOrchestrationStatusValidationResults","Task_setHandlingCodeSuccess", "End_ExecuteBuildingBlock") - .hasNotPassed("Call_BBToExecute", "ErrorStart", "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", "ExclusiveGateway_1aonzik", "ErrorEnd2", "Task_SetRetryTimer"); - assertThat(pi).isEnded(); - } - - @Test - @Ignore - 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); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StartEvent_0tmcs9g", "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", "EndEvent_0mvmk3i", "SubProcess_0tv8zda") - .hasNotPassed("StatusPolicy", "CheckOrchestrationStatusValidationResults", "Task_setHandlingCodeSuccess","Call_BBToExecute", "End_ExecuteBuildingBlock", "ExclusiveGateway_0ey4zpt", "Task_SetRetryTimer"); - assertThat(pi).isEnded(); - } - - @Test - @Ignore - public void test_rainyDayExecuteBuildingBlock_retryNoRetriesLeft() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(bbInputSetup).execute(any(DelegateExecution.class)); - - variables.put("handlingCode", "Retry"); - variables.put("RetryCount", 5); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StartEvent_0tmcs9g", "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", "ExclusiveGateway_0ey4zpt", "ErrorEnd2") - .hasNotPassed("StatusPolicy", "CheckOrchestrationStatusValidationResults", "Task_setHandlingCodeSuccess","Call_BBToExecute", "End_ExecuteBuildingBlock", "Task_SetRetryTimer"); - assertThat(pi).isEnded(); - } - - @Test - @Ignore - public void test_rainyDayExecuteBuildingBlock_retryRetriesLeft() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(bbInputSetup).execute(any(DelegateExecution.class)); - - variables.put("handlingCode", "Retry"); - variables.put("RetryCount", 4); - variables.put("RetryDuration", "PT1S"); - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted(); - assertThat(pi).isWaitingAt("IntermediateCatchEvent_RetryTimer"); - Job job = managementService.createJobQuery().activityId("IntermediateCatchEvent_RetryTimer").singleResult(); - assertNotNull(job); - managementService.executeJob(job.getId()); - assertThat(pi).isEnded() - .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "BoundaryEvent_0i3q236", "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", "ExclusiveGateway_0ey4zpt", "Task_SetRetryTimer", "EndEvent_1sez2lh") - .hasNotPassed("StatusPolicy", "CheckOrchestrationStatusValidationResults", "Task_setHandlingCodeSuccess","Call_BBToExecute", "End_ExecuteBuildingBlock", "ErrorEnd2"); - } + @Autowired + private TaskService taskService; + @Autowired + private ManagementService managementService; + + @Test + public void runExecuteFlowTest() { + + variables.put("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.CONTINUE); + variables.put("flowToBeCalled", "MockFlow"); + + mockSubprocess("MockFlow", "My Mock Process Name", "GenericStub"); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); + + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StatusPolicy", + "CheckOrchestrationStatusValidationResults", "Task_PreValidate", "Call_BBToExecute", + "Task_PostValidate", "Task_setHandlingCodeSuccess", "End_ExecuteBuildingBlock"); + assertThat(pi).isEnded(); + + + } + + @Test + public void test_sunnyDayExecuteBuildingBlock_silentSuccess() throws Exception { + variables.put("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StatusPolicy", + "CheckOrchestrationStatusValidationResults", "Task_setHandlingCodeSuccess", "End_ExecuteBuildingBlock") + .hasNotPassed("Call_BBToExecute", "ErrorStart", "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", + "ExclusiveGateway_1aonzik", "ErrorEnd2", "Task_SetRetryTimer"); + assertThat(pi).isEnded(); + } + + @Test + @Ignore + 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); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StartEvent_0tmcs9g", + "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", "EndEvent_0mvmk3i", "SubProcess_0tv8zda") + .hasNotPassed("StatusPolicy", "CheckOrchestrationStatusValidationResults", + "Task_setHandlingCodeSuccess", "Call_BBToExecute", "End_ExecuteBuildingBlock", + "ExclusiveGateway_0ey4zpt", "Task_SetRetryTimer"); + assertThat(pi).isEnded(); + } + + @Test + @Ignore + public void test_rainyDayExecuteBuildingBlock_retryNoRetriesLeft() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(bbInputSetup).execute(any(DelegateExecution.class)); + + variables.put("handlingCode", "Retry"); + variables.put("RetryCount", 5); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "StartEvent_0tmcs9g", + "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", "ExclusiveGateway_0ey4zpt", "ErrorEnd2") + .hasNotPassed("StatusPolicy", "CheckOrchestrationStatusValidationResults", + "Task_setHandlingCodeSuccess", "Call_BBToExecute", "End_ExecuteBuildingBlock", + "Task_SetRetryTimer"); + assertThat(pi).isEnded(); + } + + @Test + @Ignore + public void test_rainyDayExecuteBuildingBlock_retryRetriesLeft() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(bbInputSetup).execute(any(DelegateExecution.class)); + + variables.put("handlingCode", "Retry"); + variables.put("RetryCount", 4); + variables.put("RetryDuration", "PT1S"); + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ExecuteBuildingBlock", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted(); + assertThat(pi).isWaitingAt("IntermediateCatchEvent_RetryTimer"); + Job job = managementService.createJobQuery().activityId("IntermediateCatchEvent_RetryTimer").singleResult(); + assertNotNull(job); + managementService.executeJob(job.getId()); + assertThat(pi).isEnded() + .hasPassedInOrder("Start_ExecuteBuildingBlock", "Task_BBInputSetup", "BoundaryEvent_0i3q236", + "Task_QueryRainyDayTable", "ExclusiveGateway_1aonzik", "ExclusiveGateway_0ey4zpt", + "Task_SetRetryTimer", "EndEvent_1sez2lh") + .hasNotPassed("StatusPolicy", "CheckOrchestrationStatusValidationResults", + "Task_setHandlingCodeSuccess", "Call_BBToExecute", "End_ExecuteBuildingBlock", "ErrorEnd2"); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/FlowCompleteActivity.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/FlowCompleteActivity.java index 26e8fcb5b9..1b0e8ed8a3 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/FlowCompleteActivity.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/FlowCompleteActivity.java @@ -19,37 +19,35 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class FlowCompleteActivity extends BaseBPMNTest{ - @Test - public void sunnyDayFlowCompleteActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("FlowCompleteActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("FlowCompleteActivity_Start", - "TaskUpdateRequestDB", - "FlowCompleteActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayFlowCompleteActivity_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(flowCompletionTasks) - .updateRequestDbStatus(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("FlowCompleteActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("FlowCompleteActivity_Start", - "TaskUpdateRequestDB").hasNotPassed( - "FlowCompleteActivity_End"); - assertThat(pi).isEnded(); - } - +public class FlowCompleteActivity extends BaseBPMNTest { + @Test + public void sunnyDayFlowCompleteActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("FlowCompleteActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("FlowCompleteActivity_Start", "TaskUpdateRequestDB", + "FlowCompleteActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayFlowCompleteActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(flowCompletionTasks) + .updateRequestDbStatus(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("FlowCompleteActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("FlowCompleteActivity_Start", "TaskUpdateRequestDB") + .hasNotPassed("FlowCompleteActivity_End"); + assertThat(pi).isEnded(); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java index c321ca1f71..b10a1007f5 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java @@ -19,12 +19,11 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; - import java.io.IOException; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; @@ -34,27 +33,27 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; public class GenericVnfHealthCheckBBTest extends BaseBPMNTest { - - @Test - public void sunnyDayGenericVnfHealthCheckBBTest() throws InterruptedException, IOException { - - ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_GenericVnfHealthChkBB", "SetParamsHealthCheck", - "Call-AppC-HealthCheck", "End_GenericVnfHealthChkBB"); - assertThat(pi).isEnded(); - } - - @Test - public void genericVnfHealthCheckBBExceptionTest() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(genericVnfHealthCheck).setParamsForGenericVnfHealthCheck(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_GenericVnfHealthChkBB", "SetParamsHealthCheck") - .hasNotPassed("Call-AppC-HealthCheck", "End_GenericVnfHealthChkBB"); - assertThat(pi).isEnded(); - } + + @Test + public void sunnyDayGenericVnfHealthCheckBBTest() throws InterruptedException, IOException { + + ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_GenericVnfHealthChkBB", "SetParamsHealthCheck", + "Call-AppC-HealthCheck", "End_GenericVnfHealthChkBB"); + assertThat(pi).isEnded(); + } + + @Test + public void genericVnfHealthCheckBBExceptionTest() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(genericVnfHealthCheck) + .setParamsForGenericVnfHealthCheck(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_GenericVnfHealthChkBB", "SetParamsHealthCheck") + .hasNotPassed("Call-AppC-HealthCheck", "End_GenericVnfHealthChkBB"); + assertThat(pi).isEnded(); + } } 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 27bb328177..f1bb1462d6 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 @@ -23,7 +23,6 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; 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; @@ -34,37 +33,36 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.springframework.boot.test.mock.mockito.MockBean; -public class HomingBBTest extends BaseBPMNTest{ +public class HomingBBTest extends BaseBPMNTest { + + @Test + public void testHomingV2_success() { + 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).isEnded(); + } - @Test - public void testHomingV2_success(){ - 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).isEnded(); - } + @Test + public void testHomingV2_error_bpmnError() { + doThrow(new BpmnError("MSOWorkflowException")).when(sniroHoming).callSniro(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("HomingBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassed("start", "sniroOofCheck", "startBpmnError", "bpmnErrorSubprocess", + "processMsoWorkflowException", "endBpmnError").hasNotPassed("callReceiveAsync"); + assertThat(pi).isEnded(); + } - @Test - public void testHomingV2_error_bpmnError(){ - doThrow(new BpmnError("MSOWorkflowException")).when(sniroHoming).callSniro(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("HomingBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassed("start", "sniroOofCheck", "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)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("HomingBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassed("start", "sniroOofCheck", "callSniro", "startJavaError", "processJavaException", "javaExceptionSubProcess", "endJavaError") - .hasNotPassed("callReceiveAsync"); - assertThat(pi).isEnded(); - } + @Test + public void testHomingV2_error_javaException() { + doThrow(new RuntimeException("Test")).when(sniroHoming).callSniro(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).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java index faf485f0d7..484f9b8506 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java @@ -19,11 +19,11 @@ */ 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.Matchers.any; import static org.mockito.Mockito.doThrow; - import org.camunda.bpm.engine.ManagementService; import org.camunda.bpm.engine.TaskService; import org.camunda.bpm.engine.delegate.BpmnError; @@ -37,67 +37,60 @@ import org.springframework.beans.factory.annotation.Autowired; import org.onap.so.bpmn.BaseBPMNTest; -public class PauseForManualTaskActivityTest extends BaseBPMNTest{ - private static final String TIMEOUT_10_S = "PT10S"; - - @Autowired - protected ManagementService managementService; - - @Autowired - protected TaskService taskService; - - @Test - public void sunnyDayPauseForManualTaskTimeout_Test() throws InterruptedException { - variables.put("taskTimeout", TIMEOUT_10_S); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables); - assertThat(pi).isNotNull(); - BpmnAwareAssertions.assertThat(pi).isWaitingAt("ManualUserTask"); - Task task = taskService.createTaskQuery().active().list().get(0); - assertThat(pi).task().isNotNull(); - assertNotNull(task); - - Job job = managementService.createJobQuery().activityId("ManualTaskTimer").singleResult(); - assertNotNull(job); - managementService.executeJob(job.getId()); - - assertThat(pi).isStarted().hasPassedInOrder("PauseForManualTaskActivity_Start", - "UpdateDbStatusToPendingManualTask", - "CreateExternalTicket", - "ManualTaskTimer", - "UpdateDBStatusToTimeout", - "ThrowTimeoutError"); - } - - @Test - public void sunnyDayPauseForManualTaskCompleted_Test() throws InterruptedException { - variables.put("taskTimeout", TIMEOUT_10_S); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables); - assertThat(pi).isNotNull(); - BpmnAwareAssertions.assertThat(pi).isWaitingAt("ManualUserTask"); - assertThat(pi).task().isNotNull(); - Task task = taskService.createTaskQuery().active().list().get(0); - assertNotNull(task); - taskService.complete(task.getId()); - - assertThat(pi).isStarted().hasPassedInOrder("PauseForManualTaskActivity_Start", - "UpdateDbStatusToPendingManualTask", - "CreateExternalTicket", - "ManualUserTask", - "UpdateDbStatusToInProgress", - "PauseForManualTaskActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayPauseForManualTask_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(manualHandlingTasks).createExternalTicket((any(DelegateExecution.class))); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("PauseForManualTaskActivity_Start", - "UpdateDbStatusToPendingManualTask", - "CreateExternalTicket").hasNotPassed( - "ManualUserTask", - "UpdateDbStatusToInProgress", - "PauseForManualTaskActivity_End"); - } - +public class PauseForManualTaskActivityTest extends BaseBPMNTest { + private static final String TIMEOUT_10_S = "PT10S"; + + @Autowired + protected ManagementService managementService; + + @Autowired + protected TaskService taskService; + + @Test + public void sunnyDayPauseForManualTaskTimeout_Test() throws InterruptedException { + variables.put("taskTimeout", TIMEOUT_10_S); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables); + assertThat(pi).isNotNull(); + BpmnAwareAssertions.assertThat(pi).isWaitingAt("ManualUserTask"); + Task task = taskService.createTaskQuery().active().list().get(0); + assertThat(pi).task().isNotNull(); + assertNotNull(task); + + Job job = managementService.createJobQuery().activityId("ManualTaskTimer").singleResult(); + assertNotNull(job); + managementService.executeJob(job.getId()); + + assertThat(pi).isStarted().hasPassedInOrder("PauseForManualTaskActivity_Start", + "UpdateDbStatusToPendingManualTask", "CreateExternalTicket", "ManualTaskTimer", + "UpdateDBStatusToTimeout", "ThrowTimeoutError"); + } + + @Test + public void sunnyDayPauseForManualTaskCompleted_Test() throws InterruptedException { + variables.put("taskTimeout", TIMEOUT_10_S); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables); + assertThat(pi).isNotNull(); + BpmnAwareAssertions.assertThat(pi).isWaitingAt("ManualUserTask"); + assertThat(pi).task().isNotNull(); + Task task = taskService.createTaskQuery().active().list().get(0); + assertNotNull(task); + taskService.complete(task.getId()); + + assertThat(pi).isStarted().hasPassedInOrder("PauseForManualTaskActivity_Start", + "UpdateDbStatusToPendingManualTask", "CreateExternalTicket", "ManualUserTask", + "UpdateDbStatusToInProgress", "PauseForManualTaskActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayPauseForManualTask_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(manualHandlingTasks) + .createExternalTicket((any(DelegateExecution.class))); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("PauseForManualTaskActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("PauseForManualTaskActivity_Start", "UpdateDbStatusToPendingManualTask", + "CreateExternalTicket") + .hasNotPassed("ManualUserTask", "UpdateDbStatusToInProgress", "PauseForManualTaskActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/SDNCHandlerTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/SDNCHandlerTest.java index ad9f97f951..199ada5909 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/SDNCHandlerTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/SDNCHandlerTest.java @@ -22,13 +22,11 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.Mockito.doReturn; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; - import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation; @@ -37,41 +35,45 @@ import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.MapperException; import org.onap.so.client.sdnc.beans.SDNCRequest; import org.onap.so.client.sdnc.endpoint.SDNCTopology; - import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -public class SDNCHandlerTest extends BaseBPMNTest{ - @Test - public void sunnyDay_SDNCHandler_Sync_Final_Test() throws InterruptedException, MapperException, BadResponseException, IOException { - final String sdncResponse = new String(Files.readAllBytes(Paths.get("src/test/resources/SDNCClientPut200Response.json"))); - doReturn(sdncResponse).when(sdncClient).post(createSDNCRequest().getSDNCPayload(),SDNCTopology.CONFIGURATION); - Map<String, Object> startVariables = new HashMap<>(); - startVariables.put("SDNCRequest", createSDNCRequest()); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("SDNCHandler", startVariables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("SDNC_Start","SNDC_SetupCallback","Call_SDNC","isAsync_Gateway","SDNC_End").isEnded(); - } +public class SDNCHandlerTest extends BaseBPMNTest { + @Test + public void sunnyDay_SDNCHandler_Sync_Final_Test() + throws InterruptedException, MapperException, BadResponseException, IOException { + final String sdncResponse = + new String(Files.readAllBytes(Paths.get("src/test/resources/SDNCClientPut200Response.json"))); + doReturn(sdncResponse).when(sdncClient).post(createSDNCRequest().getSDNCPayload(), SDNCTopology.CONFIGURATION); + Map<String, Object> startVariables = new HashMap<>(); + startVariables.put("SDNCRequest", createSDNCRequest()); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("SDNCHandler", startVariables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("SDNC_Start", "SNDC_SetupCallback", "Call_SDNC", "isAsync_Gateway", "SDNC_End") + .isEnded(); + } - public SDNCRequest createSDNCRequest(){ - SDNCRequest request = new SDNCRequest(); - request.setCorrelationName("correlationName"); - request.setCorrelationValue("correlationValue"); - request.setTopology(SDNCTopology.CONFIGURATION); - ObjectMapper mapper = new ObjectMapper(); - try { - GenericResourceApiServiceOperationInformation sdncReq = - mapper.readValue(Files.readAllBytes(Paths.get("src/test/resources/SDNC_Client_Request.json")), GenericResourceApiServiceOperationInformation.class); - request.setSDNCPayload(sdncReq); - } catch (JsonParseException e) { + public SDNCRequest createSDNCRequest() { + SDNCRequest request = new SDNCRequest(); + request.setCorrelationName("correlationName"); + request.setCorrelationValue("correlationValue"); + request.setTopology(SDNCTopology.CONFIGURATION); + ObjectMapper mapper = new ObjectMapper(); + try { + GenericResourceApiServiceOperationInformation sdncReq = + mapper.readValue(Files.readAllBytes(Paths.get("src/test/resources/SDNC_Client_Request.json")), + GenericResourceApiServiceOperationInformation.class); + request.setSDNCPayload(sdncReq); + } catch (JsonParseException e) { - } catch (JsonMappingException e) { + } catch (JsonMappingException e) { - } catch (IOException e) { + } catch (IOException e) { - } + } - return request; - } + return request; + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetworkBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetworkBBTest.java index b65f30fa9a..c20a56af66 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetworkBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetworkBBTest.java @@ -19,36 +19,38 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doThrow; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class UnassignNetworkBBTest extends BaseBPMNTest { +public class UnassignNetworkBBTest extends BaseBPMNTest { @Test public void sunnyDayAssignNetwork_Test() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignNetworkBB",variables); + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignNetworkBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignNetworkBB","Task_VfModuleRelatioship","Task_GetCloudRegionVersion","Task_SNDCUnAssign","CallActivity_sdncHandlerCall","Task_DeleteNetwork","End_UnassignNetworkBB"); + assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignNetworkBB", "Task_VfModuleRelatioship", + "Task_GetCloudRegionVersion", "Task_SNDCUnAssign", "CallActivity_sdncHandlerCall", "Task_DeleteNetwork", + "End_UnassignNetworkBB"); assertThat(pi).isEnded(); } - @Test - public void rainyDayAssignNetwork_Test() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(unassignNetworkBB).checkRelationshipRelatedTo(any(BuildingBlockExecution.class), eq("vf-module")); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignNetworkBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("Start_UnassignNetworkBB", "Task_VfModuleRelatioship") - .hasNotPassed("End_UnassignNetworkBB"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayAssignNetwork_Test() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(unassignNetworkBB) + .checkRelationshipRelatedTo(any(BuildingBlockExecution.class), eq("vf-module")); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignNetworkBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignNetworkBB", "Task_VfModuleRelatioship") + .hasNotPassed("End_UnassignNetworkBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignServiceInstanceBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignServiceInstanceBBTest.java index 854c4f9c2e..3b503618f1 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignServiceInstanceBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignServiceInstanceBBTest.java @@ -19,8 +19,8 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; @@ -28,15 +28,17 @@ import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.common.DelegateExecutionImpl; -public class UnassignServiceInstanceBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayUnassignServiceInstanceSDNC() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - BuildingBlockExecution bbe = new DelegateExecutionImpl(new ExecutionImpl()); - variables.put("gBuildingBlockExecution", bbe); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignServiceInstanceBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignServiceInstanceBB", "Task_SdncUnassignServiceInstance", "CallActivity_sdncHandlerCall", "Task_AAIDeleteServiceInstance", "End_UnassignServiceInstanceBB"); - assertThat(pi).isEnded(); - } +public class UnassignServiceInstanceBBTest extends BaseBPMNTest { + @Test + public void sunnyDayUnassignServiceInstanceSDNC() throws InterruptedException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + BuildingBlockExecution bbe = new DelegateExecutionImpl(new ExecutionImpl()); + variables.put("gBuildingBlockExecution", bbe); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignServiceInstanceBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignServiceInstanceBB", + "Task_SdncUnassignServiceInstance", "CallActivity_sdncHandlerCall", "Task_AAIDeleteServiceInstance", + "End_UnassignServiceInstanceBB"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVfModuleBBTest.java index 89089770b1..e6fae0b005 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVfModuleBBTest.java @@ -19,50 +19,47 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class UnassignVfModuleBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayUnassignVfModule_Test() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("UnassignVfModuleBB_Start", - "UnassignVfModule", - "CallActivity_sdncHandler", - "DeleteVfModule", - "UnassignVfModuleBB_End"); - assertThat(pi).isEnded(); - } +public class UnassignVfModuleBBTest extends BaseBPMNTest { + @Test + public void sunnyDayUnassignVfModule_Test() throws InterruptedException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("UnassignVfModuleBB_Start", "UnassignVfModule", + "CallActivity_sdncHandler", "DeleteVfModule", "UnassignVfModuleBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayUnassignVfModuleAAIDeleteFailed_Test() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks) + .deleteVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("UnassignVfModuleBB_Start", "UnassignVfModule", "DeleteVfModule") + .hasNotPassed("UnassignVfModuleBB_End"); + assertThat(pi).isEnded(); + } - @Test - public void rainyDayUnassignVfModuleAAIDeleteFailed_Test() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks).deleteVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("UnassignVfModuleBB_Start", "UnassignVfModule", "DeleteVfModule") - .hasNotPassed("UnassignVfModuleBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayUnassignVfModuleSDNCUnassignFailed_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncUnassignTasks).unassignVfModule(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("UnassignVfModuleBB_Start", "UnassignVfModule") - .hasNotPassed("DeleteVfModule", "UnassignVfModuleBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void rainyDayUnassignVfModuleSDNCUnassignFailed_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncUnassignTasks) + .unassignVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("UnassignVfModuleBB_Start", "UnassignVfModule") + .hasNotPassed("DeleteVfModule", "UnassignVfModuleBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVnfBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVnfBBTest.java index d508f4fcd7..2a6435218d 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVnfBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVnfBBTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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; @@ -30,49 +30,48 @@ import org.junit.Test; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -public class UnassignVnfBBTest extends BaseBPMNTest{ - @Test - public void sunnyDayUnassignVnf_Test() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("UnassignVnfBB_Start", - "UnassignVnf", - "CallActivity_sdncHandlerCall", - "DeleteVnfInstanceGroups", - "DeleteVnf", - "UnassignVnfBB_End"); - assertThat(pi).isEnded(); - } - - @Test - @Ignore - public void rainyDayUnassignVnfInstanceGroupsDeleteFailed_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(unassignVnf).deleteInstanceGroups(any(BuildingBlockExecution.class)); //.deleteVnf(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); - assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("UnassignVnfBB_Start", "UnassignVnf", "DeleteVnfInstanceGroups") - .hasNotPassed("DeleteVnf","UnassignVnfBB_End"); - - } - - @Test - public void rainyDayUnassignVnfAAIDeleteFailed_Test() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks).deleteVnf(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("UnassignVnfBB_Start", "UnassignVnf", "DeleteVnfInstanceGroups","DeleteVnf") - .hasNotPassed("UnassignVnfBB_End"); - } - - @Test - public void rainyDayUnassignVnfSDNCUnassignFailed_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncUnassignTasks).unassignVnf(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("UnassignVnfBB_Start", "UnassignVnf") - .hasNotPassed("DeleteVnfInstanceGroups","DeleteVnf", "UnassignVnfBB_End"); - assertThat(pi).isEnded(); - } +public class UnassignVnfBBTest extends BaseBPMNTest { + @Test + public void sunnyDayUnassignVnf_Test() throws InterruptedException { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("UnassignVnfBB_Start", "UnassignVnf", + "CallActivity_sdncHandlerCall", "DeleteVnfInstanceGroups", "DeleteVnf", "UnassignVnfBB_End"); + assertThat(pi).isEnded(); + } + + @Test + @Ignore + public void rainyDayUnassignVnfInstanceGroupsDeleteFailed_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(unassignVnf) + .deleteInstanceGroups(any(BuildingBlockExecution.class)); // .deleteVnf(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("UnassignVnfBB_Start", "UnassignVnf", "DeleteVnfInstanceGroups") + .hasNotPassed("DeleteVnf", "UnassignVnfBB_End"); + + } + + @Test + public void rainyDayUnassignVnfAAIDeleteFailed_Test() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks) + .deleteVnf(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("UnassignVnfBB_Start", "UnassignVnf", "DeleteVnfInstanceGroups", "DeleteVnf") + .hasNotPassed("UnassignVnfBB_End"); + } + + @Test + public void rainyDayUnassignVnfSDNCUnassignFailed_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncUnassignTasks) + .unassignVnf(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVnfBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("UnassignVnfBB_Start", "UnassignVnf") + .hasNotPassed("DeleteVnfInstanceGroups", "DeleteVnf", "UnassignVnfBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVolumeGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVolumeGroupBBTest.java index 6b176293fe..1cc0788613 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVolumeGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignVolumeGroupBBTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,23 +30,24 @@ import org.onap.so.bpmn.BaseBPMNTest; import org.onap.so.bpmn.common.BuildingBlockExecution; public class UnassignVolumeGroupBBTest extends BaseBPMNTest { - @Test - public void sunnyDayUnassignVolumeGroup_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("UnassignVolumeGroupBB_Start", "UnassignVolumeGroup", "UnassignVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayUnassignVolumeGroup_Test() throws InterruptedException { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks).deleteVolumeGroup(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVolumeGroupBB", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted() - .hasPassedInOrder("UnassignVolumeGroupBB_Start", "UnassignVolumeGroup") - .hasNotPassed("UnassignVolumeGroupBB_End"); - assertThat(pi).isEnded(); - } + @Test + public void sunnyDayUnassignVolumeGroup_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("UnassignVolumeGroupBB_Start", "UnassignVolumeGroup", + "UnassignVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayUnassignVolumeGroup_Test() throws InterruptedException { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiDeleteTasks) + .deleteVolumeGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("UnassignVolumeGroupBB_Start", "UnassignVolumeGroup") + .hasNotPassed("UnassignVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UpdateNetworkBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UpdateNetworkBBTest.java index 1bb065ae06..d9194587c6 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UpdateNetworkBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UpdateNetworkBBTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -33,27 +33,28 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; public class UpdateNetworkBBTest extends BaseBPMNTest { @Test public void updateNetworkBBTest() throws InterruptedException { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("UpdateNetworkBB", variables); - assertThat(processInstance).isNotNull(); - assertThat(processInstance).isStarted().hasPassedInOrder( - "UpdateNetworkBB_Start", "SDNCChangeAssignNetwork", "CallActivity_sdncHandlerCallChangeAssign", - "QueryVpnBindingAAI", "QueryNetworkPolicyAAI", "QueryNetworkTableRefAAI", - "Create_Network_ServiceTask", "CallActivity_NetworkAdapterRestV1", "ServiceTask_ProcessResponse", "Update_Network_AAI_ServiceTask", "UpdateNetworkBB_End"); - assertThat(processInstance).isEnded(); + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("UpdateNetworkBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("UpdateNetworkBB_Start", "SDNCChangeAssignNetwork", + "CallActivity_sdncHandlerCallChangeAssign", "QueryVpnBindingAAI", "QueryNetworkPolicyAAI", + "QueryNetworkTableRefAAI", "Create_Network_ServiceTask", "CallActivity_NetworkAdapterRestV1", + "ServiceTask_ProcessResponse", "Update_Network_AAI_ServiceTask", "UpdateNetworkBB_End"); + assertThat(processInstance).isEnded(); } - @Test - public void updateNetworkBBExceptionTest() throws Exception { - mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiQueryTasks).queryNetworkVpnBinding(any(BuildingBlockExecution.class)); - - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("UpdateNetworkBB", variables); - assertThat(processInstance).isStarted().hasPassedInOrder( - "UpdateNetworkBB_Start", "SDNCChangeAssignNetwork", "CallActivity_sdncHandlerCallChangeAssign", - "QueryVpnBindingAAI") - .hasNotPassed("QueryNetworkPolicyAAI", "QueryNetworkTableRefAAI", - "UpdateNetworkAdapter", "UpdateNetworkAAI", "UpdateNetworkBB_End"); - assertThat(processInstance).isEnded(); - } + @Test + public void updateNetworkBBExceptionTest() throws Exception { + mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiQueryTasks) + .queryNetworkVpnBinding(any(BuildingBlockExecution.class)); + + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("UpdateNetworkBB", variables); + assertThat(processInstance).isStarted() + .hasPassedInOrder("UpdateNetworkBB_Start", "SDNCChangeAssignNetwork", + "CallActivity_sdncHandlerCallChangeAssign", "QueryVpnBindingAAI") + .hasNotPassed("QueryNetworkPolicyAAI", "QueryNetworkTableRefAAI", "UpdateNetworkAdapter", + "UpdateNetworkAAI", "UpdateNetworkBB_End"); + assertThat(processInstance).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java index ac4499bf89..55d21471fc 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java @@ -19,37 +19,39 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class VNFCheckClosedLoopDisabledFlagActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckClosedLoopDisabledFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFCheckClosedLoopDisabledFlagActivity_Start", - "TaskCheckClosedLoopDisabledFlagActivity", - "VNFCheckClosedLoopDisabledFlagActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) - .checkVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckClosedLoopDisabledFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFCheckClosedLoopDisabledFlagActivity_Start", - "TaskCheckClosedLoopDisabledFlagActivity").hasNotPassed( - "VNFCheckClosedLoopDisabledFlagActivity_End"); - assertThat(pi).isEnded(); - } - +public class VNFCheckClosedLoopDisabledFlagActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = + runtimeService.startProcessInstanceByKey("VNFCheckClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckClosedLoopDisabledFlagActivity_Start", + "TaskCheckClosedLoopDisabledFlagActivity", "VNFCheckClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .checkVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class)); + ProcessInstance pi = + runtimeService.startProcessInstanceByKey("VNFCheckClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("VNFCheckClosedLoopDisabledFlagActivity_Start", + "TaskCheckClosedLoopDisabledFlagActivity") + .hasNotPassed("VNFCheckClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java index 050d3124f6..6f66df6c0d 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; @@ -30,27 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class VNFCheckInMaintFlagActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFCheckInMaintFlagActivity_Start", - "TaskCheckInMaintFlag", - "VNFCheckInMaintFlagActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFCheckInMaintFlagActivity_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) - .checkVnfInMaintFlag(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFCheckInMaintFlagActivity_Start", - "TaskCheckInMaintFlag").hasNotPassed( - "VNFCheckInMaintFlagActivity_End"); - assertThat(pi).isEnded(); - } - +public class VNFCheckInMaintFlagActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckInMaintFlagActivity_Start", "TaskCheckInMaintFlag", + "VNFCheckInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFCheckInMaintFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .checkVnfInMaintFlag(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckInMaintFlagActivity_Start", "TaskCheckInMaintFlag") + .hasNotPassed("VNFCheckInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java index e43f47fa6a..8bfe6c020f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java @@ -19,37 +19,36 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class VNFCheckPserversLockedFlagActivity extends BaseBPMNTest{ - @Test - public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFCheckPserversLockedFlagActivity_Start", - "TaskCheckPserversLockedFlagActivity", - "VNFCheckPserversLockedFlagActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFCheckPserversLockedFlagActivity_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) - .checkVnfPserversLockedFlag(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFCheckPserversLockedFlagActivity_Start", - "TaskCheckPserversLockedFlagActivity").hasNotPassed( - "VNFCheckPserversLockedFlagActivity_End"); - assertThat(pi).isEnded(); - } - +public class VNFCheckPserversLockedFlagActivity extends BaseBPMNTest { + @Test + public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckPserversLockedFlagActivity_Start", + "TaskCheckPserversLockedFlagActivity", "VNFCheckPserversLockedFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFCheckPserversLockedFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .checkVnfPserversLockedFlag(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("VNFCheckPserversLockedFlagActivity_Start", "TaskCheckPserversLockedFlagActivity") + .hasNotPassed("VNFCheckPserversLockedFlagActivity_End"); + assertThat(pi).isEnded(); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java index 8e76f8f4d1..0b17e3e099 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFHealthCheckActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFHealthCheckActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFHealthCheckActivity_Start", - "TaskPreProcessActivity", - "TaskHealthCheck", - "VNFHealthCheckActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFHealthCheckActivity_Test() throws Exception { - variables.put("actionHealthCheck", Action.HealthCheck); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFHealthCheckActivity_Start", - "TaskPreProcessActivity", - "TaskHealthCheck").hasNotPassed( - "VNFHealthCheckActivity_End"); - } - +public class VNFHealthCheckActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFHealthCheckActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity", + "TaskHealthCheck", "VNFHealthCheckActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFHealthCheckActivity_Test() throws Exception { + variables.put("actionHealthCheck", Action.HealthCheck); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity", "TaskHealthCheck") + .hasNotPassed("VNFHealthCheckActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java index f36a72fc01..45cf44848f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFLockActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFLockActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFLockActivity_Start", - "TaskPreProcessActivity", - "TaskLock", - "VNFLockActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFLockActivity_Test() throws Exception { - variables.put("actionLock", Action.Lock); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFLockActivity_Start", - "TaskPreProcessActivity", - "TaskLock").hasNotPassed( - "VNFLockActivity_End"); - } - +public class VNFLockActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFLockActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity", "TaskLock", + "VNFLockActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFLockActivity_Test() throws Exception { + variables.put("actionLock", Action.Lock); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity", "TaskLock") + .hasNotPassed("VNFLockActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java index 2d9b952509..fb462bc02f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFQuiesceTrafficActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFQuiesceTrafficActivity_Start", - "TaskPreProcessActivity", - "TaskQuiesceTraffic", - "VNFQuiesceTrafficActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception { - variables.put("actionQuiesceTraffic", Action.QuiesceTraffic); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFQuiesceTrafficActivity_Start", - "TaskPreProcessActivity", - "TaskQuiesceTraffic").hasNotPassed( - "VNFQuiesceTrafficActivity_End"); - } - +public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFQuiesceTrafficActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity", + "TaskQuiesceTraffic", "VNFQuiesceTrafficActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception { + variables.put("actionQuiesceTraffic", Action.QuiesceTraffic); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity", "TaskQuiesceTraffic") + .hasNotPassed("VNFQuiesceTrafficActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java index d541cdf834..61d88a5770 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,29 +30,26 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFResumeTrafficActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFResumeTrafficActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFResumeTrafficActivity_Start", - "TaskPreProcessActivity", - "TaskResumeTraffic", - "VNFResumeTrafficActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFResumeTrafficActivity_Test() throws Exception { - variables.put("actionResumeTraffic", Action.ResumeTraffic); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFResumeTrafficActivity_Start", - "TaskPreProcessActivity", - "TaskResumeTraffic").hasNotPassed( - "VNFResumeTrafficActivity_End"); - - } - +public class VNFResumeTrafficActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFResumeTrafficActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity", + "TaskResumeTraffic", "VNFResumeTrafficActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFResumeTrafficActivity_Test() throws Exception { + variables.put("actionResumeTraffic", Action.ResumeTraffic); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity", "TaskResumeTraffic") + .hasNotPassed("VNFResumeTrafficActivity_End"); + + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java index 8e56051f47..001dc70b54 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java @@ -19,37 +19,38 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class VNFSetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetClosedLoopDisabledFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFSetClosedLoopDisabledFlagActivity_Start", - "TaskSetClosedLoopDisabledFlagActivity", - "VNFSetClosedLoopDisabledFlagActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) - .modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetClosedLoopDisabledFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFSetClosedLoopDisabledFlagActivity_Start", - "TaskSetClosedLoopDisabledFlagActivity").hasNotPassed( - "VNFSetInMaintFlagActivity_End"); - assertThat(pi).isEnded(); - } +public class VNFSetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = + runtimeService.startProcessInstanceByKey("VNFSetClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFSetClosedLoopDisabledFlagActivity_Start", + "TaskSetClosedLoopDisabledFlagActivity", "VNFSetClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class)); + ProcessInstance pi = + runtimeService.startProcessInstanceByKey("VNFSetClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("VNFSetClosedLoopDisabledFlagActivity_Start", "TaskSetClosedLoopDisabledFlagActivity") + .hasNotPassed("VNFSetInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetInMaintFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetInMaintFlagActivityTest.java index 2dc6420688..1df0ea2e65 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetInMaintFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetInMaintFlagActivityTest.java @@ -19,37 +19,35 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class VNFSetInMaintFlagActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFSetInMaintFlagActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFSetInMaintFlagActivity_Start", - "TaskSetInMaint", - "VNFSetInMaintFlagActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFSetInMaintFlagActivity_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) - .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFSetInMaintFlagActivity_Start", - "TaskSetInMaint").hasNotPassed( - "VNFSetInMaintFlagActivity_End"); - assertThat(pi).isEnded(); - } - +public class VNFSetInMaintFlagActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFSetInMaintFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFSetInMaintFlagActivity_Start", "TaskSetInMaint", + "VNFSetInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFSetInMaintFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFSetInMaintFlagActivity_Start", "TaskSetInMaint") + .hasNotPassed("VNFSetInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java index f6bfd04d03..6f1e076c02 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFSnapShotActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFSnapShotActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFSnapShotActivity_Start", - "TaskPreProcessActivity", - "TaskSnapShot", - "VNFSnapShotActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFSnapShotActivity_Test() throws Exception { - variables.put("actionSnapshot", Action.Snapshot); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFSnapShotActivity_Start", - "TaskPreProcessActivity", - "TaskSnapShot").hasNotPassed( - "VNFSnapShotActivity_End"); - } - +public class VNFSnapShotActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFSnapShotActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity", + "TaskSnapShot", "VNFSnapShotActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFSnapShotActivity_Test() throws Exception { + variables.put("actionSnapshot", Action.Snapshot); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity", "TaskSnapShot") + .hasNotPassed("VNFSnapShotActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java index 6e4be69a91..a8e974d63a 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFStartActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFStartActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFStartActivity_Start", - "TaskPreProcessActivity", - "TaskStart", - "VNFStartActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFStartActivity_Test() throws Exception { - variables.put("actionStart", Action.Start); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStartActivity_Start", - "TaskPreProcessActivity", - "TaskStart").hasNotPassed( - "VNFStartActivity_End"); - } - +public class VNFStartActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFStartActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity", "TaskStart", + "VNFStartActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFStartActivity_Test() throws Exception { + variables.put("actionStart", Action.Start); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity", "TaskStart") + .hasNotPassed("VNFStartActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java index 3bc5940493..58dfff8bd7 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFStopActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFStopActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFStopActivity_Start", - "TaskPreProcessActivity", - "TaskStop", - "VNFStopActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFStopActivity_Test() throws Exception { - variables.put("actionStop", Action.Stop); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStopActivity_Start", - "TaskPreProcessActivity", - "TaskStop").hasNotPassed( - "VNFStopActivity_End"); - } - +public class VNFStopActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFStopActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity", "TaskStop", + "VNFStopActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFStopActivity_Test() throws Exception { + variables.put("actionStop", Action.Stop); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity", "TaskStop") + .hasNotPassed("VNFStopActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java index d0db70b2aa..b6faf1b806 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFUnlockActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFUnlockActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUnlockActivity_Start", - "TaskPreProcessActivity", - "TaskUnlock", - "VNFUnlockActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFUnlockActivity_Test() throws Exception { - variables.put("actionUnlock", Action.Unlock); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUnlockActivity_Start", - "TaskPreProcessActivity", - "TaskUnlock").hasNotPassed( - "VNFUnlockActivity_End"); - } - +public class VNFUnlockActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFUnlockActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity", "TaskUnlock", + "VNFUnlockActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFUnlockActivity_Test() throws Exception { + variables.put("actionUnlock", Action.Unlock); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity", "TaskUnlock") + .hasNotPassed("VNFUnlockActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java index 4c9b33c2c7..035d124402 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java @@ -19,36 +19,38 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doThrow; - import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class VNFUnsetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFUnsetClosedLoopDisabledFlagActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInClosedLoopDisabledFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetClosedLoopDisabledFlagActivity_Start", - "TaskVNFUnsetClosedLoopDisabledFlagActivity", - "VNFUnsetClosedLoopDisabledFlagActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFUnsetClosedLoopFlag_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) - .modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInClosedLoopDisabledFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetClosedLoopDisabledFlagActivity_Start", - "TaskVNFUnsetClosedLoopDisabledFlagActivity").hasNotPassed( - "VNFUnsetClosedLoopDisabledFlagActivity_End"); - assertThat(pi).isEnded(); - } +public class VNFUnsetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFUnsetClosedLoopDisabledFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = + runtimeService.startProcessInstanceByKey("VNFUnsetInClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetClosedLoopDisabledFlagActivity_Start", + "TaskVNFUnsetClosedLoopDisabledFlagActivity", "VNFUnsetClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFUnsetClosedLoopFlag_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class)); + ProcessInstance pi = + runtimeService.startProcessInstanceByKey("VNFUnsetInClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("VNFUnsetClosedLoopDisabledFlagActivity_Start", + "TaskVNFUnsetClosedLoopDisabledFlagActivity") + .hasNotPassed("VNFUnsetClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetInMaintFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetInMaintFlagActivityTest.java index fcb328fa0b..15623bab3d 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetInMaintFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetInMaintFlagActivityTest.java @@ -19,37 +19,35 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; -public class VNFUnsetInMaintFlagActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFUnsetInMaintFlagActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetInMaintFlagActivity_Start", - "TaskUnsetInMaint", - "VNFUnsetInMaintFlagActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFUnsetInMaintFlag_Test() throws Exception { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) - .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetInMaintFlagActivity_Start", - "TaskUnsetInMaint").hasNotPassed( - "VNFUnsetInMaintFlagActivity_End"); - assertThat(pi).isEnded(); - } - +public class VNFUnsetInMaintFlagActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFUnsetInMaintFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetInMaintFlagActivity_Start", "TaskUnsetInMaint", + "VNFUnsetInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFUnsetInMaintFlag_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetInMaintFlagActivity_Start", "TaskUnsetInMaint") + .hasNotPassed("VNFUnsetInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java index c68196c3bf..4d99147761 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java @@ -23,7 +23,6 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; 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.Test; @@ -31,30 +30,27 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFUpgradeBackupActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFUpgradeBackupActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradeBackup", - "VNFUpgradeBackupActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFUpgradeBackupActivity_Test() throws Exception { - variables.put("actionUpgradeBackup", Action.UpgradeBackup); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradeBackup").hasNotPassed( - "VNFUpgradeBackupActivity_End"); - assertThat(pi).isEnded(); - } - +public class VNFUpgradeBackupActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFUpgradeBackupActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity", + "TaskUpgradeBackup", "VNFUpgradeBackupActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFUpgradeBackupActivity_Test() throws Exception { + variables.put("actionUpgradeBackup", Action.UpgradeBackup); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity", "TaskUpgradeBackup") + .hasNotPassed("VNFUpgradeBackupActivity_End"); + assertThat(pi).isEnded(); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java index 5fa930712d..c87cc44f29 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFUpgradePostCheckActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradePostCheck", - "VNFUpgradePostCheckActivity_End"); - - } - - @Test - public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception { - variables.put("actionUpgradePostCheck", Action.UpgradePostCheck); - - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradePostCheck").hasNotPassed( - "VNFUpgradePostCheckActivity_End"); - } - +public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFUpgradePostCheckActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start", + "TaskPreProcessActivity", "TaskUpgradePostCheck", "VNFUpgradePostCheckActivity_End"); + + } + + @Test + public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception { + variables.put("actionUpgradePostCheck", Action.UpgradePostCheck); + + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFUpgradePostCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePostCheck") + .hasNotPassed("VNFUpgradePostCheckActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java index 40f5df8dae..79fc43396d 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFUpgradePreCheckActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePreCheckActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradePreCheck", - "VNFUpgradePreCheckActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception { - variables.put("actionUpgradePreCheck", Action.UpgradePreCheck); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradePreCheckActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradePreCheck").hasNotPassed( - "VNFUpgradePreCheckActivity_End"); - } - +public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFUpgradePreCheckActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity", + "TaskUpgradePreCheck", "VNFUpgradePreCheckActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception { + variables.put("actionUpgradePreCheck", Action.UpgradePreCheck); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePreCheck") + .hasNotPassed("VNFUpgradePreCheckActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java index 91e6bf40be..b550185702 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java @@ -19,10 +19,10 @@ */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -30,28 +30,25 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.BaseBPMNTest; import org.onap.appc.client.lcm.model.Action; -public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest{ - @Test - public void sunnyDayVNFUpgradeSoftwareActivity_Test() throws InterruptedException { - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables); - assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradeSoftware", - "VNFUpgradeSoftwareActivity_End"); - assertThat(pi).isEnded(); - } - - @Test - public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception { - variables.put("actionUpgradeSoftware", Action.UpgradeSoftware); - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) - .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables); - assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", - "TaskPreProcessActivity", - "TaskUpgradeSoftware").hasNotPassed( - "VNFUpgradeSoftwareActivity_End"); - } - +public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFUpgradeSoftwareActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity", + "TaskUpgradeSoftware", "VNFUpgradeSoftwareActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception { + variables.put("actionUpgradeSoftware", Action.UpgradeSoftware); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks) + .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables); + assertThat(pi).isNotNull().isStarted() + .hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity", "TaskUpgradeSoftware") + .hasNotPassed("VNFUpgradeSoftwareActivity_End"); + } + } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java index 39625ac9bf..8ad4e0f07f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; 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.Test; @@ -32,19 +32,22 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; public class VnfAdapterTest extends BaseBPMNTest { @Test public void vnfAdapterCreatedTest() { - mockSubprocess("vnfAdapterRestV1", "Mocked vnfAdapterRestV1", "GenericStub"); + mockSubprocess("vnfAdapterRestV1", "Mocked vnfAdapterRestV1", "GenericStub"); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VnfAdapter", variables); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VnfAdapter", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VnfAdapter_Start", "PreProcessRequest", "Call_vnfAdapterRestV1","PostProcessResponse", "VnfAdapter_End"); + assertThat(pi).isStarted().hasPassedInOrder("VnfAdapter_Start", "PreProcessRequest", "Call_vnfAdapterRestV1", + "PostProcessResponse", "VnfAdapter_End"); assertThat(pi).isEnded(); } - + @Test public void vnfAdapterErrorTest() { - doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterImpl).preProcessVnfAdapter(any(BuildingBlockExecution.class)); - ProcessInstance pi = runtimeService.startProcessInstanceByKey("VnfAdapter", variables); + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterImpl) + .preProcessVnfAdapter(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VnfAdapter", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VnfAdapter_Start", "PreProcessRequest").hasNotPassed("VnfAdapter_End"); + assertThat(pi).isStarted().hasPassedInOrder("VnfAdapter_Start", "PreProcessRequest") + .hasNotPassed("VnfAdapter_End"); } } |