Merge "fix lookup of si if customer exists"
authorSteve Smokowski <ss835w@att.com>
Wed, 12 Dec 2018 12:38:17 +0000 (12:38 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 12 Dec 2018 12:38:17 +0000 (12:38 +0000)
INFO.yaml
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterTest.groovy
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java

index 78fb0f3..f6b8b4e 100644 (file)
--- a/INFO.yaml
+++ b/INFO.yaml
@@ -2,6 +2,7 @@
 project: 'so'
 project_creation_date: '2017-01-30'
 lifecycle_state: 'Incubation'
+project_category: ''
 project_lead: &onap_releng_ptl
     name: 'Seshu Kumar'
     email: 'seshu.kumar.m@huawei.com'
@@ -13,78 +14,100 @@ issue_tracking:
     type: 'jira'
     url: 'https://jira.onap.org/projects/SO'
     key: 'SO'
+mailing_list:
+    type: 'groups.io'
+    url: 'lists.onap.org'
+    tag: '<[sub-project_name]>'
+realtime_discussion: ''
 meetings:
     - type: 'zoom'
-        agenda: 'https://wiki.onap.org/display/DW/Minutes+Of+Meeting'
-        url: 'https://wiki.onap.org/display/DW/Service+Orchestrator+Project'
-        server: 'n/a'
-        channel: 'n/a'
-        repeats: 'weekly'
-        time: '14:00 UTC'
+      agenda: 'https://wiki.onap.org/display/DW/Minutes+Of+Meeting'
+      url: 'https://wiki.onap.org/display/DW/Service+Orchestrator+Project'
+      server: 'n/a'
+      channel: 'n/a'
+      repeats: 'weekly'
+      time: '14:00 UTC'
+repositories:
+    - so
+    - so-chef-repo
+    - so-docker-config
+    - so-libs
+    - so-so-config
 committers:
     - <<: *onap_releng_ptl
     - name: 'Chuanyu Chen'
-        email: 'chenchuanyu@huawei.com'
-        company: 'Huawei'
-        id: 'boychuanyu'
-        timezone: 'Beijing/China'
+      email: 'chenchuanyu@huawei.com'
+      company: 'Huawei'
+      id: 'boychuanyu'
+      timezone: 'Asia/Shanghai'
     - name: 'Byung-Woo Jun'
-        email: 'byung-woo.jun@ericsson.com'
-        company: 'Ericsson'
-        id: 'byungwoojun'
-        timezone: ''
+      email: 'byung-woo.jun@ericsson.com'
+      company: 'Ericsson'
+      id: 'byungwoojun'
+      timezone: ''
     - name: 'DeWayne Filppi'
-        email: 'dewayne@cloudify.co'
-        company: 'Cloudify'
-        id: 'dfilppi'
-        timezone: ''
-    - name: 'Eric Debeau'
-        email: 'eric.debeau@orange.com'
-        company: 'Orange'
-        id: 'eric.debeau'
-        timezone: ''
-    - name: 'Ethan Lynn'
-        email: 'ethanlynnl@vmware.com'
-        company: 'VMware'
-        id: 'ethanlynnl'
-        timezone: 'France/Lannion'
+      email: 'dewayne@cloudify.co'
+      company: 'Cloudify'
+      id: 'dfilppi'
+      timezone: ''
     - name: 'Rob Daugherty'
-        email: 'rd472p@att.com'
-        company: 'ATT'
-        id: 'rd472p'
-        timezone: ''
-    - name: 'Chengli Wang'
-        email: 'wangchengli@chinamobile.com'
-        company: 'China Mobile'
-        id: 'wangchengli'
-        timezone: 'China/Beijing'
+      email: 'rd472p@att.com'
+      company: 'ATT'
+      id: 'rd472p'
+      timezone: ''
+    - name: 'Yan Yang'
+      email: 'yangyanyj@chinamobile.com'
+      company: 'China Mobile'
+      id: 'yangyan'
+      timezone: 'Asia/Shanghai'
     - name: 'Marcus Williams'
-        email: 'marcus.williams@intel.com'
-        company: 'Intel'
-        id: 'mgkwill'
-        timezone: 'America/Los Angeles'
+      email: 'marcus.williams@intel.com'
+      company: 'Intel'
+      id: 'mgkwill'
+      timezone: 'America/Los Angeles'
     - name: 'Sanchita Pathak'
-        email: 'sanchita@techmahindra.com'
-        company: 'Tech Mahindra'
-        id: 'sanchitap'
-        timezone: 'Asia/Kolkata'
+      email: 'sanchita@techmahindra.com'
+      company: 'Tech Mahindra'
+      id: 'sanchitap'
+      timezone: 'Asia/Kolkata'
+    - name: 'Steve Smokowski'
+      email: 'ss835w@att.com'
+      company: 'ATT'
+      id: 'stevesmokowski'
+      timezone: 'America/New_York'
+    - name: 'Subhash Kumar Singh'
+      email: 'Subhash.Kumar.Singh@huawei.com'
+      company: 'Huawei'
+      id: 'subhash_singh'
+      timezone: 'Asia/Kolkata'
+    - name: 'Lukasz Muszkieta'
+      email: 'lukasz.muszkieta@nokia.com'
+      company: 'Nokia'
+      id: 'lukaszM'
+      timezone: 'Europe/Warsaw'
 tsc:
     approval: 'https://lists.onap.org/pipermail/onap-tsc'
     changes:
         - type: 'removal'
-            name: 'Tal Liron'
-            name: 'Heliu Zhong'
-            name: 'Yuanwei Yang'
-            name: 'Christophe Closset'
-            name: 'Claude Noshpitz'
-            name: 'maopeng zhang'
-            name: 'Bin Hou'
-            name: 'Fu Jinhua'
-            name: 'Jie Feng'
-            name: 'jackie tian'
-            name: 'Deng Hui'
-            link: 'https://lists.onap.org/pipermail/onap-tsc/2018-May/004802.html'
+          name: 'Tal Liron'
+          name: 'Heliu Zhong'
+          name: 'Yuanwei Yang'
+          name: 'Christophe Closset'
+          name: 'Claude Noshpitz'
+          name: 'maopeng zhang'
+          name: 'Bin Hou'
+          name: 'Fu Jinhua'
+          name: 'Jie Feng'
+          name: 'jackie tian'
+          name: 'Deng Hui'
+          link: 'https://lists.onap.org/pipermail/onap-tsc/2018-May/004802.html'
         - type: 'addition'
-            name: 'Marcus Williams'
-            name: 'Sanchita Pathak'
-            link: 'https://lists.onap.org/pipermail/onap-tsc/2018-May/004802.html'
+          name: 'Marcus Williams'
+          name: 'Sanchita Pathak'
+          link: 'https://lists.onap.org/pipermail/onap-tsc/2018-May/004802.html'
+        - type: 'addition'
+          name: 'Steve Smokowski'
+          name: 'Subhash Kumar Singh'
+          name: 'Lukasz Muszkieta'
+          link: 'https://lists.onap.org/g/onap-tsc/message/4320'
+
index a5e7c0f..a430cdb 100644 (file)
@@ -58,11 +58,10 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
                        execution.setVariable("SDNCA_InterimNotify", false)
 
                        String requestId = execution.getVariable("mso-request-id")
-                       if(isNotBlank(requestId)){
-                               execution.setVariable(Prefix + "requestId", requestId)
-                       }else{
+                       if(isBlank(requestId)){
                                exceptionUtil.buildAndThrowWorkflowException(execution, 400, 'mso-request-id not provided by calling flow')
                        }
+
                        // Authorization Info
                        String basicAuthValue = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution)
 
@@ -124,6 +123,7 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
 
                        //calling process should pass a generated uuid if sending multiple sdnc requests
                        def sdncRequestId = utils.getNodeText(requestHeader, "RequestId")
+                       execution.setVariable(Prefix + "requestId", sdncRequestId)
 
                        // Prepare SDNC Request to the SDNC Adapter
                        String sdncAdapterRequest = """
index 513a19b..0017c4e 100644 (file)
@@ -609,16 +609,27 @@ public class BBInputSetup implements JavaDelegate {
                        vnf = createGenericVnf(lookupKeyMap, instanceName, platform, lineOfBusiness,
                                        resourceId, generatedVnfType, instanceParams);
                        serviceInstance.getVnfs().add(vnf);
+                       mapVnfcCollectionInstanceGroup(vnf, modelInfo, service);
                }
                if(vnf != null) {
                        mapCatalogVnf(vnf, modelInfo, service);
-                       mapVnfcCollectionInstanceGroup(vnf, modelInfo, service);
-                       if (instanceGroupId != null && instanceGroupModelInfo != null) {
+                       if (instanceGroupId != null && instanceGroupModelInfo != null
+                                       && instanceGroupModelInfo.getModelType().equals(ModelType.networkInstanceGroup)
+                                       && !instanceGroupInList(vnf, instanceGroupId)) {
                                mapNetworkCollectionInstanceGroup(vnf, instanceGroupId);
                        }
                }
        }
 
+       protected boolean instanceGroupInList(GenericVnf vnf, String instanceGroupId) {
+               for(InstanceGroup instanceGroup : vnf.getInstanceGroups()) {
+                       if(instanceGroup.getId() != null && instanceGroup.getId().equalsIgnoreCase(instanceGroupId)) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
        protected void mapVnfcCollectionInstanceGroup(GenericVnf genericVnf, ModelInfo modelInfo, Service service) {
                VnfResourceCustomization vnfResourceCustomization = getVnfResourceCustomizationFromService(modelInfo, service);
                if(vnfResourceCustomization != null) {
index ec69bf5..e351210 100644 (file)
@@ -844,11 +844,11 @@ def sdncAdapterResponseError =
                verify(mockExecution).setVariable("asynchronousResponseTimeout",false)
                verify(mockExecution).setVariable("continueListening",false)
                verify(mockExecution).setVariable("serviceConfigActivate",false)
-               verify(mockExecution).setVariable("SDNCA_requestId", "testReqId")
                verify(mockExecution).setVariable("SDNCA_SuccessIndicator",false)
                verify(mockExecution).setVariable("SDNCA_InterimNotify",false)
                verify(mockExecution).setVariable("BasicAuthHeaderValue","Basic dGVzdDp0ZXN0")
                verify(mockExecution).setVariable("source","")
+               verify(mockExecution).setVariable("SDNCA_requestId", "745b1b50-e39e-4685-9cc8-c71f0bde8bf0")
                verify(mockExecution).setVariable("sdncAdapterRequest", sdncAdapterRequest)
        }
 
index a04c38d..78238f0 100644 (file)
@@ -1318,7 +1318,7 @@ public class BBInputSetupTest {
                                serviceInstance, lookupKeyMap, requestDetails.getRelatedInstanceList(), resourceId, vnfType, null);
                verify(SPY_bbInputSetup, times(2)).mapCatalogVnf(vnf2, modelInfo, service);
                verify(SPY_bbInputSetup, times(2)).mapNetworkCollectionInstanceGroup(vnf2, "{instanceGroupId}");
-               verify(SPY_bbInputSetup, times(2)).mapVnfcCollectionInstanceGroup(vnf2, modelInfo, service);
+               verify(SPY_bbInputSetup, times(1)).mapVnfcCollectionInstanceGroup(vnf2, modelInfo, service);
        }
 
        @Test