Merge "delete redundant test dependency"
authorSeshu Kumar M <seshu.kumar.m@huawei.com>
Thu, 20 Jan 2022 10:33:37 +0000 (10:33 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 20 Jan 2022 10:33:37 +0000 (10:33 +0000)
27 files changed:
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HealthCheckBB.bpmn
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/Resource.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java
common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
docs/developer_info/E2E_Network_Slicing_Understanding.rst [new file with mode: 0644]
docs/images/architecture-choices-e2e-slicing.png [new file with mode: 0644]
docs/images/e2e-network-slicing-architecture.png [new file with mode: 0644]
docs/images/lifecycle-of-network-slice-instance.png [new file with mode: 0644]
docs/images/slicing-option1.png [new file with mode: 0644]
docs/images/slicing-option2.png [new file with mode: 0644]
so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroValidator.java
so-optimization-clients/src/test/java/org/onap/so/client/oof/OofValidatorTest.java
so-optimization-clients/src/test/java/org/onap/so/client/sniro/SniroValidatorTest.java [new file with mode: 0644]

index d39da5e..603e11d 100644 (file)
@@ -1250,7 +1250,7 @@ public class BBInputSetup implements JavaDelegate {
                 || requestAction.equalsIgnoreCase("activateFabricConfiguration")
                 || requestAction.equalsIgnoreCase("recreateInstance")
                 || requestAction.equalsIgnoreCase("replaceInstance")
-                || requestAction.equalsIgnoreCase("upgradeInstance")) {
+                || requestAction.equalsIgnoreCase("upgradeInstance") || requestAction.equalsIgnoreCase("healthCheck")) {
             return getGBBMacroExistingService(executeBB, lookupKeyMap, bbName, requestAction,
                     requestDetails.getCloudConfiguration());
         }
@@ -1564,6 +1564,9 @@ public class BBInputSetup implements JavaDelegate {
                     break;
                 }
             }
+        } else if (bbName.equals("HealthCheckBB")
+                && (VNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope())) {
+            this.setisHelmforHealthCheckBB(service, serviceInstance, gBB);
         }
         if (executeBB.getWorkflowResourceIds() != null) {
             parameter.setResourceId(executeBB.getWorkflowResourceIds().getNetworkCollectionId());
@@ -2112,6 +2115,28 @@ public class BBInputSetup implements JavaDelegate {
         return collection;
     }
 
+    private void setisHelmforHealthCheckBB(Service service, ServiceInstance serviceInstance, GeneralBuildingBlock gBB) {
+        for (GenericVnf vnf : serviceInstance.getVnfs()) {
+            for (VfModule vfModule : vnf.getVfModules()) {
+                String vnfModelCustomizationUUID =
+                        this.bbInputSetupUtils.getAAIGenericVnf(vnf.getVnfId()).getModelCustomizationId();
+                ModelInfo vnfModelInfo = new ModelInfo();
+                vnfModelInfo.setModelCustomizationUuid(vnfModelCustomizationUUID);
+                this.mapCatalogVnf(vnf, vnfModelInfo, service);
+                String vfModuleCustomizationUUID = this.bbInputSetupUtils
+                        .getAAIVfModule(vnf.getVnfId(), vfModule.getVfModuleId()).getModelCustomizationId();
+                ModelInfo vfModuleModelInfo = new ModelInfo();
+                vfModuleModelInfo.setModelCustomizationId(vfModuleCustomizationUUID);
+                this.mapCatalogVfModule(vfModule, vfModuleModelInfo, service, vnfModelCustomizationUUID);
+                if (vfModule.getModelInfoVfModule() != null && vfModule.getModelInfoVfModule().getModelName() != null
+                        && vfModule.getModelInfoVfModule().getModelName().contains("helm")) {
+                    gBB.getRequestContext().setIsHelm(true);
+                    break;
+                }
+            }
+        }
+    }
+
     protected void mapL3Networks(List<AAIResourceUri> list, List<L3Network> l3Networks) {
         for (AAIResourceUri aaiResourceUri : list) {
             l3Networks.add(this.mapL3Network(aaiResourceUri));
index 8272bd3..fad2e55 100755 (executable)
@@ -1,30 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1bvx7yi" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.0.0">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0gwymqy" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.7.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.14.0">
   <bpmn:process id="HealthCheckBB" name="HealthCheckBB" isExecutable="true">
-    <bpmn:startEvent id="StartEvent_1" name="HealthCheckBB_start">
-      <bpmn:outgoing>Flow_0gd6hy6</bpmn:outgoing>
+    <bpmn:startEvent id="Event_0rgusxn" name="HealthCheckBB_start">
+      <bpmn:outgoing>Flow_0udh4cd</bpmn:outgoing>
     </bpmn:startEvent>
-    <bpmn:endEvent id="Event_1dklvvk" name="HealthCheckBB_end">
-      <bpmn:incoming>Flow_0xiyno7</bpmn:incoming>
+    <bpmn:endEvent id="Event_0o1nl3y" name="HealthCheckBB_end">
+      <bpmn:incoming>Flow_0n17e0q</bpmn:incoming>
+      <bpmn:incoming>Flow_131rwms</bpmn:incoming>
     </bpmn:endEvent>
-    <bpmn:sequenceFlow id="Flow_0gd6hy6" sourceRef="StartEvent_1" targetRef="Activity_11hkwkn" />
-    <bpmn:subProcess id="Activity_1pto2qh" name="Error Handling&#10;&#10;" triggeredByEvent="true">
-      <bpmn:startEvent id="Event_0929aqj">
-        <bpmn:outgoing>Flow_05rbrsm</bpmn:outgoing>
-        <bpmn:errorEventDefinition id="ErrorEventDefinition_0k0ly65" />
+    <bpmn:subProcess id="Activity_0tw4ak3" name="Error Handling&#10;&#10;" triggeredByEvent="true">
+      <bpmn:startEvent id="Event_1v6jbfd">
+        <bpmn:outgoing>Flow_03ogqmx</bpmn:outgoing>
+        <bpmn:errorEventDefinition id="ErrorEventDefinition_1xw7dq4" />
       </bpmn:startEvent>
-      <bpmn:endEvent id="Event_1s698ql">
-        <bpmn:incoming>Flow_05rbrsm</bpmn:incoming>
-        <bpmn:terminateEventDefinition id="TerminateEventDefinition_0mn6xgi" />
+      <bpmn:endEvent id="Event_0wwzune">
+        <bpmn:incoming>Flow_03ogqmx</bpmn:incoming>
+        <bpmn:terminateEventDefinition id="TerminateEventDefinition_0c07ott" />
       </bpmn:endEvent>
-      <bpmn:sequenceFlow id="Flow_05rbrsm" sourceRef="Event_0929aqj" targetRef="Event_1s698ql" />
+      <bpmn:sequenceFlow id="Flow_03ogqmx" sourceRef="Event_1v6jbfd" targetRef="Event_0wwzune" />
     </bpmn:subProcess>
-    <bpmn:serviceTask id="Activity_11hkwkn" name="Prepare Cnf Adapter request" camunda:expression="${CnfHealthCheckTasks.prepareCnfAdaperRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
-      <bpmn:incoming>Flow_0gd6hy6</bpmn:incoming>
-      <bpmn:outgoing>Flow_1aqdd5k</bpmn:outgoing>
+    <bpmn:serviceTask id="Activity_0pnb21p" name="Prepare Cnf Adapter request" camunda:expression="${CnfHealthCheckTasks.prepareCnfAdaperRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>Flow_0jxw1lb</bpmn:incoming>
+      <bpmn:outgoing>Flow_0uoe9ga</bpmn:outgoing>
     </bpmn:serviceTask>
-    <bpmn:sequenceFlow id="Flow_1aqdd5k" sourceRef="Activity_11hkwkn" targetRef="Activity_08mgs1k" />
-    <bpmn:callActivity id="Activity_08mgs1k" name="Call CNFAdapterAsyncCall" calledElement="CNFAdapterAsyncCall">
+    <bpmn:callActivity id="Activity_07txikn" name="Call CNFAdapterAsyncCall" calledElement="CNFAdapterAsyncCall">
       <bpmn:extensionElements>
         <camunda:in source="apiPath" target="apiPath" />
         <camunda:in source="cnfRequestPayload" target="cnfRequestPayload" />
         <camunda:in source="messageType" target="messageType" />
         <camunda:in source="true" target="isDebugLogEnabled" />
       </bpmn:extensionElements>
-      <bpmn:incoming>Flow_1aqdd5k</bpmn:incoming>
-      <bpmn:outgoing>Flow_1jeui7e</bpmn:outgoing>
+      <bpmn:incoming>Flow_0uoe9ga</bpmn:incoming>
+      <bpmn:outgoing>Flow_0t6f6l8</bpmn:outgoing>
     </bpmn:callActivity>
-    <bpmn:serviceTask id="Activity_0w4hy3d" name="Process Response" camunda:expression="${CnfHealthCheckTasks.processAsyncResponse(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
-      <bpmn:incoming>Flow_1jeui7e</bpmn:incoming>
-      <bpmn:outgoing>Flow_0xiyno7</bpmn:outgoing>
+    <bpmn:serviceTask id="Activity_1qd7k3z" name="Process Response" camunda:expression="${CnfHealthCheckTasks.processAsyncResponse(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>Flow_0t6f6l8</bpmn:incoming>
+      <bpmn:outgoing>Flow_0n17e0q</bpmn:outgoing>
     </bpmn:serviceTask>
-    <bpmn:sequenceFlow id="Flow_0xiyno7" sourceRef="Activity_0w4hy3d" targetRef="Event_1dklvvk" />
-    <bpmn:sequenceFlow id="Flow_1jeui7e" sourceRef="Activity_08mgs1k" targetRef="Activity_0w4hy3d" />
+    <bpmn:exclusiveGateway id="Gateway_07e5xls" name="Check If Is Helm" default="Flow_131rwms">
+      <bpmn:incoming>Flow_0udh4cd</bpmn:incoming>
+      <bpmn:outgoing>Flow_131rwms</bpmn:outgoing>
+      <bpmn:outgoing>Flow_0jxw1lb</bpmn:outgoing>
+    </bpmn:exclusiveGateway>
+    <bpmn:sequenceFlow id="Flow_0udh4cd" sourceRef="Event_0rgusxn" targetRef="Gateway_07e5xls" />
+    <bpmn:sequenceFlow id="Flow_0n17e0q" sourceRef="Activity_1qd7k3z" targetRef="Event_0o1nl3y" />
+    <bpmn:sequenceFlow id="Flow_131rwms" name="No Helm" sourceRef="Gateway_07e5xls" targetRef="Event_0o1nl3y" />
+    <bpmn:sequenceFlow id="Flow_0jxw1lb" name="Yes Helm" sourceRef="Gateway_07e5xls" targetRef="Activity_0pnb21p">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isHelm")}</bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+    <bpmn:sequenceFlow id="Flow_0uoe9ga" sourceRef="Activity_0pnb21p" targetRef="Activity_07txikn" />
+    <bpmn:sequenceFlow id="Flow_0t6f6l8" sourceRef="Activity_07txikn" targetRef="Activity_1qd7k3z" />
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="HealthCheckBB">
-      <bpmndi:BPMNEdge id="Flow_1jeui7e_di" bpmnElement="Flow_1jeui7e">
-        <di:waypoint x="600" y="120" />
-        <di:waypoint x="680" y="120" />
+      <bpmndi:BPMNEdge id="Flow_0udh4cd_di" bpmnElement="Flow_0udh4cd">
+        <di:waypoint x="218" y="150" />
+        <di:waypoint x="245" y="150" />
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_0xiyno7_di" bpmnElement="Flow_0xiyno7">
-        <di:waypoint x="780" y="120" />
-        <di:waypoint x="842" y="120" />
+      <bpmndi:BPMNEdge id="Flow_0n17e0q_di" bpmnElement="Flow_0n17e0q">
+        <di:waypoint x="780" y="150" />
+        <di:waypoint x="870" y="150" />
+        <di:waypoint x="870" y="202" />
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_1aqdd5k_di" bpmnElement="Flow_1aqdd5k">
-        <di:waypoint x="400" y="120" />
-        <di:waypoint x="500" y="120" />
+      <bpmndi:BPMNEdge id="Flow_131rwms_di" bpmnElement="Flow_131rwms">
+        <di:waypoint x="270" y="175" />
+        <di:waypoint x="270" y="220" />
+        <di:waypoint x="852" y="220" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="264" y="195" width="43" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0jxw1lb_di" bpmnElement="Flow_0jxw1lb">
+        <di:waypoint x="295" y="150" />
+        <di:waypoint x="350" y="150" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="299" y="132" width="47" height="14" />
+        </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_0gd6hy6_di" bpmnElement="Flow_0gd6hy6">
-        <di:waypoint x="218" y="120" />
-        <di:waypoint x="300" y="120" />
+      <bpmndi:BPMNEdge id="Flow_0uoe9ga_di" bpmnElement="Flow_0uoe9ga">
+        <di:waypoint x="450" y="150" />
+        <di:waypoint x="500" y="150" />
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="Event_1dklvvk_di" bpmnElement="Event_1dklvvk">
-        <dc:Bounds x="842" y="102" width="36" height="36" />
+      <bpmndi:BPMNEdge id="Flow_0t6f6l8_di" bpmnElement="Flow_0t6f6l8">
+        <di:waypoint x="600" y="150" />
+        <di:waypoint x="680" y="150" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="Event_0rgusxn_di" bpmnElement="Event_0rgusxn">
+        <dc:Bounds x="182" y="132" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="820" y="145" width="85" height="27" />
+          <dc:Bounds x="156" y="175" width="90" height="27" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
-        <dc:Bounds x="182" y="102" width="36" height="36" />
+      <bpmndi:BPMNShape id="Event_0o1nl3y_di" bpmnElement="Event_0o1nl3y">
+        <dc:Bounds x="852" y="202" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="156" y="145" width="90" height="27" />
+          <dc:Bounds x="831" y="245" width="84" height="27" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Activity_11hkwkn_di" bpmnElement="Activity_11hkwkn">
-        <dc:Bounds x="300" y="80" width="100" height="80" />
+      <bpmndi:BPMNShape id="Activity_0pnb21p_di" bpmnElement="Activity_0pnb21p">
+        <dc:Bounds x="350" y="110" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_07txikn_di" bpmnElement="Activity_07txikn">
+        <dc:Bounds x="500" y="110" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Activity_0f7poou_di" bpmnElement="Activity_08mgs1k">
-        <dc:Bounds x="500" y="80" width="100" height="80" />
+      <bpmndi:BPMNShape id="Activity_1qd7k3z_di" bpmnElement="Activity_1qd7k3z">
+        <dc:Bounds x="680" y="110" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Activity_0w4hy3d_di" bpmnElement="Activity_0w4hy3d">
-        <dc:Bounds x="680" y="80" width="100" height="80" />
+      <bpmndi:BPMNShape id="Gateway_07e5xls_di" bpmnElement="Gateway_07e5xls" isMarkerVisible="true">
+        <dc:Bounds x="245" y="125" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="230" y="95" width="81" height="14" />
+        </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Activity_1pto2qh_di" bpmnElement="Activity_1pto2qh" isExpanded="true">
-        <dc:Bounds x="280" y="250" width="460" height="135" />
+      <bpmndi:BPMNShape id="Activity_0tw4ak3_di" bpmnElement="Activity_0tw4ak3" isExpanded="true">
+        <dc:Bounds x="280" y="280" width="460" height="135" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="Flow_05rbrsm_di" bpmnElement="Flow_05rbrsm">
-        <di:waypoint x="398" y="324" />
-        <di:waypoint x="632" y="324" />
+      <bpmndi:BPMNEdge id="Flow_03ogqmx_di" bpmnElement="Flow_03ogqmx">
+        <di:waypoint x="398" y="354" />
+        <di:waypoint x="632" y="354" />
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="Event_0929aqj_di" bpmnElement="Event_0929aqj">
-        <dc:Bounds x="362" y="306" width="36" height="36" />
+      <bpmndi:BPMNShape id="Event_1v6jbfd_di" bpmnElement="Event_1v6jbfd">
+        <dc:Bounds x="362" y="336" width="36" height="36" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Event_1s698ql_di" bpmnElement="Event_1s698ql">
-        <dc:Bounds x="632" y="306" width="36" height="36" />
+      <bpmndi:BPMNShape id="Event_0wwzune_di" bpmnElement="Event_0wwzune">
+        <dc:Bounds x="632" y="336" width="36" height="36" />
       </bpmndi:BPMNShape>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
index f17bfc2..71dd9b1 100644 (file)
@@ -254,7 +254,7 @@ else{
        
        //TNFH slice profile instance creation
        TNFH_sliceProfileInstance.setServiceInstanceId(TNFH_sliceProfileInstanceId)
-       sliceInstanceName = "sliceprofile _ "+TNFH_sliceProfileId
+       sliceInstanceName = "sliceprofile_"+TNFH_sliceProfileId
        TNFH_sliceProfileInstance.setServiceInstanceName(sliceInstanceName)
        serviceType = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "sST")
        TNFH_sliceProfileInstance.setServiceType(serviceType)
@@ -271,7 +271,7 @@ else{
        
        //TNMH slice profile instance creation
        TNMH_sliceProfileInstance.setServiceInstanceId(TNMH_sliceProfileInstanceId)
-       sliceInstanceName = "sliceprofile _ "+TNMH_sliceProfileId
+       sliceInstanceName = "sliceprofile_"+TNMH_sliceProfileId
        TNMH_sliceProfileInstance.setServiceInstanceName(sliceInstanceName)
        serviceType = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "sST")
        TNMH_sliceProfileInstance.setServiceType(serviceType)
index ed1c2b2..9800428 100644 (file)
@@ -654,7 +654,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                logger.debug("completed AN service instance build " + ANServiceInstance.toString())
                //create RAN NF NSSI
                ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId") as String)
-               sliceInstanceName = "nssi_"+execution.getVariable("ANNF_modelName")
+                String ANNF_nssiInstanceId = UUID.randomUUID().toString()
+               sliceInstanceName = "nssi_an_nf_" + ANNF_nssiInstanceId
                ANNFServiceInstance.setServiceInstanceName(sliceInstanceName)
                ANNFServiceInstance.setServiceType(execution.getVariable("sst") as String)
                ANNFServiceInstance.setOrchestrationStatus(serviceStatus)
@@ -663,7 +664,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                ANNFServiceInstance.setServiceRole(serviceRole)
                snssaiList = jsonUtil.StringArrayToList(execution.getVariable("snssaiList") as String)
                snssai = snssaiList.get(0)
-               ANNFServiceInstance.setEnvironmentContext(snssai)
+               ANNFServiceInstance.setEnvironmentContext(execution.getVariable("networkType") as String)
                 ANNFServiceInstance.setModelInvariantId(execution.getVariable("ANNF_modelInvariantUuid"))
                 ANNFServiceInstance.setModelVersionId(execution.getVariable("ANNF_modelUuid"))
                ANNFServiceInstance.setWorkloadContext("AN_NF")
@@ -1032,7 +1033,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                RU_ep.setType(type)
                RU_ep.setIpAddress("192.168.100.4")
                RU_ep.setLogicalInterfaceId("1234")
-               RU_ep.setNextHop("Host1")
+               RU_ep.setNextHop("networkId-providerId-10-clientId-0-topologyId-2-nodeId-10.1.1.1-ltpId-512")
                RU_ep.setPrefixLength(prefixLength)
                RU_ep.setAddressFamily(addressFamily)
                //DU Ingress
@@ -1046,7 +1047,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                DU_ep.setType(type)
                DU_ep.setIpAddress("192.168.100.5")
                DU_ep.setLogicalInterfaceId("1234")
-               DU_ep.setNextHop("Host2")
+               DU_ep.setNextHop("networkId-providerId-20-clientId-0-topologyId-2-nodeId-10.2.1.2-ltpId-512")
                DU_ep.setPrefixLength(prefixLength)
                DU_ep.setAddressFamily(addressFamily)
                //MH RAN end point update
@@ -1062,7 +1063,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                 DUEG_ep.setLogicalInterfaceId("1234")
                 DUEG_ep.setPrefixLength(prefixLength)
                 DUEG_ep.setAddressFamily(addressFamily)
-               DUEG_ep.setNextHop("Host3")
+               DUEG_ep.setNextHop("networkId-providerId-10-clientId-0-topologyId-2-nodeId-10.1.1.1-ltpId-512")
                //CUIN
                String CUIN_routeId = UUID.randomUUID().toString()
                execution.setVariable("tranportEp_ID_CUIN", CUIN_routeId)
@@ -1073,7 +1074,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                CUIN_ep.setType(type)
                CUIN_ep.setIpAddress("192.168.100.6")
                CUIN_ep.setLogicalInterfaceId("1234")
-               CUIN_ep.setNextHop("Host4")
+               CUIN_ep.setNextHop("networkId-providerId-20-clientId-0-topologyId-2-nodeId-10.2.1.2-ltpId-512")
                CUIN_ep.setPrefixLength(prefixLength)
                CUIN_ep.setAddressFamily(addressFamily)
                try {
index bc155c5..a22819f 100644 (file)
@@ -444,6 +444,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
                 .sST(sliceTaskInfo.getSliceProfile().getSST() ?: sliceParams.getServiceProfile().get("sST") as String)
                 .nssiName(sliceTaskInfo.getSuggestNssiId() ? sliceTaskInfo.getNSSTInfo().getName() : allocateAnNssi.getNssiName())
                 .nssiId(sliceTaskInfo.getSuggestNssiId())
+                .resourceSharingLevel(sliceParams.serviceProfile.get("resourceSharingLevel") as String)
                 .build()
 
         nbiRequest.setServiceInfo(serviceInfo)
@@ -590,6 +591,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
         serviceInfo.nssiId = sliceTaskInfo.suggestNssiId //if shared
         serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST")
         serviceInfo.nssiName = allocateCnNssi.nssiName
+        serviceInfo.resourceSharingLevel = sliceParams.serviceProfile.get("resourceSharingLevel")
 
         nbiRequest.setServiceInfo(serviceInfo)
         nbiRequest.setEsrInfo(esrInfo)
@@ -727,6 +729,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
         serviceInfo.nssiId = sliceTaskInfo.suggestNssiId
         serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST")
         serviceInfo.nssiName = "nssi_tn" + execution.getVariable("sliceServiceInstanceName")
+        serviceInfo.resourceSharingLevel = sliceParams.serviceProfile.get("resourceSharingLevel")
 
         nbiRequest.setServiceInfo(serviceInfo)
         nbiRequest.setEsrInfo(esrInfo)
index 35b4199..5476cb5 100644 (file)
@@ -117,7 +117,7 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{
             String modelUuid = modelInfo.getModelUuid()
             ss.setModelInvariantId(modelInvariantUuid)
             ss.setModelVersionId(modelUuid)
-            String serviceInstanceLocationid = serviceProfile.get("pLMNIdList")
+            String serviceInstanceLocationid = serviceProfile.get("plmnIdList")
             ss.setServiceInstanceLocationId(serviceInstanceLocationid)
             String snssai = serviceProfile.get("sNSSAI")
             ss.setEnvironmentContext(snssai)
index 2588d07..7571f07 100644 (file)
@@ -21,6 +21,7 @@
 package org.onap.so.bpmn.infrastructure.scripts
 
 import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.core.type.TypeReference
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.onap.aai.domain.yang.ServiceInstance
 import org.onap.so.beans.nsmf.EsrInfo
@@ -271,24 +272,22 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
      * @return
      */
     private SubnetType convertServiceCategory(String serviceCategory){
-        if("CN NSST".equals(serviceCategory)){
+        if(serviceCategory ==~ /CN.*/){
             return SubnetType.CN
         }
-        if ("AN NF NSST".equals(serviceCategory)){
-            return SubnetType.AN_NF
-        }
-        if ("AN NSST".equals(serviceCategory)){
+        if (serviceCategory ==~ /AN.*/){
             return SubnetType.AN
         }
-        if ("TN BH NSST".equals(serviceCategory)){
+        if (serviceCategory ==~ /TN.*BH.*/){
             return SubnetType.TN_BH
         }
-        if("TN MH NSST".equals(serviceCategory)){
+        if(serviceCategory ==~ /TN.*MH.*/){
             return SubnetType.TN_MH
         }
-        if("TN FH NSST".equals(serviceCategory)){
+        if(serviceCategory ==~ /TN.*FH.*/){
             return SubnetType.TN_FH
         }
+
         return null
     }
 
@@ -475,7 +474,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
      */
     void getNSSISelectionCap4AN(DelegateExecution execution) {
 
-        def vendor = execution.getVariable("vendor") as String
+       SliceTaskParamsAdapter sliceParams =
+                execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
+
+        def vendor = sliceParams.anSliceTaskInfo.vendor
 
         String strRequest = buildNSSISelectionReq(vendor, NetworkType.ACCESS)
 
@@ -497,7 +499,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
      */
     void getNSSISelectionCap4TN(DelegateExecution execution) {
 
-        def vendor = execution.getVariable("vendor") as String
+        SliceTaskParamsAdapter sliceParams =
+                execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
+
+        def vendor = sliceParams.tnBHSliceTaskInfo.vendor
 
         String strRequest = buildNSSISelectionReq(vendor, NetworkType.TRANSPORT)
 
@@ -518,7 +523,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
      */
     void getNSSISelectionCap4CN(DelegateExecution execution) {
 
-        def vendor = execution.getVariable("vendor") as String
+        SliceTaskParamsAdapter sliceParams =
+                execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
+
+        def vendor = sliceParams.cnSliceTaskInfo.vendor
 
         String strRequest = buildNSSISelectionReq(vendor, NetworkType.CORE)
 
@@ -626,8 +634,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
         Map nssiNeedHandlerInfo = nssiNeedHandlerInfos.get(currNssiIndex) as Map
 
         TemplateInfo nsstInfo = nssiNeedHandlerInfo.get("nsstInfo") as TemplateInfo
-        Map<String, Object> profileInfo = nssiNeedHandlerInfo.get("sliceProfile") as Map
-        //profileInfo.remove("profileId")
+        SliceProfileAdapter sliceProfileInfo = nssiNeedHandlerInfo.get("sliceProfile") as SliceProfileAdapter
+
+        Map profileInfo = objectMapper.convertValue(sliceProfileInfo, new TypeReference<Map<String, Object>>() {});
+        while (profileInfo.values().remove(null));
 
         String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
         logger.debug( "get NSI option OOF Url: " + urlString)
@@ -641,8 +651,8 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
         String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution)
         execution.setVariable("nssiSelection_timeout", timeout)
 
-        String oofRequest = oofUtils.buildSelectNSSIRequest(requestId, nsstInfo, messageType,
-                profileInfo, 600)
+        String oofRequest = oofUtils.buildSelectNSSIRequest(requestId, messageType, nsstInfo.UUID,
+                nsstInfo.invariantUUID, nsstInfo.name, profileInfo)
 
         execution.setVariable("nssiSelection_oofRequest", oofRequest)
         logger.debug("Sending request to OOF: " + oofRequest)
@@ -672,13 +682,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
 
         Map<String, Object> resMap = objectMapper.readValue(OOFResponse, Map.class)
         List<Map<String, Object>> nsiSolutions = (List<Map<String, Object>>) resMap.get("solutions")
-        Map<String, Object> solution = nsiSolutions.get(0)
-
-        String resourceSharingLevel = execution.getVariable("resourceSharingLevel")
-        Boolean isSharable = resourceSharingLevel == "shared"   //todo
 
-        if (isSharable && solution != null) {
-            processNssiResult(sliceTaskParams, subnetType, solution)
+        if(nsiSolutions.size()>=1) {
+        Map<String,Object> solution = nsiSolutions.get(0) as Map
+        processNssiResult(sliceTaskParams, subnetType, solution)
         }
 
         execution.setVariable("sliceTaskParams", sliceTaskParams)
index e0c2b77..d6e94ef 100644 (file)
@@ -377,7 +377,6 @@ class TnNssmfUtils {
             logger.debug("mso.workflow.TnNssmf.enableSDNCNetworkConfig is undefined, so use default value (true)")
             enableSdnc = "true"
         }
-       enableSdnc = "false"
         logger.debug("setEnableSdncConfig: enableSdnc=" + enableSdnc)
 
         execution.setVariable("enableSdnc", enableSdnc)
index 2a8852a..57ff837 100644 (file)
@@ -40,6 +40,8 @@ public class Resource implements Serializable {
     private String cvnfModuleCustomizationId;
     private String instanceName;
     private String modelInvariantId;
+    private String modelVersionId;
+    private String modelCustomizationId;
     private int processingPriority;
     private Resource parent;
     private List<Resource> children;
@@ -140,6 +142,21 @@ public class Resource implements Serializable {
         this.modelInvariantId = modelInvariantId;
     }
 
+    public String getModelVersionId() {
+        return modelVersionId;
+    }
+
+    public void setModelVersionId(String modelVersionId) {
+        this.modelVersionId = modelVersionId;
+    }
+
+    public String getModelCustomizationId() {
+        return modelCustomizationId;
+    }
+
+    public void setModelCustomizationId(String modelCustomizationId) {
+        this.modelCustomizationId = modelCustomizationId;
+    }
 
     public int getProcessingPriority() {
         return processingPriority == 0 ? (isBaseVfModule() ? Integer.MIN_VALUE + 1 : 0) : processingPriority;
index b5ad8d8..cb4ee01 100644 (file)
@@ -38,6 +38,8 @@ import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException
 import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
 import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
 import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
 import org.onap.so.client.exception.ExceptionBuilder;
@@ -199,6 +201,7 @@ public class ServiceEBBLoader {
             var serviceResource =
                     new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false, null);
             serviceResource.setModelInvariantId(serviceInstanceAAI.getModelInvariantId());
+            serviceResource.setModelVersionId(serviceInstanceAAI.getModelVersionId());
             resourceList.add(serviceResource);
             traverseServiceInstanceMSOVnfs(resourceList, serviceResource, aaiResourceIds, serviceInstanceMSO);
             traverseServiceInstanceMSOPnfs(resourceList, serviceResource, aaiResourceIds, serviceInstanceMSO);
@@ -206,8 +209,15 @@ public class ServiceEBBLoader {
                 for (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network network : serviceInstanceMSO
                         .getNetworks()) {
                     aaiResourceIds.add(new Pair<>(WorkflowType.NETWORK, network.getNetworkId()));
-                    resourceList
-                            .add(new Resource(WorkflowType.NETWORK, network.getNetworkId(), false, serviceResource));
+                    Resource networkResource =
+                            new Resource(WorkflowType.NETWORK, network.getNetworkId(), false, serviceResource);
+                    ModelInfoNetwork modelInfoNetwork = network.getModelInfoNetwork();
+                    if (modelInfoNetwork != null) {
+                        networkResource.setModelCustomizationId(modelInfoNetwork.getModelCustomizationUUID());
+                        networkResource.setModelVersionId(modelInfoNetwork.getModelUUID());
+                        networkResource.setModelCustomizationId(modelInfoNetwork.getModelCustomizationUUID());
+                    }
+                    resourceList.add(networkResource);
                 }
             }
             if (serviceInstanceMSO.getCollection() != null) {
@@ -252,6 +262,8 @@ public class ServiceEBBLoader {
             GenericVnf genericVnf = bbInputSetupUtils.getAAIGenericVnf(vnf.getVnfId());
             Resource vnfResource = new Resource(WorkflowType.VNF, vnf.getVnfId(), false, serviceResource);
             vnfResource.setVnfCustomizationId(genericVnf.getModelCustomizationId());
+            vnfResource.setModelCustomizationId(genericVnf.getModelCustomizationId());
+            vnfResource.setModelVersionId(genericVnf.getModelVersionId());
             resourceList.add(vnfResource);
             traverseVnfModules(resourceList, vnfResource, aaiResourceIds, vnf);
             if (vnf.getVolumeGroups() != null) {
@@ -272,7 +284,13 @@ public class ServiceEBBLoader {
         }
         for (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf : serviceInstanceMSO.getPnfs()) {
             aaiResourceIds.add(new Pair<>(WorkflowType.PNF, pnf.getPnfId()));
-            resourceList.add(new Resource(WorkflowType.PNF, pnf.getPnfId(), false, serviceResource));
+            Resource resource = new Resource(WorkflowType.PNF, pnf.getPnfId(), false, serviceResource);
+            ModelInfoPnf modelInfo = pnf.getModelInfoPnf();
+            if (modelInfo != null) {
+                resource.setModelVersionId(modelInfo.getModelUuid());
+                resource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
+            }
+            resourceList.add(resource);
         }
     }
 
@@ -437,6 +455,10 @@ public class ServiceEBBLoader {
         for (VfModule vfModule : vnf.getVfModules()) {
             aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
             Resource resource = new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false, vnfResource);
+            org.onap.aai.domain.yang.VfModule aaiVfModule =
+                    bbInputSetupUtils.getAAIVfModule(vnf.getVnfId(), vfModule.getVfModuleId());
+            resource.setModelCustomizationId(aaiVfModule.getModelCustomizationId());
+            resource.setModelInvariantId(aaiVfModule.getModelInvariantId());
             resource.setBaseVfModule(vfModule.getModelInfoVfModule().getIsBaseBoolean());
             resourceList.add(resource);
         }
index c383b4a..77cd65b 100644 (file)
@@ -38,6 +38,7 @@ import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
 import org.onap.so.db.catalog.beans.CvnfcCustomization;
 import org.onap.so.db.catalog.beans.VfModuleCustomization;
 import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.serviceinstancebeans.ModelInfo;
 import org.onap.so.serviceinstancebeans.Networks;
 import org.onap.so.serviceinstancebeans.Pnfs;
 import org.onap.so.serviceinstancebeans.Service;
@@ -93,6 +94,11 @@ public class UserParamsServiceTraversal {
         List<Resource> resourceList = new ArrayList<>();
         Resource serviceResource =
                 new Resource(WorkflowType.SERVICE, validate.getModelInfo().getModelVersionId(), false, null);
+        ModelInfo modelInfo = validate.getModelInfo();
+        if (modelInfo != null) {
+            serviceResource.setModelVersionId(modelInfo.getModelVersionId());
+            serviceResource.setModelInvariantId(modelInfo.getModelInvariantUuid());
+        }
         resourceList.add(serviceResource);
         if (validate.getResources().getVnfs() != null) {
             setResourceListForVnfs(execution, resourceList, serviceResource, validate);
@@ -115,6 +121,11 @@ public class UserParamsServiceTraversal {
                     serviceResource);
             vnfResource.setProcessingPriority(vnf.getProcessingPriority());
             vnfResource.setInstanceName(vnf.getInstanceName());
+            ModelInfo modelInfo = vnf.getModelInfo();
+            if (modelInfo != null) {
+                vnfResource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
+                vnfResource.setModelVersionId(modelInfo.getModelVersionId());
+            }
             resourceList.add(vnfResource);
             setResourceListForVfModules(execution, resourceList, vnfResource, validate, vnf);
         }
@@ -160,6 +171,11 @@ public class UserParamsServiceTraversal {
             foundVfModuleOrVG = true;
             Resource resource =
                     setVfModuleWorkFlowTypeToResourceList(resourceList, vnfResource, vfModuleCustomization, vfModule);
+            if (vnf.getModelInfo() != null) {
+                resource.setModelVersionId(vnf.getModelInfo().getModelVersionId());
+            }
+            resource.setVfModuleCustomizationId(vfModuleCustomization.getModelCustomizationUUID());
+            resource.setModelCustomizationId(vfModuleCustomization.getModelCustomizationUUID());
             setConfigurationWorkFlowTypeToResourceList(resourceList, vnfResource, validate, vnf, vfModule, resource);
         }
     }
@@ -211,6 +227,11 @@ public class UserParamsServiceTraversal {
         for (Pnfs pnf : validate.getResources().getPnfs()) {
             Resource pnfResource = new Resource(WorkflowType.PNF, pnf.getModelInfo().getModelCustomizationId(), false,
                     serviceResource);
+            ModelInfo modelInfo = pnf.getModelInfo();
+            if (modelInfo != null) {
+                pnfResource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
+                pnfResource.setModelVersionId(modelInfo.getModelVersionId());
+            }
             pnfResource.setProcessingPriority(pnf.getProcessingPriority());
             resourceList.add(pnfResource);
         }
@@ -222,6 +243,11 @@ public class UserParamsServiceTraversal {
             Resource networkResource = new Resource(WorkflowType.NETWORK,
                     network.getModelInfo().getModelCustomizationId(), false, serviceResource);
             networkResource.setProcessingPriority(network.getProcessingPriority());
+            ModelInfo modelInfo = network.getModelInfo();
+            if (modelInfo != null) {
+                networkResource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
+                networkResource.setModelVersionId(modelInfo.getModelVersionId());
+            }
             resourceList.add(networkResource);
         }
         if (requestAction.equals(CREATE_INSTANCE)) {
index b950eb4..3778f64 100644 (file)
@@ -40,7 +40,6 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
-import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
 import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
 import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
 import org.onap.so.client.exception.ExceptionBuilder;
@@ -117,6 +116,9 @@ public class VnfEBBLoader {
             if (vnf.getVnfId().equals(vnfId)) {
                 aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
                 Resource vnfResource = new Resource(WorkflowType.VNF, vnf.getVnfId(), false, serviceResource);
+                org.onap.aai.domain.yang.GenericVnf aaiGenericVnf = bbInputSetupUtils.getAAIGenericVnf(vnfId);
+                vnfResource.setModelCustomizationId(aaiGenericVnf.getModelCustomizationId());
+                vnfResource.setModelVersionId(aaiGenericVnf.getModelVersionId());
                 resourceList.add(vnfResource);
                 processVfModules(vnf, aaiResourceIds, resourceList, vnfResource, execution);
                 processVolumeGroups(vnf, aaiResourceIds, resourceList, vnfResource);
@@ -131,8 +133,11 @@ public class VnfEBBLoader {
         for (GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
             if (vnf.getVnfId().equals(vnfId)) {
                 aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
-                Resource vnfResource = new Resource(WorkflowType.VNF,
-                        bbInputSetupUtils.getAAIGenericVnf(vnfId).getModelCustomizationId(), false, serviceResource);
+                org.onap.aai.domain.yang.GenericVnf aaiGenericVnf = bbInputSetupUtils.getAAIGenericVnf(vnfId);
+                Resource vnfResource =
+                        new Resource(WorkflowType.VNF, aaiGenericVnf.getModelCustomizationId(), false, serviceResource);
+                vnfResource.setModelCustomizationId(aaiGenericVnf.getModelCustomizationId());
+                vnfResource.setModelVersionId(aaiGenericVnf.getModelVersionId());
                 resourceList.add(vnfResource);
                 processVfModules(vnf, aaiResourceIds, resourceList, vnfResource, execution);
                 processVolumeGroups(vnf, aaiResourceIds, resourceList, vnfResource);
@@ -141,10 +146,10 @@ public class VnfEBBLoader {
         }
     }
 
-    private void findConfigurationsInsideVfModule(DelegateExecution execution, String vnfId, String vfModuleId,
-            List<Resource> resourceList, Resource vfModuleResource, List<Pair<WorkflowType, String>> aaiResourceIds) {
+    private void findConfigurationsInsideVfModule(DelegateExecution execution,
+            org.onap.aai.domain.yang.VfModule aaiVfModule, List<Resource> resourceList, Resource vfModuleResource,
+            List<Pair<WorkflowType, String>> aaiResourceIds) {
         try {
-            org.onap.aai.domain.yang.VfModule aaiVfModule = bbInputSetupUtils.getAAIVfModule(vnfId, vfModuleId);
             AAIResultWrapper vfModuleWrapper = new AAIResultWrapper(
                     new AAICommonObjectMapperProvider().getMapper().writeValueAsString(aaiVfModule));
             Optional<Relationships> relationshipsOp;
@@ -166,11 +171,14 @@ public class VnfEBBLoader {
                 aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
                 Resource vfModuleResource =
                         new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false, vnfResource);
-                Optional.ofNullable(vfModule.getModelInfoVfModule()).map(ModelInfoVfModule::getIsBaseBoolean)
-                        .ifPresent(vfModuleResource::setBaseVfModule);
+                org.onap.aai.domain.yang.VfModule aaiVfModule =
+                        bbInputSetupUtils.getAAIVfModule(vnf.getVnfId(), vfModule.getVfModuleId());
+                vfModuleResource.setModelInvariantId(aaiVfModule.getModelInvariantId());
+                vfModuleResource.setModelCustomizationId(aaiVfModule.getModelCustomizationId());
+                vfModuleResource.setBaseVfModule(aaiVfModule.isIsBaseVfModule());
                 resourceList.add(vfModuleResource);
-                findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(), resourceList,
-                        vfModuleResource, aaiResourceIds);
+                findConfigurationsInsideVfModule(execution, aaiVfModule, resourceList, vfModuleResource,
+                        aaiResourceIds);
             }
         }
     }
index ff6c113..dc77ea1 100644 (file)
@@ -24,12 +24,10 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import org.apache.logging.log4j.util.Strings;
 import org.onap.so.bpmn.common.BBConstants;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
 import org.onap.so.bpmn.common.listener.flowmanipulator.PreFlowManipulator;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
 import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
 import org.onap.so.db.catalog.beans.PnfResourceCustomization;
 import org.onap.so.db.catalog.beans.Service;
@@ -40,7 +38,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.util.CollectionUtils;
 
 @Component
 public class SkipCDSBuildingBlockListener implements PreFlowManipulator {
@@ -76,43 +73,37 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator {
     @Override
     public void run(List<ExecuteBuildingBlock> flowsToExecute, ExecuteBuildingBlock currentBB,
             BuildingBlockExecution execution) {
-        String customizationUUID = currentBB.getBuildingBlock().getKey();
+        String resourceKey = currentBB.getBuildingBlock().getKey();
+        List<Resource> resources = execution.getVariable("resources");
+        Resource resource = resources.stream().filter(r -> resourceKey.equals(r.getResourceId())).findFirst()
+                .orElseThrow(() -> new IllegalArgumentException("Resource not found for key:" + resourceKey));
 
-        if ("SERVICE".equalsIgnoreCase(currentBB.getBuildingBlock().getBpmnScope())) {
-            String modelUUID = currentBB.getRequestDetails().getModelInfo().getModelUuid();
-            Service service = catalogDbClient.getServiceByID(modelUUID);
-            currentSequenceSkipCheck(execution, service.getSkipPostInstConf());
-        } else if (currentBB.getBuildingBlock().getBpmnScope().equalsIgnoreCase("VNF")
-                && containsIgnoreCaseAction(currentBB, vnfActions)) {
-            List<VnfResourceCustomization> vnfResourceCustomizations =
-                    catalogDbClient.getVnfResourceCustomizationByModelUuid(
-                            currentBB.getRequestDetails().getModelInfo().getModelUuid());
-            if (!CollectionUtils.isEmpty(vnfResourceCustomizations)) {
-                VnfResourceCustomization vrc = catalogDbClient.findVnfResourceCustomizationInList(customizationUUID,
-                        vnfResourceCustomizations);
-                if (null != vrc) {
-                    logger.debug("getSkipPostInstConf value: " + vrc.getSkipPostInstConf().booleanValue());
-                    boolean skipConfigVNF = vrc.getSkipPostInstConf().booleanValue();
-                    currentSequenceSkipCheck(execution, skipConfigVNF);
-                }
+        String scope = currentBB.getBuildingBlock().getBpmnScope();
 
+        if ("SERVICE".equalsIgnoreCase(scope)) {
+            Service service = catalogDbClient.getServiceByID(resource.getModelVersionId());
+            currentSequenceSkipCheck(execution, service.getSkipPostInstConf());
+        } else if ("VNF".equalsIgnoreCase(scope) && containsIgnoreCaseAction(currentBB, vnfActions)) {
+            VnfResourceCustomization vrc = catalogDbClient
+                    .getVnfResourceCustomizationByModelCustomizationUUID(resource.getModelCustomizationId());
+            if (vrc != null) {
+                logger.debug("getSkipPostInstConf value: " + vrc.getSkipPostInstConf());
+                boolean skipConfigVNF = vrc.getSkipPostInstConf();
+                currentSequenceSkipCheck(execution, skipConfigVNF);
             }
         } else if (currentBB.getBuildingBlock().getBpmnScope().equalsIgnoreCase("VFModule")
                 && containsIgnoreCaseAction(currentBB, vFModuleAction)) {
-
-            VfModuleCustomization vfc =
-                    catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(customizationUUID);
-
+            VfModuleCustomization vfc = catalogDbClient
+                    .getVfModuleCustomizationByModelCuztomizationUUID(resource.getModelCustomizationId());
             if (null != vfc) {
                 logger.debug("getSkipPostInstConf value: " + vfc.getSkipPostInstConf().booleanValue());
                 boolean skipVfModule = vfc.getSkipPostInstConf();
                 currentSequenceSkipCheck(execution, skipVfModule);
             }
-
         } else if (currentBB.getBuildingBlock().getBpmnScope().equalsIgnoreCase("PNF")
                 && containsIgnoreCaseAction(currentBB, pnfActions)) {
-            PnfResourceCustomization pnfResourceCustomization =
-                    catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(customizationUUID);
+            PnfResourceCustomization pnfResourceCustomization = catalogDbClient
+                    .getPnfResourceCustomizationByModelCustomizationUUID(resource.getModelCustomizationId());
 
             if (null != pnfResourceCustomization) {
                 logger.debug("getSkipPostInstConf value: " + pnfResourceCustomization.getSkipPostInstConf());
index 52196aa..a044944 100644 (file)
@@ -409,6 +409,10 @@ public class WorkflowActionTest extends BaseTaskTest {
 
         serviceInstanceMSO.getVnfs().add(vnf);
 
+        VfModule aaiVfModule = new VfModule();
+        aaiVfModule.setIsBaseVfModule(false);
+
+        doReturn(aaiVfModule).when(bbSetupUtils).getAAIVfModule(any(), any());
         doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("si0");
         doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
         doReturn(Mockito.mock(GenericVnf.class)).when(bbSetupUtils).getAAIGenericVnf(any());
@@ -932,6 +936,10 @@ public class WorkflowActionTest extends BaseTaskTest {
         serviceInstanceMSO.getVnfs().add(vnf);
         serviceInstanceMSO.getPnfs().add(pnf);
 
+        VfModule aaiVfModule = new VfModule();
+        aaiVfModule.setIsBaseVfModule(false);
+
+        doReturn(aaiVfModule).when(bbSetupUtils).getAAIVfModule(any(), any());
         doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("123");
         doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
         doReturn(Mockito.mock(GenericVnf.class)).when(bbSetupUtils).getAAIGenericVnf(any());
@@ -1013,6 +1021,10 @@ public class WorkflowActionTest extends BaseTaskTest {
 
         serviceInstanceMSO.getVnfs().add(vnf);
 
+        VfModule aaiVfModule = new VfModule();
+        aaiVfModule.setIsBaseVfModule(false);
+
+        doReturn(aaiVfModule).when(bbSetupUtils).getAAIVfModule(any(), any());
         doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("123");
         doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
         doReturn(Mockito.mock(GenericVnf.class)).when(bbSetupUtils).getAAIGenericVnf(any());
@@ -1104,6 +1116,11 @@ public class WorkflowActionTest extends BaseTaskTest {
 
         serviceInstanceMSO.getVnfs().add(vnf);
 
+        org.onap.aai.domain.yang.VfModule aaiVfModule = new org.onap.aai.domain.yang.VfModule();
+        aaiVfModule.setIsBaseVfModule(false);
+
+        doReturn(aaiVfModule).when(bbSetupUtils).getAAIVfModule(any(), any());
+        doReturn(new org.onap.aai.domain.yang.GenericVnf()).when(bbSetupUtils).getAAIGenericVnf(vnf.getVnfId());
         doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("123");
         doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
         when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource,
@@ -1151,21 +1168,26 @@ public class WorkflowActionTest extends BaseTaskTest {
         vfModule2.setVfModuleId("vfModule2");
         vnf.getVfModules().add(vfModule2);
         serviceInstanceMSO.getVnfs().add(vnf);
-        VfModule vfModuleAAI = new VfModule();
-        vfModuleAAI.setVfModuleId("vfModule2");
+        VfModule vfModuleAAI1 = new VfModule();
+        vfModuleAAI1.setIsBaseVfModule(false);
+        VfModule vfModuleAAI2 = new VfModule();
+        vfModuleAAI2.setIsBaseVfModule(false);
+        vfModuleAAI2.setVfModuleId("vfModule2");
         RelationshipList relationshipList = new RelationshipList();
         Relationship relationship = new Relationship();
         relationshipList.getRelationship().add(relationship);
-        vfModuleAAI.setRelationshipList(relationshipList);
+        vfModuleAAI2.setRelationshipList(relationshipList);
         Relationships relationships = new Relationships("abc");
         Configuration config = new Configuration();
         config.setConfigurationId("configId");
         Optional<Configuration> configOp = Optional.of(config);
         Optional<Relationships> relationshipsOp = Optional.of(relationships);
 
+        doReturn(new org.onap.aai.domain.yang.GenericVnf()).when(bbSetupUtils).getAAIGenericVnf(vnf.getVnfId());
         doReturn(relationshipsOp).when(workflowActionUtils).extractRelationshipsVnfc(isA(Relationships.class));
         doReturn(configOp).when(workflowActionUtils).extractRelationshipsConfiguration(isA(Relationships.class));
-        doReturn(vfModuleAAI).when(bbSetupUtils).getAAIVfModule("1234", "vfModule2");
+        doReturn(vfModuleAAI1).when(bbSetupUtils).getAAIVfModule("1234", "vfModule1");
+        doReturn(vfModuleAAI2).when(bbSetupUtils).getAAIVfModule("1234", "vfModule2");
         doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("123");
         doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
         when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource,
index 2725626..76763e8 100644 (file)
@@ -239,6 +239,9 @@ public class ServiceEBBLoaderTest extends BaseTaskTest {
         aaiConfiguration2.setConfigurationId("testConfigurationId2");
         aaiConfiguration2.setRelationshipList(relationshipList1);
 
+        org.onap.aai.domain.yang.VfModule aaiVfModule = new org.onap.aai.domain.yang.VfModule();
+        aaiVfModule.setIsBaseVfModule(true);
+
         try {
             doReturn(genericVnfAai).when(mockBbInputSetupUtils).getAAIGenericVnf(genericVnf.getVnfId());
             doReturn(serviceInstanceAAI).when(mockBbInputSetupUtils).getAAIServiceInstanceById(resourceId);
@@ -247,6 +250,7 @@ public class ServiceEBBLoaderTest extends BaseTaskTest {
                     .getConfiguration("testConfigurationId");
             doReturn(Optional.of(aaiConfiguration2)).when(mockAaiConfigurationResources)
                     .getConfiguration("testConfigurationId2");
+            doReturn(aaiVfModule).when(mockBbInputSetupUtils).getAAIVfModule(any(), any());
             serviceEBBLoader.traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds);
             assertEquals(8, resourceCounter.size());
             assertTrue(resourceCounter.get(2).isBaseVfModule());
index 78a9628..2775c6d 100644 (file)
@@ -47,12 +47,14 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.only;
 
 
 public class VnfEBBLoaderTest {
 
     private String serviceId;
     private String vnfId;
+    private String vfModuleId;
     private BBInputSetupUtils bbInputSetupUtils;
     private BBInputSetup bbInputSetup;
     private WorkflowActionExtractResourcesAAI workflowActionUtils;
@@ -67,6 +69,7 @@ public class VnfEBBLoaderTest {
     public void setup() {
         serviceId = "service123";
         vnfId = "vnf123";
+        vfModuleId = "vfModule123";
         serviceInstanceAAI = mock(org.onap.aai.domain.yang.ServiceInstance.class);
         serviceInstanceMSO = mock(ServiceInstance.class);
         bbInputSetupUtils = mock(BBInputSetupUtils.class);
@@ -95,11 +98,19 @@ public class VnfEBBLoaderTest {
         GenericVnf genericVnf = mock(GenericVnf.class);
         doReturn(vnfId).when(genericVnf).getVnfId();
 
+        org.onap.aai.domain.yang.GenericVnf aaiVnf = mock(org.onap.aai.domain.yang.GenericVnf.class);
+        doReturn(aaiVnf).when(bbInputSetupUtils).getAAIGenericVnf(vnfId);
+
         VfModule vfModule = mock(VfModule.class);
+        doReturn(vfModuleId).when(vfModule).getVfModuleId();
         ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
         modelInfoVfModule.setIsBaseBoolean(true);
         doReturn(modelInfoVfModule).when(vfModule).getModelInfoVfModule();
 
+        org.onap.aai.domain.yang.VfModule aaiVfModule = new org.onap.aai.domain.yang.VfModule();
+        aaiVfModule.setIsBaseVfModule(true);
+        doReturn(aaiVfModule).when(bbInputSetupUtils).getAAIVfModule(vnfId, vfModuleId);
+
         doReturn(serviceInstanceAAI).when(bbInputSetupUtils).getAAIServiceInstanceById(serviceId);
         doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
         doReturn(List.of(genericVnf)).when(serviceInstanceMSO).getVnfs();
index b23147e..1fbee2d 100644 (file)
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.when;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
 import org.junit.Before;
 import org.junit.Test;
@@ -34,6 +35,8 @@ import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.so.bpmn.common.BBConstants;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.common.DelegateExecutionImpl;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
 import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
 import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
 import org.onap.so.db.catalog.beans.PnfResourceCustomization;
@@ -41,7 +44,6 @@ import org.onap.so.db.catalog.beans.Service;
 import org.onap.so.db.catalog.beans.VfModuleCustomization;
 import org.onap.so.db.catalog.beans.VnfResourceCustomization;
 import org.onap.so.db.catalog.client.CatalogDbClient;
-import org.onap.so.serviceinstancebeans.ModelInfo;
 import org.onap.so.serviceinstancebeans.RequestDetails;
 
 @RunWith(MockitoJUnitRunner.Silent.class)
@@ -51,25 +53,24 @@ public class SkipCDSBuildingBlockListenerTest {
     private static final String VNF_SCOPE = "VNF";
     private static final String VF_SCOPE = "VFModule";
     private static final String PNF_SCOPE = "pnf";
-    private static final String TEST_MODELUUID = "123456789";
     private static final String VNF_TEST_ACTION = "VnfConfigAssign";
     private static final String VFModule_TEST_ACTION = "VfModuleConfigAssign";
     private static final String PNFModule_TEST_ACTION = "config-assign";
-    private static final String MODELCUSTOMIZATIONUUID = "123456789";
+    private static final String SERVICE_MODEL_VERSION_ID = UUID.randomUUID().toString();
+    private static final String VNF_MODEL_CUSTOMIZATION_ID = UUID.randomUUID().toString();
+    private static final String VF_MODULE_CUSTOMIZATION_ID = UUID.randomUUID().toString();
+    private static final String PNF_CUSTOMIZATION_ID = UUID.randomUUID().toString();
     private static final String BBNAME = "ControllerExecutionBB";
     private static final boolean ISFIRST = true;
 
-    private int actual;
     private List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
-    private List<VnfResourceCustomization> vnfResourceCustomization;
-    private List<VfModuleCustomization> vfModuleCustomization;
-    private ExecuteBuildingBlock executeBuildingBlock = new ExecuteBuildingBlock();
+    private ExecuteBuildingBlock executeBuildingBlock;
     private RequestDetails reqDetail = new RequestDetails();
     private BuildingBlockExecution buildingBlockExecution = new DelegateExecutionImpl(new DelegateExecutionFake());
-    private VnfResourceCustomization vnfCust = new VnfResourceCustomization();
-    private VfModuleCustomization vfCust = new VfModuleCustomization();
-    private PnfResourceCustomization pnfResourceCustomization = new PnfResourceCustomization();
-    private BuildingBlock buildingBlock = new BuildingBlock();
+    private VnfResourceCustomization vnfCust;
+    private VfModuleCustomization vfCust;
+    private PnfResourceCustomization pnfResourceCustomization;
+    private BuildingBlock buildingBlock;
 
     @InjectMocks
     private SkipCDSBuildingBlockListener skipCDSBuildingBlockListener;
@@ -78,10 +79,27 @@ public class SkipCDSBuildingBlockListenerTest {
 
     @Before
     public void before() {
-        ModelInfo model = new ModelInfo();
-        model.setModelUuid(TEST_MODELUUID);
-        reqDetail.setModelInfo(model);
-        executeBuildingBlock.setRequestDetails(reqDetail);
+        executeBuildingBlock = new ExecuteBuildingBlock();
+        buildingBlock = new BuildingBlock();
+
+        ArrayList<Resource> resources = new ArrayList<>();
+        Resource service = new Resource(WorkflowType.SERVICE, SERVICE_MODEL_VERSION_ID, false, null);
+        service.setModelVersionId(SERVICE_MODEL_VERSION_ID);
+        resources.add(service);
+        Resource vnf = new Resource(WorkflowType.VNF, VNF_MODEL_CUSTOMIZATION_ID, false, null);
+        vnf.setModelCustomizationId(VNF_MODEL_CUSTOMIZATION_ID);
+        resources.add(vnf);
+        Resource vfModule = new Resource(WorkflowType.VFMODULE, VF_MODULE_CUSTOMIZATION_ID, false, null);
+        vfModule.setModelCustomizationId(VF_MODULE_CUSTOMIZATION_ID);
+        resources.add(vfModule);
+        Resource pnf = new Resource(WorkflowType.PNF, PNF_CUSTOMIZATION_ID, false, null);
+        pnf.setModelCustomizationId(PNF_CUSTOMIZATION_ID);
+        resources.add(pnf);
+        buildingBlockExecution.setVariable("resources", resources);
+
+        vnfCust = new VnfResourceCustomization();
+        vfCust = new VfModuleCustomization();
+        pnfResourceCustomization = new PnfResourceCustomization();
     }
 
     @Test
@@ -93,133 +111,83 @@ public class SkipCDSBuildingBlockListenerTest {
 
     @Test
     public void testSkipCDSforService() {
-        setBuildingBlockAndCurrentSequence(SERVICE_SCOPE, "service-config-assign", 0);
-        Service service = new Service();
-        when(catalogDbClient.getServiceByID(TEST_MODELUUID)).thenReturn(service);
+        setBuildingBlockAndCurrentSequence(SERVICE_SCOPE, "service-config-assign", SERVICE_MODEL_VERSION_ID, 0);
+        when(catalogDbClient.getServiceByID(SERVICE_MODEL_VERSION_ID)).thenReturn(new Service());
 
         skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
 
-        actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
-        assertEquals(1, actual);
+        assertEquals(1, (int) buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE));
     }
 
     @Test
     public void testProcessForVNFToSkipCDSBB() {
-        // given
-        setBuildingBlockAndCurrentSequence(VNF_SCOPE, VNF_TEST_ACTION, 0);
-        vnfResourceCustomization = getVnfResourceCustomizationList(true);
+        setBuildingBlockAndCurrentSequence(VNF_SCOPE, VNF_TEST_ACTION, VNF_MODEL_CUSTOMIZATION_ID, 0);
+        when(catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(VNF_MODEL_CUSTOMIZATION_ID))
+                .thenReturn(vnfCust);
 
-        when(catalogDbClient.getVnfResourceCustomizationByModelUuid(
-                executeBuildingBlock.getRequestDetails().getModelInfo().getModelUuid()))
-                        .thenReturn(vnfResourceCustomization);
-        when(catalogDbClient.findVnfResourceCustomizationInList(executeBuildingBlock.getBuildingBlock().getKey(),
-                vnfResourceCustomization)).thenReturn(vnfCust);
-
-        // when
         skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
 
-        // then
-        actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
-        assertEquals(1, actual);
-
+        assertEquals(1, (int) buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE));
     }
 
     @Test
     public void testProcessForVNFNotToSkipCDSBB() {
-        // given
-        setBuildingBlockAndCurrentSequence(VNF_SCOPE, VNF_TEST_ACTION, 0);
-        vnfResourceCustomization = getVnfResourceCustomizationList(false);
-
-        when(catalogDbClient.getVnfResourceCustomizationByModelUuid(
-                executeBuildingBlock.getRequestDetails().getModelInfo().getModelUuid()))
-                        .thenReturn(vnfResourceCustomization);
-        when(catalogDbClient.findVnfResourceCustomizationInList(executeBuildingBlock.getBuildingBlock().getKey(),
-                vnfResourceCustomization)).thenReturn(vnfCust);
+        setBuildingBlockAndCurrentSequence(VNF_SCOPE, VNF_TEST_ACTION, VNF_MODEL_CUSTOMIZATION_ID, 0);
+        vnfCust.setSkipPostInstConf(false);
+        when(catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(VNF_MODEL_CUSTOMIZATION_ID))
+                .thenReturn(vnfCust);
 
-        // when
         skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
 
-        // then
-        actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
-        assertEquals(0, actual);
-
+        assertEquals(0, (int) buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE));
     }
 
 
     @Test
     public void testProcessForVFToSkipCDSBB() {
-        // given
-        setBuildingBlockAndCurrentSequence(VF_SCOPE, VFModule_TEST_ACTION, 0);
-        vfModuleCustomization = getVfModuleCustomizationList(true);
-
-        when(catalogDbClient
-                .getVfModuleCustomizationByModelCuztomizationUUID(executeBuildingBlock.getBuildingBlock().getKey()))
-                        .thenReturn(vfCust);
+        setBuildingBlockAndCurrentSequence(VF_SCOPE, VFModule_TEST_ACTION, VF_MODULE_CUSTOMIZATION_ID, 0);
+        when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(VF_MODULE_CUSTOMIZATION_ID))
+                .thenReturn(vfCust);
 
-        // when
         skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
 
-        // then
-        actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
-        assertEquals(1, actual);
-
+        assertEquals(1, (int) buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE));
     }
 
     @Test
     public void testProcessForVFNotToSkipCDSBB() {
-        // given
-        setBuildingBlockAndCurrentSequence(VF_SCOPE, VFModule_TEST_ACTION, 0);
-        vfModuleCustomization = getVfModuleCustomizationList(false);
-
+        setBuildingBlockAndCurrentSequence(VF_SCOPE, VFModule_TEST_ACTION, VF_MODULE_CUSTOMIZATION_ID, 0);
+        vfCust.setSkipPostInstConf(false);
         when(catalogDbClient
                 .getVfModuleCustomizationByModelCuztomizationUUID(executeBuildingBlock.getBuildingBlock().getKey()))
                         .thenReturn(vfCust);
 
-        // when
         skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
 
-        // then
-        actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
-        assertEquals(0, actual);
-
+        assertEquals(0, (int) buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE));
     }
 
     @Test
     public void testProcessForPNFToSkipCDSBB() {
-        // given
-        setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, 0);
-        pnfResourceCustomization = getPnfResourceCustomization(true);
-
-        when(catalogDbClient
-                .getPnfResourceCustomizationByModelCustomizationUUID(executeBuildingBlock.getBuildingBlock().getKey()))
-                        .thenReturn(pnfResourceCustomization);
+        setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, PNF_CUSTOMIZATION_ID, 0);
+        when(catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(PNF_CUSTOMIZATION_ID))
+                .thenReturn(pnfResourceCustomization);
 
-        // when
         skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
 
-        // then
-        actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
-        assertEquals(1, actual);
-
+        assertEquals(1, (int) buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE));
     }
 
     @Test
     public void testProcessForPNFNotToSkipCDSBB() {
-        // given
-        setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, 0);
-        pnfResourceCustomization = getPnfResourceCustomization(false);
-
-        when(catalogDbClient
-                .getPnfResourceCustomizationByModelCustomizationUUID(executeBuildingBlock.getBuildingBlock().getKey()))
-                        .thenReturn(pnfResourceCustomization);
+        setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, PNF_CUSTOMIZATION_ID, 0);
+        pnfResourceCustomization.setSkipPostInstConf(false);
+        when(catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(PNF_CUSTOMIZATION_ID))
+                .thenReturn(pnfResourceCustomization);
 
-        // when
         skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
 
-        // then
-        actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
-        assertEquals(0, actual);
-
+        assertEquals(0, (int) buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE));
     }
 
     /**
@@ -229,37 +197,13 @@ public class SkipCDSBuildingBlockListenerTest {
      * @param action
      * @param squence
      */
-    private void setBuildingBlockAndCurrentSequence(String scope, String action, int sequence) {
+    private void setBuildingBlockAndCurrentSequence(String scope, String action, String key, int sequence) {
         buildingBlock.setBpmnScope(scope);
         buildingBlock.setBpmnAction(action);
         buildingBlock.setBpmnFlowName("ControllerExecutionBB");
-        buildingBlock.setKey(MODELCUSTOMIZATIONUUID);
+        buildingBlock.setKey(key);
         executeBuildingBlock.setBuildingBlock(buildingBlock);
         buildingBlockExecution.setVariable(BBConstants.G_CURRENT_SEQUENCE, sequence);
-
-    }
-
-    private List<VnfResourceCustomization> getVnfResourceCustomizationList(boolean setSkippost) {
-        List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>();
-        vnfCust.setModelCustomizationUUID(MODELCUSTOMIZATIONUUID);
-        vnfCust.setSkipPostInstConf(setSkippost);
-        vnfResourceCustomizations.add(vnfCust);
-        return vnfResourceCustomizations;
-    }
-
-    private List<VfModuleCustomization> getVfModuleCustomizationList(boolean setSkippost) {
-        List<VfModuleCustomization> vfModuleCustomizations = new ArrayList<>();
-        vfCust.setModelCustomizationUUID(MODELCUSTOMIZATIONUUID);
-        vfCust.setSkipPostInstConf(setSkippost);
-        vfModuleCustomizations.add(vfCust);
-        return vfModuleCustomizations;
-    }
-
-    private PnfResourceCustomization getPnfResourceCustomization(boolean setSkippost) {
-        PnfResourceCustomization pnfResourceCustomization = new PnfResourceCustomization();
-        pnfResourceCustomization.setModelCustomizationUUID(MODELCUSTOMIZATIONUUID);
-        pnfResourceCustomization.setSkipPostInstConf(setSkippost);
-        return pnfResourceCustomization;
     }
 
 }
index 5146685..df137d0 100644 (file)
@@ -56,4 +56,7 @@ public class ServiceInfo implements Serializable {
     private String pLMNIdList;
 
     private String actionType;
+
+    private String resourceSharingLevel;
+
 }
diff --git a/docs/developer_info/E2E_Network_Slicing_Understanding.rst b/docs/developer_info/E2E_Network_Slicing_Understanding.rst
new file mode 100644 (file)
index 0000000..169dd64
--- /dev/null
@@ -0,0 +1,111 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2021 Wipro Ltd.
+
+E2E Network Slicing
+===================
+The objective of this use case is to realize **End-to-End 5G Network
+Slicing** using ONAP. An End-to-End Network Slice consists of RAN (Radio
+Access Network), Transport Network (TN) and Core Network (CN) slice
+sub-nets. This use case intends to demonstrate the modeling,
+orchestration (life cycle and resources) and assurance of a network
+slice which are implemented in alignment with relevant standards.
+
+Overall High level view for ONAP-based Slice Management
+=======================================================
+
+Architecture Choice
+-------------------
+
+3GPP(TS 28.801) defines three layer slice management functions which include:
+
+CSMF(Communication Service Management Function):
+
+- Responsible for translating the communication service related requirement to network slice related requirements.
+
+- Communicate with Network Slice Management Function (NSMF).
+
+NSMF(Network Slice Management Function):
+
+- Responsible for management and orchestration of NSI.
+
+- Derive network slice subnet related requirements from network slice related requirements.
+
+- Communicate with the Network Slice Subnet Management Function (NSSMF) and Communication Service Management Function.
+
+NSSMF(Network Slice Subnet Management Function):
+
+- Responsible for management and orchestration of NSSI.
+
+- Communicate with the NSMF.
+
+.. image:: ../images/e2e-network-slicing-architecture.png
+
+To realize the three layers of the slice management function, we need to decide whether to implement CSMF, NSMF or NSMF within ONAP, or use the external CSMF, NSMF or NSSMF. This implies that for ONAP-based network slice management, we have different choices from an architectural perspective:
+
+1. Implement CSMF, NSMF, NSSMF all within ONAP;
+
+2. Connect an external CSMF from the Northbound, Implement NSMF and NSSMF within ONAP;
+
+3. Connect an external CSMF from the Northbound, Implement NSMF within ONAP, Connect a 3rd party NSSMF from the Southbound;
+
+4. Implement CSMF, NSMF within ONAP, Connect a 3rd party NSSMF from then Southbound.
+
+5. Use external CSMF and NSMF, only implement NSSMF within ONAP.
+
+.. image:: ../images/architecture-choices-e2e-slicing.png
+
+Slice Management Functions - Realization in SO
+----------------------------------------------
+
+- CSMF and NSMF is realized within ONAP (enhancement in Frankfurt functionality), and the NB interfaces is standardized using ExtAPI.
+
+- All 3 NSSMFs shall be realized within ONAP (From Guilin).
+
+- ONAP acting as NSMF shall also interact with external RAN and Transport NSSMF using 3GPP APIs
+
+- CSMF reliazed within SO receives service requirements from EXT-API, which translates service requirements to slice profile(NST selection) and sends request to NSMF for slice allocation.
+
+- NSMF reliazed within SO receives request for slice allocation (slice profile, S-NSSAI, NST) and determines slice instantiation/modification (with OOF) to fulfil the slice allocation request.
+
+- NSSMF reliazed within SO receive information from NSMF & trigger RAN/Core/Transport NSSMF for orchestration actions.
+
+Network Slice Instance (NSI) Life Cycle View
+--------------------------------------------
+
+Design and pre-provision: Creation of necessary slice/slice sub-net templates. Creation, activation, deactivation and termination of NSI, including its constituent slice sub-nets (RAN, Core   and Transport)
+
+3GPP Specification (3GPP TS 28.530) describes management aspects of a Network Slice Instance, which can be described by the four phases:
+
+Preparation: The preparation phase includes network slice design, network slice capacity planning, on-boarding and evaluation of the network functions, preparing the network environment and   other necessary preparations required to be done before the creation of an NSI
+
+Commisioning: NSI provisioning in the commissioning phase includes creation of the NSI. During NSI creation all needed resources are allocated and configured to satisfy the network slice      requirements. The creation of an NSI can include creation and/or modification of the NSI constituents
+
+Operation: The Operation phase includes the activation, supervision, performance reporting (e.g. for KPI monitoring), resource capacity planning, modification,and de-activation of an NSI.
+
+Decommissioning: Network slice instance provisioning in the decommissioning phase includes decommissioning of non-shared constituents if required and removing the NSI specific configuration   from the shared constituents. After the decommissioning phase, the NSI is terminated and does not exist anymore. The ONAP-based NSI lifecycle management will finally provide the demonstration of all these phases.
+
+The ONAP-based NSI lifecycle management will finally provide the demonstration of all these phases.
+
+.. image:: ../images/lifecycle-of-network-slice-instance.png
+
+Support for Option1 &Option2 in E2E Network Slicing
+---------------------------------------------------
+
+ONAP E2E Network Slicing option 1 and 2 differs on the RAN and FH/BH relationship.
+
+- In option 1, RAN NSSMF will decide FH/MH requirements and send to TN side, so RAN NSST will nest FH/MH NSST, and slice profile requirements will contain not only RAN side requirements but also FH/MH.
+
+Template design for option 1: https://wiki.onap.org/display/DW/Template+Design+for+Option+1
+
+.. image:: ../images/slicing-option1.png
+
+- In option 2, FH and MH are independent requirments when doing E2E requirements decomposition. Detailed background of option 1 and 2, please see  E2E Network Slicing Use Case in R7 Guilin.
+
+Template design for option 2: https://wiki.onap.org/display/DW/Template+Design+for+Option2
+
+.. image:: ../images/slicing-option2.png
+
+3 domain combination solution -Endpoint
+---------------------------------------
+In order to enable 3 subnet connectivity, making end-to-end forwarding and control plane interacting, in slicing services, we need slicing interworking identifier and information to tell how  RAN and Core connect with TN. Slicing interworking identifier(in ONAP is vlan Id, allocated by NSMF) is used to isolate differerent service datas, and identify the unique slicing service      across RAN, TN and Core, 1 S-NSSAI will need to be assigned with 1 slicing interworking identifier(vlan Id). The slicing interworking information is used as bridges to connect RAN/Core and TN,it should be RAN/Core side outgress and TN ingress, like port, ipAddress, next hops and etc.
diff --git a/docs/images/architecture-choices-e2e-slicing.png b/docs/images/architecture-choices-e2e-slicing.png
new file mode 100644 (file)
index 0000000..b240215
Binary files /dev/null and b/docs/images/architecture-choices-e2e-slicing.png differ
diff --git a/docs/images/e2e-network-slicing-architecture.png b/docs/images/e2e-network-slicing-architecture.png
new file mode 100644 (file)
index 0000000..922419d
Binary files /dev/null and b/docs/images/e2e-network-slicing-architecture.png differ
diff --git a/docs/images/lifecycle-of-network-slice-instance.png b/docs/images/lifecycle-of-network-slice-instance.png
new file mode 100644 (file)
index 0000000..0959783
Binary files /dev/null and b/docs/images/lifecycle-of-network-slice-instance.png differ
diff --git a/docs/images/slicing-option1.png b/docs/images/slicing-option1.png
new file mode 100644 (file)
index 0000000..e19a257
Binary files /dev/null and b/docs/images/slicing-option1.png differ
diff --git a/docs/images/slicing-option2.png b/docs/images/slicing-option2.png
new file mode 100644 (file)
index 0000000..945c7c5
Binary files /dev/null and b/docs/images/slicing-option2.png differ
index fc16125..9a66f75 100644 (file)
@@ -24,7 +24,7 @@ package org.onap.so.client.sniro;
 
 
 import static org.apache.commons.lang3.StringUtils.*;
-import java.util.LinkedHashMap;
+import java.util.Map;
 import org.json.JSONObject;
 import org.onap.so.client.exception.BadResponseException;
 import org.slf4j.Logger;
@@ -38,12 +38,14 @@ public class SniroValidator {
 
     private static final Logger logger = LoggerFactory.getLogger(SniroValidator.class);
 
+    private static final String MESSAGE_NOT_PROVIDED = "error message not provided";
+
     /**
      * Validates the synchronous homing response from sniro manager
      *
      * @throws BadResponseException
      */
-    public void validateDemandsResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
+    public void validateDemandsResponse(Map<String, Object> response) throws BadResponseException {
         logger.debug("Validating Sniro Managers synchronous response");
         if (!response.isEmpty()) {
             JSONObject jsonResponse = new JSONObject(response);
@@ -54,10 +56,10 @@ public class SniroValidator {
                 } else {
                     String message = jsonResponse.getString("statusMessage");
                     if (isNotBlank(message)) {
-                        logger.debug("Sniro Managers response indicates failed: " + message);
+                        logger.debug("Sniro Managers response indicates failed: {}", message);
                     } else {
                         logger.debug("Sniro Managers response indicates failed: no status message provided");
-                        message = "error message not provided";
+                        message = MESSAGE_NOT_PROVIDED;
                     }
                     throw new BadResponseException("Sniro Managers synchronous response indicates failed: " + message);
                 }
@@ -67,7 +69,7 @@ public class SniroValidator {
             }
         } else {
             logger.debug("Sniro Managers synchronous response is empty");
-            throw new BadResponseException("Sniro Managers synchronous response i is empty");
+            throw new BadResponseException("Sniro Managers synchronous response is empty");
         }
     }
 
@@ -85,11 +87,11 @@ public class SniroValidator {
             } else {
                 String message = jsonResponse.getJSONObject("serviceException").getString("text");
                 if (isNotBlank(message)) {
-                    logger.debug("Sniro Managers response contains a service exception: " + message);
+                    logger.debug("Sniro Managers response contains a service exception: {}", message);
                 } else {
                     logger.debug(
                             "Sniro Managers response contains a service exception: no service exception text provided");
-                    message = "error message not provided";
+                    message = MESSAGE_NOT_PROVIDED;
                 }
                 throw new BadResponseException(
                         "Sniro Managers asynchronous response contains a service exception: " + message);
@@ -106,7 +108,7 @@ public class SniroValidator {
      *
      * @throws BadResponseException
      */
-    public void validateReleaseResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
+    public void validateReleaseResponse(Map<String, Object> response) throws BadResponseException {
         logger.debug("Validating Sniro Conductors response");
         if (!response.isEmpty()) {
             String status = (String) response.get("status");
@@ -116,10 +118,10 @@ public class SniroValidator {
                 } else {
                     String message = (String) response.get("message");
                     if (isNotBlank(message)) {
-                        logger.debug("Sniro Conductors response indicates failed: " + message);
+                        logger.debug("Sniro Conductors response indicates failed: {}", message);
                     } else {
                         logger.debug("Sniro Conductors response indicates failed: error message not provided");
-                        message = "error message not provided";
+                        message = MESSAGE_NOT_PROVIDED;
                     }
                     throw new BadResponseException(
                             "Sniro Conductors synchronous response indicates failed: " + message);
index 5f9be78..eaea1ab 100644 (file)
 
 package org.onap.so.client.oof;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
+import org.apache.logging.log4j.util.Strings;
 import org.junit.Test;
 import org.onap.so.client.exception.BadResponseException;
 
@@ -55,4 +58,41 @@ public class OofValidatorTest {
         map.put("statusMessage", "a");
         new OofValidator().validateDemandsResponse(map);
     }
+
+    @Test
+    public void validateSolution_success() throws Exception {
+        String json = "{\"value\" : \"test1\"}";
+        new OofValidator().validateSolution(json);
+    }
+
+    @Test
+    public void validateSolution_EmptyResponse() {
+        try {
+            new OofValidator().validateSolution("");
+        } catch (BadResponseException e) {
+            assertThat(e.getMessage()).contains("oofs asynchronous response is empty");
+        }
+    }
+
+    @Test
+    public void validateSolution_serviceExceptionWithMessage() {
+        String json = "{\"serviceException\" : {\"text\" : \"serviceExceptionOccurred\"}}";
+        try {
+            new OofValidator().validateSolution(json);
+            fail("Exception should be thrown");
+        } catch (BadResponseException e) {
+            assertThat(e.getMessage()).contains("serviceExceptionOccurred");
+        }
+    }
+
+    @Test
+    public void validateSolution_serviceExceptionWithEmptyMessage() {
+        String json = "{\"serviceException\" : {\"text\" : \"\"}}";
+        try {
+            new OofValidator().validateSolution(json);
+            fail("Exception should be thrown");
+        } catch (BadResponseException e) {
+            assertThat(e.getMessage()).contains("error message not provided");
+        }
+    }
 }
diff --git a/so-optimization-clients/src/test/java/org/onap/so/client/sniro/SniroValidatorTest.java b/so-optimization-clients/src/test/java/org/onap/so/client/sniro/SniroValidatorTest.java
new file mode 100644 (file)
index 0000000..8288d70
--- /dev/null
@@ -0,0 +1,62 @@
+package org.onap.so.client.sniro;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.onap.so.client.exception.BadResponseException;
+
+public class SniroValidatorTest {
+
+    @Test
+    public void validateDemandsResponse_success() throws BadResponseException {
+        Map<String, Object> testMap = new LinkedHashMap<>();
+        testMap.put("requestStatus", "accepted");
+        new SniroValidator().validateDemandsResponse(testMap);
+    }
+
+    @Test
+    public void validateDemandsResponse_emptyResponse() {
+        try {
+            new SniroValidator().validateDemandsResponse(new LinkedHashMap<>());
+        } catch (BadResponseException e) {
+            assertThat(e.getMessage()).contains("Sniro Managers synchronous response is empty");
+        }
+    }
+
+    @Test
+    public void validateDemandsResponse_responseWithErrorMessage() {
+        String message = "An error occurred";
+        Map<String, Object> testMap = new LinkedHashMap<>();
+        testMap.put("requestStatus", "not_accepted");
+        testMap.put("statusMessage", message);
+        try {
+            new SniroValidator().validateDemandsResponse(testMap);
+        } catch (BadResponseException e) {
+            assertThat(e.getMessage()).contains("Sniro Managers synchronous response indicates failed: " + message);
+        }
+    }
+
+    @Test
+    public void validateDemandsResponse_responseWithoutMessage() {
+        Map<String, Object> testMap = new LinkedHashMap<>();
+        testMap.put("requestStatus", "not_accepted");
+        testMap.put("statusMessage", "");
+        try {
+            new SniroValidator().validateDemandsResponse(testMap);
+        } catch (BadResponseException e) {
+            assertThat(e.getMessage()).contains("error message not provided");
+        }
+    }
+
+    @Test
+    public void validateDemandsResponse_responseWithoutRequestStatus() {
+        Map<String, Object> testMap = new LinkedHashMap<>();
+        testMap.put("statusMessage", "");
+        try {
+            new SniroValidator().validateDemandsResponse(testMap);
+        } catch (BadResponseException e) {
+            assertThat(e.getMessage()).contains("Sniro Managers synchronous response does not contain: request status");
+        }
+    }
+}