Merge "Add correlationId to ServiceInstancesRequest"
authorSeshu Kumar M <seshu.kumar.m@huawei.com>
Tue, 22 May 2018 10:00:15 +0000 (10:00 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 22 May 2018 10:00:15 +0000 (10:00 +0000)
86 files changed:
INFO.yaml
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoKeystoneUtils.java
adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java
adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java [deleted file]
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryTest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java [new file with mode: 0644]
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsarTest.java [new file with mode: 0644]
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModuleTest.java [new file with mode: 0644]
asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
asdc-controller/src/main/resources/resource-examples/resource_Extvl.csar
asdc-controller/src/main/resources/resource-examples/service-ServiceFdnt-csar-0904-2.csar
asdc-controller/src/main/resources/resource-examples/service-ServiceFdnt-with-allotted.csar
asdc-controller/src/main/resources/resource-examples/service_Rg516VmmscSrvc_csar.csar
bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SNIROUtils.groovy
bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SniroHoming.groovy
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContextHolder.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResponse.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/CompleteMsoProcessTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ConfirmVolumeGroupTenantTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/FalloutHandlerTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteServiceTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericDeleteVnfTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetServiceTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericGetVnfTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/GenericPutVnfTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SniroHomingTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowContextHolderTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/json/JsonUtilsTest.java
bpmn/MSOCoreBPMN/src/test/resources/json-examples/SNIROExample.json
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfCmBase.groovy
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java [new file with mode: 0644]
bpmn/MSOInfrastructureBPMN/src/main/resources/dmaap.properties
bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateAndActivatePnfResource.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustServiceV2.bpmn
bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/applicationContext.xml
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java [new file with mode: 0644]
bpmn/MSOInfrastructureBPMN/src/test/resources/applicationContext_forPnfTesting.xml
bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java
common/src/main/java/org/openecomp/mso/utils/RootIgnoringJsonDeserializer.java [new file with mode: 0644]
common/src/main/java/org/openecomp/mso/utils/RootIgnoringObjectMapper.java [new file with mode: 0644]
common/src/test/java/org/openecomp/mso/utils/RootIgnoringObjectMapperTest.java [new file with mode: 0644]
docs/SO_R1_Interface.rst
docs/release-notes.rst
mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaResponse.java
mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java
mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaResponseTest.java
mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/CloudOrchestration.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequestsTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/resource_Extvl.csar
packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service-ServiceFdnt-csar-0904-2.csar
packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service-ServiceFdnt-with-allotted.csar
packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg516VmmscSrvc_csar.csar
packages/docker/pom.xml

index 34f11c2..990e63b 100644 (file)
--- a/INFO.yaml
+++ b/INFO.yaml
@@ -98,9 +98,25 @@ committers:
         company: 'China Mobile'
         id: 'wangchengli'
         timezone: 'China/Beijing'
+    - name: 'Marcus Williams'
+        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'
 tsc:
     approval: 'https://lists.onap.org/pipermail/onap-tsc'
     changes:
         - type: 'removal'
             name: 'Tal Liron'
-            link: 'https://lists.onap.org/pipermail/onap-tsc/2018-February/004361.html'
+            name: 'Heliu Zhong'
+            name: 'Yuanwei Yang'
+            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'
index 6bec917..1f3c43c 100644 (file)
@@ -571,7 +571,8 @@ public class MsoKeystoneUtils extends MsoTenantUtils {
         }
 
         public boolean isExpired () {
-            return expires == null || System.currentTimeMillis() > expires.getTimeInMillis();
+            // adding arbitrary guard timer of 5 minutes
+            return expires == null || System.currentTimeMillis() > (expires.getTimeInMillis() - 300000);
 
         }
     }
index a8969dd..9215c38 100644 (file)
@@ -80,8 +80,9 @@ public class QueryVfModule extends CatalogQuery {
     }
 
        @Override
-       public String JSON2(boolean isArray, boolean x) {
+       public String JSON2(boolean isArray, boolean isEmbed) {
                StringBuilder sb = new StringBuilder();
+               if (!isEmbed && isArray) sb.append("{ ");
                if (isArray) sb.append("\"vfModules\": [");
                Map<String, String> valueMap = new HashMap<>();
                String sep = "";
@@ -112,6 +113,7 @@ public class QueryVfModule extends CatalogQuery {
                }
                if (!first) sb.append("\n");
                if (isArray) sb.append("]");
+               if (!isEmbed && isArray) sb.append("}");
                return sb.toString();
        }
 }
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java
deleted file mode 100644 (file)
index 001a9f4..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.mso.adapters.catalogdb.catalogrest;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.openecomp.mso.db.catalog.beans.VfModule;
-import org.openecomp.mso.logger.MsoLogger;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@XmlRootElement(name = "vfModules")
-public class QueryVfModules {
-       private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
-       private List<VfModule> vfModules;
-
-       public QueryVfModules() {
-               super();
-               vfModules = new ArrayList<>();
-       }
-       public QueryVfModules(List<VfModule> vlist) { 
-               LOGGER.debug ("QueryVfModules:");
-               vfModules = new ArrayList<>();
-               for (VfModule o : vlist) {
-                       LOGGER.debug ("-- o is a vfModules ----");
-                       LOGGER.debug (o.toString());
-                       vfModules.add(o);
-                       LOGGER.debug ("-------------------");
-               }
-       }
-
-       public List<VfModule> getVfModules(){ return this.vfModules; }
-
-       public void setVfModules(List<VfModule> v) { this.vfModules = v; }
-       
-       @Override
-       public String toString () {
-               StringBuilder sb = new StringBuilder();
-
-               boolean first = true;
-               int i = 1;
-               for (VfModule o : vfModules) {
-                       sb.append(i).append("\t");
-                       if (!first) sb.append("\n");
-                       first = false;
-                       sb.append(o);
-               }
-               return sb.toString();
-    }
-       
-       public String toJsonString() {
-               String jsonString = null;
-               try {
-                       ObjectMapper mapper = new ObjectMapper();
-                       jsonString = mapper.writeValueAsString(this);
-                       LOGGER.debug ("QueryVfModules jsonString: "+jsonString);
-               }
-               catch (Exception e) {
-                   LOGGER.debug ("Exception:", e);
-                       LOGGER.debug ("QueryVfModules jsonString exception:"+e.getMessage()); 
-               }
-               return jsonString;
-       }
-}
index ee2c8db..a4a5df7 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
 package org.openecomp.mso.adapters.catalogdb.catalogrest;
 
-import java.io.StringReader;
-import java.util.ArrayList;
+import static org.assertj.core.api.Assertions.assertThat;
+
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
 
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonObject;
-import javax.json.JsonReader;
+public class CatalogQueryTest {
+       private static final String MAP_KEY = "keyTest";
+       private static final String VALUE_MAP = "valueTest";
+       private CatalogQuery testedObject;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization;
+       @Before
+       public void init() {
+               testedObject = new CatalogQueryForTesting();
+       }
 
-import static org.junit.Assert.*;
+       @Test
+       public void putStringValueToMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               testedObject.put(valueMap, MAP_KEY, VALUE_MAP);
+               assertThat(valueMap).hasSize(1).containsEntry(MAP_KEY, "\"valueTest\"");
+       }
 
+       @Test
+       public void putNullStringValueToMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               String value = null;
+               testedObject.put(valueMap, MAP_KEY, value);
+               assertThat(valueMap).hasSize(1).containsEntry(MAP_KEY, "null");
+       }
 
-@RunWith(MockitoJUnitRunner.class)
-public class CatalogQueryTest {
+       @Test
+       public void putIntegerValueToMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               testedObject.put(valueMap, MAP_KEY, 1);
+               assertThat(valueMap).hasSize(1).containsEntry(MAP_KEY, "1");
+       }
+
+       @Test
+       public void putNullIntegerValueToMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               Integer value = null;
+               testedObject.put(valueMap, MAP_KEY, value);
+               assertThat(valueMap).hasSize(1).containsEntry(MAP_KEY, "null");
+       }
+
+       @Test
+       public void putTrueBooleanValueToMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               testedObject.put(valueMap, MAP_KEY, true);
+               assertThat(valueMap).hasSize(1).containsEntry(MAP_KEY, "true");
+       }
+
+       @Test
+       public void putFalseBooleanValueToMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               testedObject.put(valueMap, MAP_KEY, false);
+               assertThat(valueMap).hasSize(1).containsEntry(MAP_KEY, "false");
+       }
+
+       @Test
+       public void putNullBooleanValueToMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               Boolean value = null;
+               testedObject.put(valueMap, MAP_KEY, value);
+               assertThat(valueMap).hasSize(1).containsEntry(MAP_KEY, "null");
+       }
 
-       
        @Test
-       public void catalogQuerySetTemplateImpl_Test(){
-               CatalogQuery mockCatalogQuery = Mockito.mock(CatalogQuery.class);
-               Mockito.doCallRealMethod().when(mockCatalogQuery).setTemplate(Mockito.anyString(), Mockito.anyMapOf(String.class, String.class));
-               
-               Map<String,String> valueMap = new HashMap<>();
-               valueMap.put("somekey", "somevalue");
-               
-               String ret = mockCatalogQuery.setTemplate("<somekey>", valueMap);
-               
-               assertTrue(ret.equalsIgnoreCase("somevalue"));
-       }
-       
+       public void setTemplate_keyFindInMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               valueMap.put(MAP_KEY, VALUE_MAP);
+               String template = "<keyTest>";
+               String result = testedObject.setTemplate(template, valueMap);
+               assertThat(result).isEqualTo(VALUE_MAP);
+       }
+
+       @Test
+       public void setTemplate_keyNotFindInMap() {
+               Map<String, String> valueMap = new HashMap<>();
+               String template = "<keyTest>";
+               String result = testedObject.setTemplate(template, valueMap);
+               assertThat(result).isEqualTo("\"TBD\"");
+       }
+
+       @Test
+       public void setTemplate_templateDoesNotMatch() {
+               Map<String, String> valueMap = new HashMap<>();
+               String template = "key";
+               String result = testedObject.setTemplate(template, valueMap);
+               assertThat(result).isEqualTo("key");
+       }
+
+       @Test
+       public void smartToJson(){
+               String expectedResult = "{\"s\":\"s1\"}";
+               assertThat(testedObject.smartToJSON()).isEqualTo(expectedResult);
+       }
+
+       @Test
+       public void toJsonString_withVersion1() {
+               String expectedResult = "{\"s\":\"s1\"}";
+               assertThat(testedObject.toJsonString("v1",true)).isEqualTo(expectedResult);
+       }
+
        @Test
-       public void smartToJson_Test()
-       {
-        List<VnfResourceCustomization> paramList = new ArrayList<>();
-        VnfResourceCustomization d1 = new VnfResourceCustomization();
-        d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
-        d1.setModelInstanceName("RG_6-26_mog11 0");
-        d1.setVersion("v1");
-        paramList.add(d1);
-        
-        QueryServiceVnfs qryResp = new QueryServiceVnfs(paramList);
-        QueryServiceVnfs mockCatalogQuery = Mockito.spy(qryResp);
-        Mockito.doCallRealMethod().when(mockCatalogQuery).smartToJSON();
-               String ret = qryResp.smartToJSON();
-               // System.out.println(ret);
-               
-        JsonReader reader = Json.createReader(new StringReader(ret.replaceAll("\r?\n", "")));
-        JsonObject respObj = reader.readObject();
-        reader.close();
-        JsonArray jArray = respObj.getJsonArray("serviceVnfs");
-               assertEquals(jArray.size(), 1);
-               assertEquals(jArray.getJsonObject(0).getString("modelCustomizationUuid"), "16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
-       }       
-       
+       public void toJsonString_withVersion2() {
+               assertThat(testedObject.toJsonString("v2",true)).isEqualTo("json2");
+       }
+
        @Test
-       public void toJsonString_Test()
-       {
-               CatalogQueryExtendedTest mockCatalogQuery = Mockito.mock(CatalogQueryExtendedTest.class);
-               Mockito.doCallRealMethod().when(mockCatalogQuery).JSON2(Mockito.anyBoolean(), Mockito.anyBoolean());
-               String ret = mockCatalogQuery.JSON2(true, true);
-               
-               // System.out.println(ret);
-               
-        JsonReader reader = Json.createReader(new StringReader(ret.replaceAll("\r?\n", "")));
-        JsonObject respObj = reader.readObject();
-        reader.close();
-        JsonArray jArray = respObj.getJsonArray("serviceVnfs");
-               assertEquals(jArray.size(), 1);
-               assertEquals(jArray.getJsonObject(0).getString("modelCustomizationUuid"), "16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
-               assertEquals(jArray.getJsonObject(0).getString("version"), "v2");
-       }       
-       
-       class CatalogQueryExtendedTest extends CatalogQuery{
+       public void toJsonString_withInvalidVersion() {
+               assertThat(testedObject.toJsonString("ver77",true)).isEqualTo("invalid version: ver77");
+       }
+
+       private class CatalogQueryForTesting extends CatalogQuery {
+
+               private String s = "s1";
+
+               public String getS() {
+                       return s;
+               }
+
                @Override
                public String JSON2(boolean isArray, boolean isEmbed) {
-                       return "{\"serviceVnfs\":[{\"version\":\"v2\",\"modelCustomizationUuid\":\"16ea3e56-a8ce-4ad7-8edd-4d2eae095391\",\"modelInstanceName\":\"ciVFOnboarded-FNAT-aab06c41 1\",\"created\":null,\"vnfResourceModelUuid\":null,\"vnfResourceModelUUID\":null,\"minInstances\":null,\"maxInstances\":null,\"availabilityZoneMaxCount\":null,\"vnfResource\":null,\"nfFunction\":null,\"nfType\":null,\"nfRole\":null,\"nfNamingCode\":null,\"multiStageDesign\":null,\"vfModuleCustomizations\":null,\"serviceResourceCustomizations\":null,\"creationTimestamp\":null}]}";
+                       return "json2";
                }
-               
-       }       
-       
+       }
+
 }
 
 
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java
new file mode 100644 (file)
index 0000000..fa1a1fc
--- /dev/null
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.catalogdb.catalogrest;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.Recipe;
+import org.openecomp.mso.jsonpath.JsonPathUtil;
+
+public class QueryResourceRecipeTest {
+
+    private static final int RECIPE_ID = 123;
+    private static final String RECIPE_ACTION = "actionTest";
+    private static final String RECIPE_URI = "uriTest";
+    private static final int RECIPE_TIMEOUT = 100;
+    private static final String RECIPE_PARAMS_XSD = "paramsXsdTest";
+    private static final String RECIPE_DESCRIPTION = "descrTest";
+
+    private QueryResourceRecipe testedObject;
+
+    @Before
+    public void init() {
+        testedObject = new QueryResourceRecipe(createRecipe());
+    }
+
+    @Test
+    public void convertingToJsonSuccessful() {
+        String jsonResult = testedObject.JSON2(true, true);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.id")).contains(String.valueOf(RECIPE_ID));
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.action")).contains(RECIPE_ACTION);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.orchestrationUri")).contains(RECIPE_URI);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.recipeTimeout"))
+                .contains(String.valueOf(RECIPE_TIMEOUT));
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.paramXSD")).contains(RECIPE_PARAMS_XSD);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.description")).contains(RECIPE_DESCRIPTION);
+    }
+
+    @Test
+    public void toString_properContent() {
+        assertThat(testedObject.toString()).contains("RECIPE: actionTest,uri=uriTest");
+    }
+
+    private Recipe createRecipe() {
+        Recipe recipe = new Recipe();
+        recipe.setId(RECIPE_ID);
+        recipe.setAction(RECIPE_ACTION);
+        recipe.setOrchestrationUri(RECIPE_URI);
+        recipe.setRecipeTimeout(RECIPE_TIMEOUT);
+        recipe.setParamXSD(RECIPE_PARAMS_XSD);
+        recipe.setDescription(RECIPE_DESCRIPTION);
+        return recipe;
+    }
+
+}
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsarTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceCsarTest.java
new file mode 100644 (file)
index 0000000..e9c947d
--- /dev/null
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.catalogdb.catalogrest;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.ToscaCsar;
+import org.openecomp.mso.jsonpath.JsonPathUtil;
+
+public class QueryServiceCsarTest {
+
+    private static final String TOSCA_ARTIFACT_UUID = "artUuidTest";
+    private static final String TOSCA_NAME = "toscaNameTest";
+    private static final String TOSCA_VERSION = "v12";
+    private static final String TOSCA_ARTIFACT_CHECKSUM = "tosArtCheck";
+    private static final String TOSCA_URL = "tosUrl";
+    private static final String TOSCA_DESCRIPTION = "toscaDescr";
+
+    private QueryServiceCsar testedObject;
+
+    @Before
+    public void init() {
+        testedObject = new QueryServiceCsar(createToscaCsar());
+    }
+
+    @Test
+    public void convertToJson_successful() {
+        String jsonResult = testedObject.JSON2(true, true);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.artifactUUID")).contains(TOSCA_ARTIFACT_UUID);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.name")).contains(TOSCA_NAME);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.version")).contains(TOSCA_VERSION);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.artifactChecksum"))
+                .contains(String.valueOf(TOSCA_ARTIFACT_CHECKSUM));
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.url")).contains(TOSCA_URL);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.description")).contains(TOSCA_DESCRIPTION);
+    }
+
+    @Test
+    public void toString_properContent() {
+        assertThat(testedObject.toString()).contains(
+                "TOSCACSAR: artifactUUID=artUuidTest,name=toscaNameTest,version=v12,description=toscaDescr,artifactChecksum=tosArtCheck,url=tosUrl");
+    }
+
+    private ToscaCsar createToscaCsar() {
+        ToscaCsar toscaCsar = new ToscaCsar();
+        toscaCsar.setArtifactUUID(TOSCA_ARTIFACT_UUID);
+        toscaCsar.setName(TOSCA_NAME);
+        toscaCsar.setVersion(TOSCA_VERSION);
+        toscaCsar.setArtifactChecksum(TOSCA_ARTIFACT_CHECKSUM);
+        toscaCsar.setUrl(TOSCA_URL);
+        toscaCsar.setDescription(TOSCA_DESCRIPTION);
+        return toscaCsar;
+    }
+
+}
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModuleTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModuleTest.java
new file mode 100644 (file)
index 0000000..b00b5b7
--- /dev/null
@@ -0,0 +1,96 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.catalogdb.catalogrest;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.VfModule;
+import org.openecomp.mso.db.catalog.beans.VfModuleCustomization;
+import org.openecomp.mso.jsonpath.JsonPathUtil;
+
+public class QueryVfModuleTest {
+
+    private static final String VF_MODULE_MODEL_NAME = "vfModelNameTest";
+    private static final String VF_MODEL_UUID = "vfModelUuidTest";
+    private static final String VF_MODULE_INVARIANT_UUID = "vfModuleInvUuid";
+    private static final String VF_MODULE_VERSION = "vfModuleVerTest";
+
+    private static final String VF_MODEL_CUSTOMIZATION_UUID = "modelCustomizationUuid";
+    private static final String VF_MODEL_CUSTOMIZATION_LABEL = "modelCustomizationLabel";
+    private static final int VF_MODEL_CUSTOMIZATION_INITIAL_COUNT = 1;
+
+    @Test
+    public void convertToJson_successful() {
+        QueryVfModule testedObject = new QueryVfModule(createList());
+        String jsonResult = testedObject.JSON2(true, false);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].modelInfo.modelName"))
+                .contains(VF_MODULE_MODEL_NAME);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].modelInfo.modelUuid"))
+                .contains(VF_MODEL_UUID);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].modelInfo.modelInvariantUuid"))
+                .contains(VF_MODULE_INVARIANT_UUID);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].isBase"))
+                .contains("true");
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].vfModuleLabel"))
+                .contains(VF_MODEL_CUSTOMIZATION_LABEL);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].initialCount"))
+                .contains(String.valueOf(VF_MODEL_CUSTOMIZATION_INITIAL_COUNT));
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].hasVolumeGroup"))
+                .contains("false");
+    }
+
+    @Test
+    public void convertToJson_successful_hasVolumeGroupIsTrue() {
+        QueryVfModule testedObject = new QueryVfModule(createListWithHeatEnvironmentArtifactUuid());
+        String jsonResult = testedObject.JSON2(true, false);
+        assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.vfModules[0].hasVolumeGroup"))
+                .contains("true");
+    }
+
+    private List<VfModuleCustomization> createList() {
+        List<VfModuleCustomization> list = new ArrayList<>();
+
+        VfModule vfModule = new VfModule();
+        vfModule.setModelName(VF_MODULE_MODEL_NAME);
+        vfModule.setModelUUID(VF_MODEL_UUID);
+        vfModule.setModelInvariantUuid(VF_MODULE_INVARIANT_UUID);
+        vfModule.setVersion(VF_MODULE_VERSION);
+        vfModule.setIsBase(1);
+
+        VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+        vfModuleCustomization.setVfModule(vfModule);
+        vfModuleCustomization.setModelCustomizationUuid(VF_MODEL_CUSTOMIZATION_UUID);
+        vfModuleCustomization.setLabel(VF_MODEL_CUSTOMIZATION_LABEL);
+        vfModuleCustomization.setInitialCount(VF_MODEL_CUSTOMIZATION_INITIAL_COUNT);
+        list.add(vfModuleCustomization);
+        return list;
+    }
+
+    private List<VfModuleCustomization> createListWithHeatEnvironmentArtifactUuid() {
+        List<VfModuleCustomization> list = createList();
+        list.get(0).setHeatEnvironmentArtifactUuid("heatEnvTest");
+        return list;
+    }
+
+}
index fc4e522..9d986d9 100644 (file)
@@ -596,23 +596,34 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
             \r
             List<NodeTemplate> allottedResourceList = toscaResourceStruct.getSdcCsarHelper().getAllottedResources();\r
                \r
-                       if(allottedResourceList != null){\r
-                       \r
-                               for(NodeTemplate allottedNode : allottedResourceList){\r
-                                       \r
-                                       createAllottedResource(allottedNode, toscaResourceStruct);\r
-                                       \r
-                                       catalogDB.saveAllottedResource(toscaResourceStruct.getAllottedResource());\r
-                                       \r
-                                       catalogDB.saveAllottedResourceCustomization(toscaResourceStruct.getCatalogAllottedResourceCustomization());\r
-                                       \r
-                                       catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogAllottedServiceToResourceCustomization());\r
-                                       \r
-                               }\r
-                       }\r
-                       \r
+                       if(allottedResourceList != null){\r
+\r
+                               for(NodeTemplate allottedNode : allottedResourceList){\r
+\r
+                                       createAllottedResource(allottedNode, toscaResourceStruct);\r
+\r
+                                       catalogDB.saveAllottedResource(toscaResourceStruct.getAllottedResource());\r
+\r
+                                       catalogDB.saveAllottedResourceCustomization(toscaResourceStruct.getCatalogAllottedResourceCustomization());\r
+\r
+                                       catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogAllottedServiceToResourceCustomization());\r
+\r
+                               }\r
+                       }\r
+\r
+                       // handle VF resource\r
+                       List<NodeTemplate> serviceVfList = toscaResourceStruct.getSdcCsarHelper().getServiceVfList();\r
+                       if (serviceVfList != null) {\r
+                               for (NodeTemplate vfNode : serviceVfList) {\r
+                                       createVnfResource(vfNode, toscaResourceStruct);\r
+                                       catalogDB.saveVnfResource(toscaResourceStruct.getCatalogVnfResource());\r
+                                       catalogDB.saveVnfResourceCustomization(toscaResourceStruct.getCatalogVnfResourceCustomization());\r
+                                       catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogVfServiceToResourceCustomization());\r
+                               }\r
+                       }\r
+\r
 \r
-               List<NodeTemplate> nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList();\r
+                       List<NodeTemplate> nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList();\r
                                \r
                        if(nodeTemplatesVLList != null){\r
                                \r
@@ -1104,6 +1115,8 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
                vnfResource.setToscaNodeType(testNull(vfNodeTemplate.getType()));\r
                vnfResource.setAicVersionMax(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));\r
                vnfResource.setAicVersionMin(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));\r
+               vnfResource.setCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));\r
+               vnfResource.setSubCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));\r
                //vnfResource.setHeatTemplateArtifactUUId(toscaResourceStructure.getHeatTemplateUUID());\r
                \r
        //      vfNodeTemplate.getProperties()\r
index 7976e51..bd35b0a 100644 (file)
Binary files a/asdc-controller/src/main/resources/resource-examples/resource_Extvl.csar and b/asdc-controller/src/main/resources/resource-examples/resource_Extvl.csar differ
index fc21af3..29d30f8 100644 (file)
Binary files a/asdc-controller/src/main/resources/resource-examples/service-ServiceFdnt-csar-0904-2.csar and b/asdc-controller/src/main/resources/resource-examples/service-ServiceFdnt-csar-0904-2.csar differ
index 41ee2c7..f2b9535 100644 (file)
Binary files a/asdc-controller/src/main/resources/resource-examples/service-ServiceFdnt-with-allotted.csar and b/asdc-controller/src/main/resources/resource-examples/service-ServiceFdnt-with-allotted.csar differ
index 288498e..beb4ddb 100644 (file)
Binary files a/asdc-controller/src/main/resources/resource-examples/service_Rg516VmmscSrvc_csar.csar and b/asdc-controller/src/main/resources/resource-examples/service_Rg516VmmscSrvc_csar.csar differ
index 88ed9fb..1233d04 100644 (file)
@@ -294,8 +294,8 @@ class SNIROUtils{
                if(isBlank(response)){\r
                        exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Sniro Async Callback Response is Empty")\r
                }else{\r
-                       if(JsonUtils.jsonElementExist(response, "solutionInfo.placementInfo")){\r
-                               placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")\r
+                       if(JsonUtils.jsonElementExist(response, "solutionInfo.placement")){\r
+                               placements = jsonUtil.getJsonValue(response, "solutionInfo.placement")\r
                                if(isBlank(placements) || placements.equalsIgnoreCase("[]")){\r
                                        String statusMessage = jsonUtil.getJsonValue(response, "statusMessage")\r
                                        if(isBlank(statusMessage)){\r
index 3f53437..0fdd790 100755 (executable)
@@ -182,7 +182,7 @@ class SniroHoming extends AbstractServiceTaskProcessor {
             utils.logAudit("Sniro Async Callback Response is: " + response)
 
             sniroUtils.validateCallbackResponse(execution, response)
-            String placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")
+            String placements = jsonUtil.getJsonValue(response, "solutionInfo.placement")
 
             ServiceDecomposition decomposition = execution.getVariable("serviceDecomposition")
             utils.log("DEBUG", "Service Decomposition: " + decomposition, isDebugEnabled)
index bee4765..e6b1b21 100644 (file)
@@ -94,7 +94,11 @@ public class ResourceRequestBuilder {
                 resourceInputsFromUui = JsonUtils.getJsonValue(resourceParameters, "requestInputs");
             }
         }
-        Map<String, Object> serviceInput =getJsonObject((String)JsonUtils.getJsonValue(serviceParameters, "requestInputs"), Map.class);
+        Map<String, Object> serviceInput = null;
+        if (JsonUtils.getJsonValue(serviceParameters, "requestInputs") != null) {
+            serviceInput = getJsonObject((String)JsonUtils.getJsonValue(serviceParameters, "requestInputs"), Map.class);
+        }
+
         Map<String, Object> resourceInputsFromUuiMap = getJsonObject(resourceInputsFromUui, Map.class);
 
         if (serviceInput == null) {
index db11db5..b4543b1 100644 (file)
@@ -109,13 +109,13 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
                        msoLogger.debug(logMarker + "Exception in startProcessInstance by key");\r
                WorkflowResponse response = new WorkflowResponse();\r
                        response.setMessage("Fail" );\r
-                       response.setResponse("Error occurred while executing the process: " + e);\r
+                       response.setContent("Error occurred while executing the process: " + e);\r
                        response.setMessageCode(500);\r
                        recordEvents(processKey, response, startTime);\r
                        \r
                        msoLogger.error (MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, logMarker \r
                                        + response.getMessage() + " for processKey: " \r
-                                       + processKey + " with response: " + response.getResponse());\r
+                                       + processKey + " with content: " + response.getContent());\r
                        \r
                        Response errorResponse = Response.serverError().entity(response).build();\r
                        asyncResponse.setResponse(errorResponse);\r
@@ -245,10 +245,10 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
                \r
                msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, \r
                                logMarker + response.getMessage() + " for processKey: "\r
-                               + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);\r
+                               + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null);\r
                \r
                msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, \r
-                               logMarker + response.getMessage() + "for processKey: " + processKey + " with response: " + response.getResponse());\r
+                               logMarker + response.getMessage() + "for processKey: " + processKey + " with content: " + response.getContent());\r
                \r
        }\r
 \r
index 731b18d..4dfae8b 100644 (file)
@@ -108,15 +108,15 @@ public class WorkflowContextHolder {
                                + ":process key:" + processKey);
                        workflowResponse.setMessage("Fail");
                        workflowResponse.setMessageCode(400);
-                       workflowResponse.setResponse("Unable to correlate workflow context, bad request. Request Id: " + requestId);
+                       workflowResponse.setContent("Unable to correlate workflow context, bad request. Request Id: " + requestId);
                        return Response.serverError().entity(workflowResponse).build();
                }
 
                responseQueue.remove(workflowContext);
 
                msoLogger.debug("Using callback response for request id: " + requestId);
-               workflowResponse.setResponse(callbackResponse.getResponse());
-               workflowResponse.setProcessInstanceID(processInstanceId);
+               workflowResponse.setContent(callbackResponse.getResponse());
+               workflowResponse.setProcessInstanceId(processInstanceId);
                workflowResponse.setMessageCode(callbackResponse.getStatusCode());
                workflowResponse.setMessage(callbackResponse.getMessage());
                sendWorkflowResponseToClient(processKey, workflowContext, workflowResponse);
@@ -152,7 +152,7 @@ public class WorkflowContextHolder {
                                        msoLogger.debug("Preparing timeout response for " + requestObject.getProcessKey() + ":" + ":" + requestObject.getRequestId());
                                        WorkflowResponse response = new WorkflowResponse();
                                        response.setMessage("Fail");
-                                       response.setResponse("Request timedout, request id:" + requestObject.getRequestId());
+                                       response.setContent("Request timedout, request id:" + requestObject.getRequestId());
                                        //response.setProcessInstanceID(requestObject.getProcessInstance().getProcessInstanceId());
                                        recordEvents(requestObject.getProcessKey(), response, requestObject.getStartTime());
                                        response.setMessageCode(500);
@@ -178,11 +178,11 @@ public class WorkflowContextHolder {
 
                msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
                                logMarker + response.getMessage() + " for processKey: "
-                               + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);
+                               + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null);
                
                msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, logMarker 
                                + response.getMessage() + " for processKey: " 
-                               + processKey + " with response: " + response.getResponse());
+                               + processKey + " with content: " + response.getContent());
                
        }
 }
index dd100a3..25c67fe 100644 (file)
@@ -135,7 +135,7 @@ public class WorkflowResource extends ProcessEngineAwareService {
                                }\r
 \r
                                String processInstanceId = processInstance.getId();\r
-                               workflowResponse.setProcessInstanceID(processInstanceId);                               \r
+                               workflowResponse.setProcessInstanceId(processInstanceId);                               \r
 \r
                                responseMap = getResponseMap(processInstance, processKey, timeProcessEnded);\r
 \r
@@ -172,23 +172,23 @@ public class WorkflowResource extends ProcessEngineAwareService {
 \r
                        workflowResponse.setMessage("Fail");\r
                        if (endedWithNoResponse) {\r
-                               workflowResponse.setResponse("Process ended without producing a response");\r
+                               workflowResponse.setContent("Process ended without producing a response");\r
                        } else {\r
-                               workflowResponse.setResponse("Request timed out, process state: " + state);\r
+                               workflowResponse.setContent("Request timed out, process state: " + state);\r
                        }\r
-                       workflowResponse.setProcessInstanceID(processInstanceId);\r
+                       workflowResponse.setProcessInstanceId(processInstanceId);\r
                        recordEvents(processKey, workflowResponse, startTime);\r
                        workflowResponse.setMessageCode(500);\r
                        return Response.status(500).entity(workflowResponse).build();\r
                } catch (Exception ex) {\r
                        msoLogger.debug(LOGMARKER + "Exception in startProcessInstance by key",ex);\r
                        workflowResponse.setMessage("Fail" );\r
-                       workflowResponse.setResponse("Error occurred while executing the process: " + ex.getMessage());\r
-                       if (processInstance != null) workflowResponse.setProcessInstanceID(processInstance.getId());\r
+                       workflowResponse.setContent("Error occurred while executing the process: " + ex.getMessage());\r
+                       if (processInstance != null) workflowResponse.setProcessInstanceId(processInstance.getId());\r
                        \r
                        msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG,  "BPMN", MDC.get(processKey), \r
                                        MsoLogger.ErrorCode.UnknownError, LOGMARKER + workflowResponse.getMessage()\r
-                                       + " for processKey: " + processKey + " with response: " + workflowResponse.getResponse());\r
+                                       + " for processKey: " + processKey + " with content: " + workflowResponse.getContent());\r
                        \r
                        workflowResponse.setMessageCode(500);\r
                        recordEvents(processKey, workflowResponse, startTime);\r
@@ -221,11 +221,11 @@ public class WorkflowResource extends ProcessEngineAwareService {
                \r
                msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, \r
                                LOGMARKER + response.getMessage() + " for processKey: "\r
-                               + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);\r
+                               + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null);\r
                \r
                msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, \r
                                LOGMARKER + response.getMessage() + " for processKey: "\r
-                               + processKey + " with response: " + response.getResponse());\r
+                               + processKey + " with content: " + response.getContent());\r
        }\r
 \r
        private void setLogContext(String processKey, Map<String, Object> inputVariables) {\r
@@ -262,13 +262,13 @@ public class WorkflowResource extends ProcessEngineAwareService {
 \r
        private void processResponseMap(WorkflowResponse workflowResponse, Map<String, Object> responseMap) {\r
                Object object = responseMap.get("Response");\r
-               String response = object == null ? null : String.valueOf(object);\r
-               if(response == null){\r
+               String content = object == null ? null : String.valueOf(object);\r
+               if (content == null){\r
                        object = responseMap.get("WorkflowResponse");\r
-                       response = object == null ? null : String.valueOf(object);\r
+                       content = object == null ? null : String.valueOf(object);\r
                }\r
 \r
-               workflowResponse.setResponse(response); \r
+               workflowResponse.setContent(content); \r
 \r
                object = responseMap.get("ResponseCode");\r
                String responseCode = object == null ? null : String.valueOf(object);\r
@@ -584,31 +584,31 @@ public class WorkflowResource extends ProcessEngineAwareService {
                        \r
                        response.setVariables(variablesMap);\r
                        response.setMessage("Success");\r
-                       response.setResponse("Successfully retrieved the variables"); \r
-                       response.setProcessInstanceID(processInstanceId);\r
+                       response.setContent("Successfully retrieved the variables"); \r
+                       response.setProcessInstanceId(processInstanceId);\r
 \r
-                       msoLogger.debug(LOGMARKER + response.getMessage() + " for processKey: " + processKey + " with response: " + response.getResponse());\r
+                       msoLogger.debug(LOGMARKER + response.getMessage() + " for processKey: " + processKey + " with content: " + response.getContent());\r
                } catch (Exception ex) {\r
                        response.setMessage("Fail");\r
-                       response.setResponse("Failed to retrieve the variables," + ex.getMessage()); \r
-                       response.setProcessInstanceID(processInstanceId);\r
+                       response.setContent("Failed to retrieve the variables," + ex.getMessage()); \r
+                       response.setProcessInstanceId(processInstanceId);\r
                        \r
                        msoLogger.error (MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "BPMN", MDC.get(processKey), MsoLogger.ErrorCode.UnknownError, LOGMARKER \r
                                        + response.getMessage() \r
                                        + " for processKey: " \r
                                        + processKey \r
-                                       + " with response: " \r
-                                       + response.getResponse());\r
+                                       + " with content: " \r
+                                       + response.getContent());\r
                        msoLogger.debug("Exception :",ex);\r
                }\r
                \r
                msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, \r
                                LOGMARKER + response.getMessage() + " for processKey: "\r
-                               + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null);\r
+                               + processKey + " with content: " + response.getContent(), "BPMN", MDC.get(processKey), null);\r
                \r
                msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, \r
                                LOGMARKER + response.getMessage() + " for processKey: "\r
-                               + processKey + " with response: " + response.getResponse());\r
+                               + processKey + " with content: " + response.getContent());\r
                \r
                return response;\r
        }\r
index e0382d1..02702e3 100644 (file)
@@ -22,48 +22,76 @@ package org.openecomp.mso.bpmn.common.workflow.service;
 \r
 import java.util.Map;\r
 \r
+import com.fasterxml.jackson.annotation.JsonProperty;\r
+\r
 /**\r
- * @version 1.0\r
- * Synchronous workflow response bean \r
- *\r
+ * A synchronous response from a workflow.\r
  */\r
 public class WorkflowResponse {\r
 \r
-       private String response;\r
-       private String message;\r
-       private String processInstanceID;\r
-       private Map<String,String> variables;\r
+       @JsonProperty("processInstanceId")\r
+       private String processInstanceId;\r
+\r
+       @JsonProperty("messageCode")\r
        private int messageCode;\r
+\r
+       @JsonProperty("message")\r
+       private String message;\r
        \r
-       public String getResponse() {\r
-               return response; \r
+       @JsonProperty("variables")\r
+       private Map<String,String> variables;\r
+\r
+       @JsonProperty("content")\r
+       private String content;\r
+\r
+       public String getProcessInstanceId() {\r
+               return processInstanceId;\r
        }\r
-       public void setResponse(String response) {\r
-               this.response = response;\r
+\r
+       public void setProcessInstanceId(String processInstanceId) {\r
+               this.processInstanceId = processInstanceId;\r
+       }\r
+\r
+       public int getMessageCode() {\r
+               return messageCode;\r
        }\r
+\r
+       public void setMessageCode(int messageCode) {\r
+               this.messageCode = messageCode;\r
+       }\r
+\r
        public String getMessage() {\r
                return message;\r
        }\r
+\r
        public void setMessage(String message) {\r
                this.message = message;\r
        }\r
-       public String getProcessInstanceID() {\r
-               return processInstanceID;\r
-       }\r
-       public void setProcessInstanceID(String pID) {\r
-               this.processInstanceID = pID;\r
-       }\r
-       public Map<String, String> getVariables() {\r
+\r
+       public Map<String,String> getVariables() {\r
                return variables;\r
        }\r
-       public void setVariables(Map<String, String> variables) {\r
+\r
+       public void setVariables(Map<String,String> variables) {\r
                this.variables = variables;\r
        }\r
-       public void setMessageCode(int messageCode) {\r
-               this.messageCode = messageCode;\r
+\r
+       public String getContent() {\r
+               return content;\r
        }\r
-       \r
-       public int getMessageCode() {\r
-               return messageCode;\r
+\r
+       public void setContent(String content) {\r
+               this.content = content;\r
+       }\r
+\r
+       @Override\r
+       public String toString() {\r
+               return getClass().getSimpleName() + "["\r
+                       + "processInstanceId=" + processInstanceId\r
+                       + ",messageCode=" + messageCode\r
+                       + ",message=" + message\r
+                       + ",variables=" + variables\r
+                       + ",content=" + content\r
+                       + "]";\r
        }\r
-}\r
+}
\ No newline at end of file
index 9d4dac2..bf69223 100644 (file)
@@ -46,7 +46,7 @@ public class CompleteMsoProcessTest extends WorkflowTest {
                variables.put("CompleteMsoProcessRequest",inputRequestFile);\r
                \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CompleteMsoProcess", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
                logEnd();\r
        }       \r
        \r
index 457128f..13c400e 100644 (file)
@@ -50,7 +50,7 @@ public class ConfirmVolumeGroupTenantTest extends WorkflowTest {
                setVariables(variables);
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "ConfirmVolumeGroupTenant", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String actualNameMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "groupNamesMatch");
                String actualIdMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "tenantIdsMatch");
@@ -70,7 +70,7 @@ public class ConfirmVolumeGroupTenantTest extends WorkflowTest {
                setVariables(variables);
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "ConfirmVolumeGroupTenant", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String actualNameMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "groupNamesMatch");
                String actualIdMatch = BPMNUtil.getVariable(processEngineRule, "ConfirmVolumeGroupTenant", "tenantIdsMatch");
index 257cec9..c3259a0 100644 (file)
@@ -62,7 +62,7 @@ public class FalloutHandlerTest extends WorkflowTest {
                variables.put("FalloutHandlerRequest",inputRequestFile);\r
                \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "FalloutHandler", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
                System.out.println("ENDED TEST: " + method);\r
        }       \r
        \r
index 125a9ad..67ac34c 100644 (file)
@@ -54,7 +54,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                Map<String, String> variables = new HashMap<>();
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234");
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
                String resourceVersionProvidedFlag = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_resourceVersionProvidedFlag");
@@ -74,7 +74,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesSubscription(variables, "", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
@@ -98,7 +98,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
@@ -122,7 +122,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesSubscription(variables, null, "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
@@ -146,7 +146,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
@@ -168,7 +168,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesSubscription(variables, "", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
@@ -193,7 +193,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "1234");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
@@ -214,7 +214,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "1234");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
@@ -240,7 +240,7 @@ public class GenericDeleteServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", null);
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteService", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_SuccessIndicator");
                String foundIndicator = BPMNUtil.getVariable(processEngineRule, "GenericDeleteService", "GENDS_FoundIndicator");
index add9a32..a318be5 100644 (file)
@@ -55,7 +55,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("true", "true", "true", null);
 
@@ -70,7 +70,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "vce", "testReVer123");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("true", "true", "true", null);
 
@@ -87,7 +87,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "generic-vnf", "");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("true", "true", "false", null);
 
@@ -103,7 +103,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "vce", null);
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("true", "true", "false", null);
 
@@ -118,7 +118,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("true", "false", "true", null);
 
@@ -133,7 +133,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "vce", "testReVer123");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("true", "false", "true", null);
 
@@ -148,7 +148,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "generic-vnf", "");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("true", "false", "false", null);
 
@@ -162,7 +162,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "", "testReVer123");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("false", "false", "true", "WorkflowException[processKey=GenericDeleteVnf,errorCode=500,errorMessage=Incoming Required Variable is Missing or Null!]");
 
@@ -177,7 +177,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("false", "false", "true", "WorkflowException[processKey=GenericDeleteVnf,errorCode=500,errorMessage=Received a bad response from AAI]");
 
@@ -192,7 +192,7 @@ public class GenericDeleteVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "generic-vnf", "testReVer123");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericDeleteVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables("false", "false", "true", "WorkflowException[processKey=GenericDeleteVnf,errorCode=412,errorMessage=Delete Vnf Received a resource-version Mismatch Error Response from AAI]");
 
index 0198395..6da6924 100644 (file)
@@ -59,7 +59,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                Map<String, String> variables = new HashMap<>();\r
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");\r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
                String obtainUrl = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_obtainObjectsUrl");\r
@@ -85,7 +85,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesSubscription(variables, "", null , "1604-MVM-26", "SDN-ETHERNET-INTERNET");\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -113,7 +113,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, null, "1604-MVM-26", null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -143,7 +143,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -172,7 +172,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -196,7 +196,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", "1604-MVM-26");\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -223,7 +223,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "", "1604-MVM-26", null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -250,7 +250,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -277,7 +277,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, "SDN-ETHERNET-INTERNET", "123456789");\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -301,7 +301,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "", "1604-MVM-26", null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -328,7 +328,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -354,7 +354,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, null, null, "SDN-ETHERNET-INTERNET", null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -379,7 +379,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesSubscription(variables, "", "", "SDN-ETHERNET-INTERNET", null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -407,7 +407,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", "1604-MVM-26", "SDN-ETHERNET-INTERNET", "123456789");\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -434,7 +434,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, "MIS%2F1604%2F0026%2FSW_INTERNET", null, null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -463,7 +463,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, null, "1604-MVM-26", null, null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -493,7 +493,7 @@ public class GenericGetServiceTest extends WorkflowTest {
         setVariablesInstance(variables, null, "1604-MVM-26", "XyCorporation", null);\r
 \r
         WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-        waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+        waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
         String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
         String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
@@ -521,7 +521,7 @@ public class GenericGetServiceTest extends WorkflowTest {
                setVariablesInstance(variables, null, "1604-MVM-26", "CorporationNotPresent", null);\r
 \r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetService", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_SuccessIndicator");\r
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetService", "GENGS_FoundIndicator");\r
index 4922263..7de493a 100644 (file)
@@ -56,7 +56,7 @@ public class GenericGetVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "testVnfName123", "generic-vnf");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator");
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator");
@@ -83,7 +83,7 @@ public class GenericGetVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "testVnfName123", "vce");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator");
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator");
@@ -110,7 +110,7 @@ public class GenericGetVnfTest extends WorkflowTest {
                setVariables(variables, "", "testVnfName123", "generic-vnf");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator");
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator");
@@ -137,7 +137,7 @@ public class GenericGetVnfTest extends WorkflowTest {
                setVariables(variables, null, "testVnfName123", "vce");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator");
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator");
@@ -166,7 +166,7 @@ public class GenericGetVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", "testVnfName123", "generic-vnf");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericGetVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_SuccessIndicator");
                String found = BPMNUtil.getVariable(processEngineRule, "GenericGetVnf", "GENGV_FoundIndicator");
index 0e0a237..7c003c9 100644 (file)
@@ -55,7 +55,7 @@ public class GenericPutVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator");
                String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException");
@@ -75,7 +75,7 @@ public class GenericPutVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", vcePayload, "vce");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator");
                String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException");
@@ -95,7 +95,7 @@ public class GenericPutVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", genericVnfPayload, "");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator");
                String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException");
@@ -117,7 +117,7 @@ public class GenericPutVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", genericVnfPayload, "");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator");
                String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException");
@@ -137,7 +137,7 @@ public class GenericPutVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator");
                String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException");
@@ -158,7 +158,7 @@ public class GenericPutVnfTest extends WorkflowTest {
                setVariables(variables, "testVnfId123", genericVnfPayload, "generic-vnf");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "GenericPutVnf", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String successIndicator = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "GENPV_SuccessIndicator");
                String workflowException = BPMNUtil.getVariable(processEngineRule, "GenericPutVnf", "WorkflowException");
index 0349b17..02e029d 100644 (file)
@@ -95,7 +95,7 @@ public class SDNCAdapterV1Test extends WorkflowTest {
                Response response = workflowResource.startProcessInstanceByKey("sdncAdapter", varMap);\r
                WorkflowResponse workflowResponse = (WorkflowResponse) response.getEntity();\r
 \r
-               //String pid = workflowResponse.getProcessInstanceID();\r
+               //String pid = workflowResponse.getProcessInstanceId();\r
                //System.out.println("Back from executing process instance with pid=" + pid);\r
                return workflowResponse;\r
        }\r
@@ -364,7 +364,7 @@ public class SDNCAdapterV1Test extends WorkflowTest {
                WorkflowResponse response = thread.workflowResponse;\r
                Assert.assertNotNull(response);\r
                Assert.assertEquals("404 error", response.getMessageCode(),7000);\r
-//             assertProcessInstanceFinished(response.getProcessInstanceID());\r
+//             assertProcessInstanceFinished(response.getProcessInstanceId());\r
                //System.out.println("SDNCAdapter bad synchronous response flow Completed!");\r
        }\r
 \r
@@ -442,7 +442,7 @@ public class SDNCAdapterV1Test extends WorkflowTest {
 \r
                public void run() {\r
                        workflowResponse = invokeFlow(workflowRequest);\r
-                       workflowResponse.getProcessInstanceID();\r
+                       workflowResponse.getProcessInstanceId();\r
                }\r
        }\r
 \r
index 541dc6e..314d4d3 100644 (file)
@@ -536,12 +536,12 @@ public class SniroHomingTest extends WorkflowTest {
        }
 
        private String verifySniroRequest(){
-               String request = "{\"requestInfo\":{\"transactionId\":\"testRequestId\",\"requestId\":\"testRequestId\",\"callbackUrl\":\"http://localhost:28090/workflows/messages/message/SNIROResponse/testRequestId\",\"sourceId\":\"mso\",\"requestType\":\"initial\",\"optimizer\":[\"placement\",\"license\"],\"numSolutions\":1,\"timeout\":1800},\"placementInfo\":{\"serviceModelInfo\":{\"modelType\":\"\",\"modelInvariantId\":\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":\"testModelName\",\"modelVersion\":\"testModelVersion\"},\"subscriberInfo\":{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\",\"subscriberCommonSiteId\":\"\"},\"demandInfo\":{\"placementDemand\":[{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR\",\"modelInvariantId\":\"testModelInvariantIdAR\",\"modelName\":\"testModelNameAR\",\"modelVersion\":\"testModelVersionAR\",\"modelVersionId\":\"testARModelUuid\",\"modelType\":\"testModelTypeAR\"},\"tenantId\":\"\",\"tenantName\":\"\"},{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR2\",\"modelInvariantId\":\"testModelInvariantIdAR2\",\"modelName\":\"testModelNameAR2\",\"modelVersion\":\"testModelVersionAR2\",\"modelVersionId\":\"testAr2ModelUuid\",\"modelType\":\"testModelTypeAR2\"},\"tenantId\":\"\",\"tenantName\":\"\"}],\"licenseDemand\":[{\"resourceInstanceType\":\"VNF\",\"serviceResourceId\":\"testResourceIdVNF\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidVNF\",\"modelInvariantId\":\"testModelInvariantIdVNF\",\"modelName\":\"testModelNameVNF\",\"modelVersion\":\"testModelVersionVNF\",\"modelVersionId\":\"testVnfModelUuid\",\"modelType\":\"testModelTypeVNF\"}}]},\"policyId\":[],\"serviceInstanceId\":\"testServiceInstanceId123\",\"orderInfo\":\"{\\\"requestParameters\\\":null}\"}}";
+               String request = "{\"requestInfo\":{\"transactionId\":\"testRequestId\",\"requestId\":\"testRequestId\",\"callbackUrl\":\"http://localhost:28090/workflows/messages/message/SNIROResponse/testRequestId\",\"sourceId\":\"mso\",\"requestType\":\"initial\",\"optimizer\":[\"placement\",\"license\"],\"numSolutions\":1,\"timeout\":1800},\"placement\":{\"serviceModelInfo\":{\"modelType\":\"\",\"modelInvariantId\":\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":\"testModelName\",\"modelVersion\":\"testModelVersion\"},\"subscriberInfo\":{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\",\"subscriberCommonSiteId\":\"\"},\"demandInfo\":{\"placementDemand\":[{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR\",\"modelInvariantId\":\"testModelInvariantIdAR\",\"modelName\":\"testModelNameAR\",\"modelVersion\":\"testModelVersionAR\",\"modelVersionId\":\"testARModelUuid\",\"modelType\":\"testModelTypeAR\"},\"tenantId\":\"\",\"tenantName\":\"\"},{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR2\",\"modelInvariantId\":\"testModelInvariantIdAR2\",\"modelName\":\"testModelNameAR2\",\"modelVersion\":\"testModelVersionAR2\",\"modelVersionId\":\"testAr2ModelUuid\",\"modelType\":\"testModelTypeAR2\"},\"tenantId\":\"\",\"tenantName\":\"\"}],\"licenseDemand\":[{\"resourceInstanceType\":\"VNF\",\"serviceResourceId\":\"testResourceIdVNF\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidVNF\",\"modelInvariantId\":\"testModelInvariantIdVNF\",\"modelName\":\"testModelNameVNF\",\"modelVersion\":\"testModelVersionVNF\",\"modelVersionId\":\"testVnfModelUuid\",\"modelType\":\"testModelTypeVNF\"}}]},\"policyId\":[],\"serviceInstanceId\":\"testServiceInstanceId123\",\"orderInfo\":\"{\\\"requestParameters\\\":null}\"}}";
                return request;
        }
 
        private String verifySniroRequest_existingLicense(){
-               String request = "{\"requestInfo\":{\"transactionId\":\"testRequestId\",\"requestId\":\"testRequestId\",\"callbackUrl\":\"http://localhost:28090/workflows/messages/message/SNIROResponse/testRequestId\",\"sourceId\":\"mso\",\"requestType\":\"speedchanged\",\"optimizer\":[\"placement\",\"license\"],\"numSolutions\":1,\"timeout\":1800},\"placementInfo\":{\"serviceModelInfo\":{\"modelType\":\"\",\"modelInvariantId\":\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":\"testModelName\",\"modelVersion\":\"testModelVersion\"},\"subscriberInfo\":{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\",\"subscriberCommonSiteId\":\"\"},\"demandInfo\":{\"placementDemand\":[{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR\",\"modelInvariantId\":\"testModelInvariantIdAR\",\"modelName\":\"testModelNameAR\",\"modelVersion\":\"testModelVersionAR\",\"modelVersionId\":\"testARModelUuid\",\"modelType\":\"testModelTypeAR\"},\"tenantId\":\"\",\"tenantName\":\"\"},{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR2\",\"modelInvariantId\":\"testModelInvariantIdAR2\",\"modelName\":\"testModelNameAR2\",\"modelVersion\":\"testModelVersionAR2\",\"modelVersionId\":\"testAr2ModelUuid\",\"modelType\":\"testModelTypeAR2\"},\"tenantId\":\"\",\"tenantName\":\"\"}],\"licenseDemand\":[{\"resourceInstanceType\":\"VNF\",\"serviceResourceId\":\"testResourceIdVNF\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidVNF\",\"modelInvariantId\":\"testModelInvariantIdVNF\",\"modelName\":\"testModelNameVNF\",\"modelVersion\":\"testModelVersionVNF\",\"modelVersionId\":\"testVnfModelUuid\",\"modelType\":\"testModelTypeVNF\"},\"existingLicense\":[{\"entitlementPoolUUID\":[\"testEntitlementPoolId1\",\"testEntitlementPoolId2\"],\"licenseKeyGroupUUID\":[\"testLicenseKeyGroupId1\",\"testLicenseKeyGroupId2\"]}]}]},\"policyId\":[],\"serviceInstanceId\":\"testServiceInstanceId123\",\"orderInfo\":\"{\\\"requestParameters\\\":null}\"}}";
+               String request = "{\"requestInfo\":{\"transactionId\":\"testRequestId\",\"requestId\":\"testRequestId\",\"callbackUrl\":\"http://localhost:28090/workflows/messages/message/SNIROResponse/testRequestId\",\"sourceId\":\"mso\",\"requestType\":\"speedchanged\",\"optimizer\":[\"placement\",\"license\"],\"numSolutions\":1,\"timeout\":1800},\"placement\":{\"serviceModelInfo\":{\"modelType\":\"\",\"modelInvariantId\":\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":\"testModelName\",\"modelVersion\":\"testModelVersion\"},\"subscriberInfo\":{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\",\"subscriberCommonSiteId\":\"\"},\"demandInfo\":{\"placementDemand\":[{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR\",\"modelInvariantId\":\"testModelInvariantIdAR\",\"modelName\":\"testModelNameAR\",\"modelVersion\":\"testModelVersionAR\",\"modelVersionId\":\"testARModelUuid\",\"modelType\":\"testModelTypeAR\"},\"tenantId\":\"\",\"tenantName\":\"\"},{\"resourceInstanceType\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR2\",\"modelInvariantId\":\"testModelInvariantIdAR2\",\"modelName\":\"testModelNameAR2\",\"modelVersion\":\"testModelVersionAR2\",\"modelVersionId\":\"testAr2ModelUuid\",\"modelType\":\"testModelTypeAR2\"},\"tenantId\":\"\",\"tenantName\":\"\"}],\"licenseDemand\":[{\"resourceInstanceType\":\"VNF\",\"serviceResourceId\":\"testResourceIdVNF\",\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidVNF\",\"modelInvariantId\":\"testModelInvariantIdVNF\",\"modelName\":\"testModelNameVNF\",\"modelVersion\":\"testModelVersionVNF\",\"modelVersionId\":\"testVnfModelUuid\",\"modelType\":\"testModelTypeVNF\"},\"existingLicense\":[{\"entitlementPoolUUID\":[\"testEntitlementPoolId1\",\"testEntitlementPoolId2\"],\"licenseKeyGroupUUID\":[\"testLicenseKeyGroupId1\",\"testLicenseKeyGroupId2\"]}]}]},\"policyId\":[],\"serviceInstanceId\":\"testServiceInstanceId123\",\"orderInfo\":\"{\\\"requestParameters\\\":null}\"}}";
                return request;
        }
 
index 5f91298..5562cb8 100644 (file)
@@ -48,7 +48,7 @@ public class WorkflowAsyncResourceTest extends WorkflowTest {
                variables.put("mso-service-request-timeout", "5");
                
                WorkflowResponse workflowResponse = BPMNUtil.executeAsyncWorkflow(processEngineRule, "testAsyncProcess", variables);
-               assertEquals("Received the request, the process is getting executed, request message<aetgt:CreateTenantRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\">  <msoservtypes:service-information xmlns:msoservtypes=\"http://org.openecomp/mso/request/types/v1\">    <msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type>    <msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id>    <msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> </aetgt:CreateTenantRequest>", workflowResponse.getResponse());
+               assertEquals("Received the request, the process is getting executed, request message<aetgt:CreateTenantRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\">  <msoservtypes:service-information xmlns:msoservtypes=\"http://org.openecomp/mso/request/types/v1\">    <msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type>    <msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id>    <msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> </aetgt:CreateTenantRequest>", workflowResponse.getContent());
                assertEquals(200, workflowResponse.getMessageCode());
        }
 
index 0da711a..6e2699a 100644 (file)
@@ -87,7 +87,7 @@ public class WorkflowContextHolderTest {
                Assert.assertNotNull(response1.getMessage());
                Assert.assertEquals(200,response1.getMessageCode());
                Assert.assertEquals("Success", response1.getMessage());
-               Assert.assertEquals("Successfully processed request", response1.getResponse());
+               Assert.assertEquals("Successfully processed request", response1.getContent());
                verify(asyncResponse).setResponse(any(Response.class));
 
                WorkflowContext context1 = contextHolder.getWorkflowContext(workflowContext.getRequestId());
index 9b8a249..de25107 100644 (file)
@@ -1526,7 +1526,7 @@ public class WorkflowTest {
                                }\r
                                else {\r
                                        try {\r
-                                               String homingList = getJsonValue(content, "solutionInfo.placementInfo");\r
+                                               String homingList = getJsonValue(content, "solutionInfo.placement");\r
                                                String licenseInfoList = getJsonValue(content, "solutionInfo.licenseInfo");\r
                                                JSONArray placementArr = new JSONArray(homingList);\r
                                                JSONArray licenseArr = new JSONArray(licenseInfoList);\r
@@ -1558,7 +1558,7 @@ public class WorkflowTest {
                                                }\r
                                                String newPlacementInfos = placementArr.toString();\r
                                                String newLicenseInfos = licenseArr.toString();\r
-                                               content = updJsonValue(content, "solutionInfo.placementInfo", newPlacementInfos);\r
+                                               content = updJsonValue(content, "solutionInfo.placement", newPlacementInfos);\r
                                                content = updJsonValue(content, "solutionInfo.licenseInfo", newLicenseInfos);\r
                                        }\r
                                        catch(Exception e) {\r
index 7bb1000..644f983 100644 (file)
@@ -52,7 +52,7 @@ public class JsonUtilsTest {
        public void entryArrayToMapTest() throws IOException {
                JsonUtils utils = new JsonUtils();
                String response = this.getJson("SNIROExample.json");
-               String entry = utils.getJsonValue(response, "solutionInfo.placementInfo");
+               String entry = utils.getJsonValue(response, "solutionInfo.placement");
                JSONArray arr = new JSONArray(entry);
                JSONObject homingDataJson = arr.getJSONObject(0);
                JSONArray assignmentInfo = homingDataJson.getJSONArray("assignmentInfo");
index 838bcd8..7e56b1a 100644 (file)
@@ -11,7 +11,7 @@
                                ]
                        }
                ],
-               "placementInfo": [
+               "placement": [
                        {
                                "assignmentInfo": [
                                        {
index 39820dc..d8405aa 100644 (file)
@@ -277,11 +277,19 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
                                }
                        }
                                                
-                       if (cloudRegionId != null) {                    
-                               AAIUri cloudRegionUri = AAIUriFactory.createResourceUri(AAIObjectType.DEFAULT_CLOUD_REGION, cloudRegionId)                              
+                       if (cloudRegionId != null) {
+                               String cloudOwnerId = "att-aic"; 
+                               try {
+                                   cloudOwnerId = execution.getVariable("URN_mso_default_cloud_owner_id");
+                                   if (cloudOwnerId == null) cloudOwnerId = "att-aic";
+                               } catch (RuntimeException e) {
+                                       cloudOwnerId = "att-aic"; 
+                               }
+                               
+                               AAIUri cloudRegionUri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudOwnerId, cloudRegionId)                                
                                // Check if this client region exists
                                if (!client.exists(cloudRegionUri)) {
-                                       logDebug("Cloud Region with cloudRegionId " + cloudRegionId + " does not exist in A&AI", isDebugLogEnabled)
+                                       logDebug("Cloud Region with cloudOwner ID " + cloudOwnerId + " and cloudRegionId " + cloudRegionId + " does not exist in A&AI", isDebugLogEnabled)
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 404, "Cloud Region with cloudRegionId " + cloudRegionId + " does not exist in A&AI")
                                }
                        
index 94d221a..361313e 100644 (file)
@@ -29,4 +29,5 @@ public class ExecutionVariableNames {
     public final static String AAI_CONTAINS_INFO_ABOUT_PNF = "aaiContainsInfoAboutPnf";
     public final static String AAI_CONTAINS_INFO_ABOUT_IP = "aaiContainsInfoAboutIp";
     public final static String DMAAP_MESSAGE = "dmaapMessage";
+    public final static String TIMEOUT_FOR_NOTIFICATION = "timeoutForPnfEntryNotification";
 }
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
new file mode 100644 (file)
index 0000000..268113d
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure.pnf.delegate;
+
+import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
+import org.openecomp.mso.logger.MsoLogger;
+
+public class PnfCheckInputs implements JavaDelegate {
+
+    private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
+
+    private String defaultTimeout;
+
+    @Override
+    public void execute(DelegateExecution execution) throws Exception {
+        String correlationId = (String) execution.getVariable(CORRELATION_ID);
+        if (correlationId == null) {
+            new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "correlationId variable not defined");
+        }
+        String timeout = (String) execution.getVariable(TIMEOUT_FOR_NOTIFICATION);
+        if (timeout == null) {
+            LOGGER.debug("timeoutForPnfEntryNotification variable not found, setting default");
+            if (defaultTimeout == null) {
+                new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999,
+                        "default timeoutForPnfEntryNotification value not defined");
+            }
+            execution.setVariable(TIMEOUT_FOR_NOTIFICATION, defaultTimeout);
+        }
+    }
+
+    public void setDefaultTimeout(String defaultTimeout) {
+        this.defaultTimeout = defaultTimeout;
+    }
+}
index 5b1ffac..6807a24 100644 (file)
@@ -6,4 +6,6 @@ eventReadyTopicName=pnfEventReady
 consumerId=consumerId
 consumerGroup=group
 clientThreadInitialDelayInSeconds=1
-clientThreadDelayInSeconds=5
\ No newline at end of file
+clientThreadDelayInSeconds=5
+
+pnfDefaultTimeout=P14D
index c118105..8f2bf67 100644 (file)
   <bpmn:process id="CreateAndActivatePnfResource" name="CreateAndActivatePnfResource" isExecutable="true">
     <bpmn:sequenceFlow id="SequenceFlow_1kc34bc" sourceRef="WaitForDmaapTimeout" targetRef="CancelDmaapClientSubscription" />
     <bpmn:sequenceFlow id="SequenceFlow_1o8od8e" sourceRef="InformDmaapClient" targetRef="WaitForDmaapPnfReadyNotification" />
+    <bpmn:sequenceFlow id="SequenceFlow_0v5ffpe" name="No" sourceRef="DoesAaiContainInfoAboutPnf" targetRef="CreateAndActivatePnf_CreateAaiEntry">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{!aaiContainsInfoAboutPnf}</bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+    <bpmn:sequenceFlow id="SequenceFlow_0p09qgm" sourceRef="WaitForDmaapPnfReadyNotification" targetRef="AaiEntryUpdated" />
     <bpmn:sequenceFlow id="SequenceFlow_17s9025" sourceRef="AaiEntryExists" targetRef="InformDmaapClient" />
+    <bpmn:sequenceFlow id="SequenceFlow_1qr6cmf" sourceRef="CreateAndActivatePnf_CreateAaiEntry" targetRef="AaiEntryExists" />
+    <bpmn:sequenceFlow id="SequenceFlow_1j4r3zt" sourceRef="CheckAiiForCorrelationId" targetRef="DoesAaiContainInfoAboutPnf" />
+    <bpmn:sequenceFlow id="SequenceFlow_0j5ksz1" sourceRef="CreateAndActivatePnf_StartEvent" targetRef="CheckInputs" />
+    <bpmn:sequenceFlow id="SequenceFlow_1miyzfe" sourceRef="CancelDmaapClientSubscription" targetRef="ThrowTimeoutException" />
     <bpmn:sequenceFlow id="SequenceFlow_1ls8pua" name="No" sourceRef="DoesAaiContainInfoAboutIp" targetRef="AaiEntryExists">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{!aaiContainsInfoAboutIp}</bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:sequenceFlow id="SequenceFlow_1qr6cmf" sourceRef="CreateAndActivatePnf_CreateAaiEntry" targetRef="AaiEntryExists" />
-    <bpmn:sequenceFlow id="SequenceFlow_0v5ffpe" name="No" sourceRef="DoesAaiContainInfoAboutPnf" targetRef="CreateAndActivatePnf_CreateAaiEntry">
-      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{!aaiContainsInfoAboutPnf}</bpmn:conditionExpression>
-    </bpmn:sequenceFlow>
     <bpmn:sequenceFlow id="SequenceFlow_1l1t6ak" name="Yes" sourceRef="DoesAaiContainInfoAboutPnf" targetRef="DoesAaiContainInfoAboutIp">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{aaiContainsInfoAboutPnf}</bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:sequenceFlow id="SequenceFlow_1j4r3zt" sourceRef="CheckAiiForCorrelationId" targetRef="DoesAaiContainInfoAboutPnf" />
-    <bpmn:sequenceFlow id="SequenceFlow_0j5ksz1" sourceRef="CreateAndActivatePnf_StartEvent" targetRef="CheckAiiForCorrelationId" />
-    <bpmn:sequenceFlow id="SequenceFlow_0p09qgm" sourceRef="WaitForDmaapPnfReadyNotification" targetRef="AaiEntryUpdated" />
     <bpmn:sequenceFlow id="SequenceFlow_1h6yz62" name="Yes" sourceRef="DoesAaiContainInfoAboutIp" targetRef="AaiEntryAlreadyUpToDate">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{aaiContainsInfoAboutIp}</bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:endEvent id="AaiEntryAlreadyUpToDate" name="AAI entry already up-to-date">
-      <bpmn:incoming>SequenceFlow_1h6yz62</bpmn:incoming>
+    <bpmn:endEvent id="AaiEntryUpdated" name="AAI entry updated">
+      <bpmn:incoming>SequenceFlow_0p09qgm</bpmn:incoming>
     </bpmn:endEvent>
-    <bpmn:exclusiveGateway id="DoesAaiContainInfoAboutIp" name="Does AAI contain info about IPv4 or IPv6?">
-      <bpmn:incoming>SequenceFlow_1l1t6ak</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_1h6yz62</bpmn:outgoing>
-      <bpmn:outgoing>SequenceFlow_1ls8pua</bpmn:outgoing>
-    </bpmn:exclusiveGateway>
     <bpmn:endEvent id="ThrowTimeoutException" name="Throw timeout exception">
       <bpmn:incoming>SequenceFlow_1miyzfe</bpmn:incoming>
       <bpmn:errorEventDefinition errorRef="Error_1" />
     </bpmn:endEvent>
-    <bpmn:sequenceFlow id="SequenceFlow_1miyzfe" sourceRef="CancelDmaapClientSubscription" targetRef="ThrowTimeoutException" />
-    <bpmn:serviceTask id="CheckAiiForCorrelationId" name="Check AAI for correlation_id" camunda:delegateExpression="${checkAaiForCorrelationIdDelegate}">
-      <bpmn:incoming>SequenceFlow_0j5ksz1</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_1j4r3zt</bpmn:outgoing>
-    </bpmn:serviceTask>
+    <bpmn:endEvent id="AaiEntryAlreadyUpToDate" name="AAI entry already up-to-date">
+      <bpmn:incoming>SequenceFlow_1h6yz62</bpmn:incoming>
+    </bpmn:endEvent>
     <bpmn:startEvent id="CreateAndActivatePnf_StartEvent">
       <bpmn:outgoing>SequenceFlow_0j5ksz1</bpmn:outgoing>
     </bpmn:startEvent>
-    <bpmn:intermediateThrowEvent id="AaiEntryExists" name="AAI entry exists, lacking IP">
-      <bpmn:incoming>SequenceFlow_1qr6cmf</bpmn:incoming>
-      <bpmn:incoming>SequenceFlow_1ls8pua</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_17s9025</bpmn:outgoing>
-    </bpmn:intermediateThrowEvent>
-    <bpmn:endEvent id="AaiEntryUpdated" name="AAI entry updated">
-      <bpmn:incoming>SequenceFlow_0p09qgm</bpmn:incoming>
-    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_0967g8p" sourceRef="CheckInputs" targetRef="CheckAiiForCorrelationId" />
+    <bpmn:serviceTask id="CheckAiiForCorrelationId" name="Check AAI for correlation_id" camunda:delegateExpression="${checkAaiForCorrelationIdDelegate}">
+      <bpmn:incoming>SequenceFlow_0967g8p</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1j4r3zt</bpmn:outgoing>
+    </bpmn:serviceTask>
     <bpmn:exclusiveGateway id="DoesAaiContainInfoAboutPnf" name="Does AAI contain info about pnf?">
       <bpmn:incoming>SequenceFlow_1j4r3zt</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1l1t6ak</bpmn:outgoing>
       <bpmn:incoming>SequenceFlow_0v5ffpe</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1qr6cmf</bpmn:outgoing>
     </bpmn:serviceTask>
+    <bpmn:exclusiveGateway id="DoesAaiContainInfoAboutIp" name="Does AAI contain info about IPv4 or IPv6?">
+      <bpmn:incoming>SequenceFlow_1l1t6ak</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1h6yz62</bpmn:outgoing>
+      <bpmn:outgoing>SequenceFlow_1ls8pua</bpmn:outgoing>
+    </bpmn:exclusiveGateway>
+    <bpmn:intermediateThrowEvent id="AaiEntryExists" name="AAI entry exists, lacking IP">
+      <bpmn:incoming>SequenceFlow_1qr6cmf</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_1ls8pua</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_17s9025</bpmn:outgoing>
+    </bpmn:intermediateThrowEvent>
     <bpmn:serviceTask id="InformDmaapClient" name="Inform DmaapClient about business key and corresponding pnf-id" camunda:delegateExpression="${informDmaapClient}">
       <bpmn:incoming>SequenceFlow_17s9025</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1o8od8e</bpmn:outgoing>
       <bpmn:incoming>SequenceFlow_1kc34bc</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1miyzfe</bpmn:outgoing>
     </bpmn:serviceTask>
-    <bpmn:association id="Association_0d7oxnz" sourceRef="CreateAndActivatePnf_StartEvent" targetRef="TextAnnotation_1eyzes8" />
+    <bpmn:serviceTask id="CheckInputs" name="Check inputs" camunda:delegateExpression="${pnfCheckInputs}">
+      <bpmn:incoming>SequenceFlow_0j5ksz1</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0967g8p</bpmn:outgoing>
+    </bpmn:serviceTask>
     <bpmn:textAnnotation id="TextAnnotation_1eyzes8">
       <bpmn:text><![CDATA[Inputs:
 Â - timeoutForPnfEntryNotification - String
  - correlationId - String
 ]]></bpmn:text>
     </bpmn:textAnnotation>
+    <bpmn:association id="Association_0d7oxnz" sourceRef="CreateAndActivatePnf_StartEvent" targetRef="TextAnnotation_1eyzes8" />
   </bpmn:process>
   <bpmn:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
   <bpmn:message id="Message_13h1tlo" name="WorkflowMessage" />
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1d0w8lf">
       <bpmndi:BPMNShape id="Participant_1egg397_di" bpmnElement="Participant_1egg397">
-        <dc:Bounds x="0" y="0" width="1488" height="437" />
+        <dc:Bounds x="-113" y="0" width="1601" height="438" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_1cttgdo_di" bpmnElement="DoesAaiContainInfoAboutPnf" isMarkerVisible="true">
-        <dc:Bounds x="338" y="182" width="50" height="50" />
+        <dc:Bounds x="390" y="182" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="320" y="283" width="85" height="20" />
+          <dc:Bounds x="372" y="283" width="85" height="20" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_0yamdfm_di" bpmnElement="DoesAaiContainInfoAboutIp" isMarkerVisible="true">
-        <dc:Bounds x="646" y="41" width="50" height="50" />
+        <dc:Bounds x="682" y="41" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="627" y="5" width="87" height="30" />
+          <dc:Bounds x="663" y="5" width="87" height="30" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_0k52gr7_di" bpmnElement="AaiEntryUpdated">
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="StartEvent_0j5ok9h_di" bpmnElement="CreateAndActivatePnf_StartEvent">
-        <dc:Bounds x="49" y="189" width="36" height="36" />
+        <dc:Bounds x="-54" y="189" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="23" y="228" width="90" height="20" />
+          <dc:Bounds x="-80" y="228" width="90" height="20" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0a5uk9o_di" bpmnElement="CheckAiiForCorrelationId">
-        <dc:Bounds x="159" y="167" width="100" height="80" />
+        <dc:Bounds x="219" y="167" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0iimk5v_di" bpmnElement="CreateAndActivatePnf_CreateAaiEntry">
-        <dc:Bounds x="467" y="167" width="100" height="80" />
+        <dc:Bounds x="511" y="167" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1j4r3zt_di" bpmnElement="SequenceFlow_1j4r3zt">
-        <di:waypoint xsi:type="dc:Point" x="259" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="338" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="319" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="390" y="207" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="253.5" y="187" width="90" height="10" />
+          <dc:Bounds x="309.5" y="187" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1l1t6ak_di" bpmnElement="SequenceFlow_1l1t6ak">
-        <di:waypoint xsi:type="dc:Point" x="363" y="182" />
-        <di:waypoint xsi:type="dc:Point" x="363" y="66" />
-        <di:waypoint xsi:type="dc:Point" x="646" y="66" />
+        <di:waypoint xsi:type="dc:Point" x="415" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="415" y="66" />
+        <di:waypoint xsi:type="dc:Point" x="682" y="66" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="378" y="159" width="19" height="10" />
+          <dc:Bounds x="430" y="180.1206896551724" width="19" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0v5ffpe_di" bpmnElement="SequenceFlow_0v5ffpe">
-        <di:waypoint xsi:type="dc:Point" x="388" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="467" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="440" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="511" y="207" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="396.3963414634147" y="210" width="15" height="10" />
+          <dc:Bounds x="447.32911392405055" y="210" width="15" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1h6yz62_di" bpmnElement="SequenceFlow_1h6yz62">
-        <di:waypoint xsi:type="dc:Point" x="696" y="66" />
+        <di:waypoint xsi:type="dc:Point" x="732" y="66" />
         <di:waypoint xsi:type="dc:Point" x="1312" y="66" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="708.1232876712329" y="51" width="19" height="10" />
+          <dc:Bounds x="742.7435064935065" y="51" width="19" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1ls8pua_di" bpmnElement="SequenceFlow_1ls8pua">
-        <di:waypoint xsi:type="dc:Point" x="671" y="91" />
-        <di:waypoint xsi:type="dc:Point" x="671" y="164" />
-        <di:waypoint xsi:type="dc:Point" x="671" y="164" />
-        <di:waypoint xsi:type="dc:Point" x="671" y="189" />
+        <di:waypoint xsi:type="dc:Point" x="707" y="91" />
+        <di:waypoint xsi:type="dc:Point" x="707" y="189" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="681" y="105" width="15" height="10" />
+          <dc:Bounds x="717" y="116.1917808219178" width="15" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1qr6cmf_di" bpmnElement="SequenceFlow_1qr6cmf">
-        <di:waypoint xsi:type="dc:Point" x="567" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="653" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="611" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="689" y="207" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="565" y="187" width="90" height="10" />
+          <dc:Bounds x="605" y="187" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0j5ksz1_di" bpmnElement="SequenceFlow_0j5ksz1">
-        <di:waypoint xsi:type="dc:Point" x="85" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="122" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="122" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="159" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="-18" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="48" y="207" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="92" y="202" width="90" height="10" />
+          <dc:Bounds x="-30" y="187" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="Participant_0i9ban2_di" bpmnElement="Participant_0atuyq0">
         <dc:Bounds x="123" y="523" width="502" height="60" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="MessageFlow_1h3xu88_di" bpmnElement="MessageFlow_1h3xu88">
-        <di:waypoint xsi:type="dc:Point" x="517" y="247" />
-        <di:waypoint xsi:type="dc:Point" x="517" y="523" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="247" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="523" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="487" y="380" width="90" height="10" />
+          <dc:Bounds x="531" y="380" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="MessageFlow_09ibv5a_di" bpmnElement="MessageFlow_09ibv5a">
-        <di:waypoint xsi:type="dc:Point" x="190" y="247" />
-        <di:waypoint xsi:type="dc:Point" x="190" y="523" />
+        <di:waypoint xsi:type="dc:Point" x="250" y="247" />
+        <di:waypoint xsi:type="dc:Point" x="250" y="523" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="160" y="404" width="90" height="10" />
+          <dc:Bounds x="220" y="380" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="MessageFlow_0vjul4t_di" bpmnElement="MessageFlow_0vjul4t">
-        <di:waypoint xsi:type="dc:Point" x="229" y="523" />
-        <di:waypoint xsi:type="dc:Point" x="229" y="247" />
+        <di:waypoint xsi:type="dc:Point" x="289" y="523" />
+        <di:waypoint xsi:type="dc:Point" x="289" y="247" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="199" y="404" width="90" height="10" />
+          <dc:Bounds x="259" y="380" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="Participant_0vmrrhf_di" bpmnElement="Participant_19w87ws">
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_0fjcdy4_di" bpmnElement="AaiEntryExists">
-        <dc:Bounds x="653" y="189" width="36" height="36" />
+        <dc:Bounds x="689" y="189" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="634" y="235" width="80" height="20" />
+          <dc:Bounds x="670" y="235" width="80" height="20" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="TextAnnotation_1eyzes8_di" bpmnElement="TextAnnotation_1eyzes8">
-        <dc:Bounds x="66" y="70" width="243" height="54" />
+        <dc:Bounds x="-37" y="70" width="243" height="54" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="Association_0d7oxnz_di" bpmnElement="Association_0d7oxnz">
-        <di:waypoint xsi:type="dc:Point" x="67" y="189" />
-        <di:waypoint xsi:type="dc:Point" x="67" y="124" />
+        <di:waypoint xsi:type="dc:Point" x="-36" y="189" />
+        <di:waypoint xsi:type="dc:Point" x="-36" y="124" />
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="MessageFlow_1vrcp2d_di" bpmnElement="MessageFlow_1vrcp2d">
-        <di:waypoint xsi:type="dc:Point" x="1006" y="523" />
-        <di:waypoint xsi:type="dc:Point" x="1006" y="247" />
+        <di:waypoint xsi:type="dc:Point" x="1026" y="523" />
+        <di:waypoint xsi:type="dc:Point" x="1026" y="247" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="976" y="380" width="90" height="10" />
+          <dc:Bounds x="996" y="380" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_17s9025_di" bpmnElement="SequenceFlow_17s9025">
-        <di:waypoint xsi:type="dc:Point" x="689" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="775" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="725" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="803" y="207" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="687" y="187" width="90" height="10" />
+          <dc:Bounds x="719" y="187" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="BoundaryEvent_15eo1k9_di" bpmnElement="WaitForDmaapTimeout">
-        <dc:Bounds x="1020" y="229" width="36" height="36" />
+        <dc:Bounds x="1040" y="229" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1051" y="260" width="40" height="10" />
+          <dc:Bounds x="1071" y="260" width="40" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1kc34bc_di" bpmnElement="SequenceFlow_1kc34bc">
-        <di:waypoint xsi:type="dc:Point" x="1038" y="265" />
-        <di:waypoint xsi:type="dc:Point" x="1038" y="363" />
-        <di:waypoint xsi:type="dc:Point" x="1133" y="363" />
+        <di:waypoint xsi:type="dc:Point" x="1058" y="265" />
+        <di:waypoint xsi:type="dc:Point" x="1058" y="363" />
+        <di:waypoint xsi:type="dc:Point" x="1145" y="363" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1008" y="309" width="90" height="10" />
+          <dc:Bounds x="1028" y="309" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ReceiveTask_1sfysua_di" bpmnElement="WaitForDmaapPnfReadyNotification">
-        <dc:Bounds x="954" y="167" width="100" height="80" />
+        <dc:Bounds x="974" y="167" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0p09qgm_di" bpmnElement="SequenceFlow_0p09qgm">
-        <di:waypoint xsi:type="dc:Point" x="1054" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="1074" y="207" />
         <di:waypoint xsi:type="dc:Point" x="1312" y="207" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1138" y="187" width="90" height="10" />
+          <dc:Bounds x="1148" y="187" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1o8od8e_di" bpmnElement="SequenceFlow_1o8od8e">
-        <di:waypoint xsi:type="dc:Point" x="875" y="207" />
-        <di:waypoint xsi:type="dc:Point" x="954" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="903" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="974" y="207" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="869.5" y="187" width="90" height="10" />
+          <dc:Bounds x="893.5" y="187" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="MessageFlow_0tg4hw9_di" bpmnElement="MessageFlow_0tg4hw9">
-        <di:waypoint xsi:type="dc:Point" x="825" y="247" />
-        <di:waypoint xsi:type="dc:Point" x="825" y="523" />
+        <di:waypoint xsi:type="dc:Point" x="853" y="247" />
+        <di:waypoint xsi:type="dc:Point" x="853" y="523" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="795" y="380" width="90" height="10" />
+          <dc:Bounds x="823" y="380" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ServiceTask_1iax11n_di" bpmnElement="InformDmaapClient">
-        <dc:Bounds x="775" y="167" width="100" height="80" />
+        <dc:Bounds x="803" y="167" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1miyzfe_di" bpmnElement="SequenceFlow_1miyzfe">
-        <di:waypoint xsi:type="dc:Point" x="1233" y="363" />
+        <di:waypoint xsi:type="dc:Point" x="1245" y="363" />
         <di:waypoint xsi:type="dc:Point" x="1312" y="363" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1227.5" y="343" width="90" height="10" />
+          <dc:Bounds x="1233.5" y="343" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="MessageFlow_1py54jr_di" bpmnElement="MessageFlow_1py54jr">
-        <di:waypoint xsi:type="dc:Point" x="1183" y="403" />
-        <di:waypoint xsi:type="dc:Point" x="1183" y="523" />
+        <di:waypoint xsi:type="dc:Point" x="1195" y="403" />
+        <di:waypoint xsi:type="dc:Point" x="1195" y="523" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1153" y="458" width="90" height="10" />
+          <dc:Bounds x="1165" y="458" width="90" height="10" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ServiceTask_12j7hox_di" bpmnElement="CancelDmaapClientSubscription">
-        <dc:Bounds x="1133" y="323" width="100" height="80" />
+        <dc:Bounds x="1145" y="323" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0967g8p_di" bpmnElement="SequenceFlow_0967g8p">
+        <di:waypoint xsi:type="dc:Point" x="148" y="207" />
+        <di:waypoint xsi:type="dc:Point" x="219" y="207" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="183.5" y="187" width="0" height="10" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0lx02qn_di" bpmnElement="CheckInputs">
+        <dc:Bounds x="48" y="167" width="100" height="80" />
       </bpmndi:BPMNShape>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
index 2120e12..03d7362 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
   <bpmn2:process id="CreateVcpeResCustService" name="CreateVcpeResCustService" isExecutable="true">
     <bpmn2:scriptTask id="sendSyncAckResponse_ScriptTask" name="Send Sync Ack Response" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
@@ -447,6 +447,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s
         <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
         <camunda:in source="serviceDecomposition" target="serviceDecomposition" />
         <camunda:in source="subscriberInfo" target="subscriberInfo" />
+        <camunda:in source="homingService" target="homingService" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_11efpvh</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1jbuf1t</bpmn2:outgoing>
index a3e63fa..94b88f7 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
   <bpmn2:process id="CreateVcpeResCustServiceV2" name="CreateVcpeResCustServiceV2" isExecutable="true">
     <bpmn2:scriptTask id="sendSyncAckResponse_ScriptTask" name="Send Sync Ack Response" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
@@ -447,6 +447,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s
         <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
         <camunda:in source="serviceDecomposition" target="serviceDecomposition" />
         <camunda:in source="subscriberInfo" target="subscriberInfo" />
+        <camunda:in source="homingService" target="homingService" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_11efpvh</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1jbuf1t</bpmn2:outgoing>
index 13ab4f8..7a0aa60 100644 (file)
@@ -38,4 +38,8 @@
     <property name="locations" value="classpath:dmaap.properties"/>\r
   </bean>\r
 \r
+  <bean id="pnfCheckInputs" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.PnfCheckInputs">\r
+    <property name="defaultTimeout" value="${pnfDefaultTimeout}"/>\r
+  </bean>\r
+\r
 </beans>\r
index 07fa4eb..a1a9e35 100644 (file)
@@ -99,7 +99,7 @@ public class CreateGenericALaCarteServiceInstanceTest extends WorkflowTest {
 
                Map<String, String> variables = setupVariables();
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateGenericALaCarteServiceInstance", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "WorkflowResponse");
                //assertNotNull(workflowResp);
index d31f6e7..f993d06 100644 (file)
@@ -105,7 +105,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
                System.out.println("----------------------------------------------------------");
                System.out.println("- got workflow response -");
                System.out.println("----------------------------------------------------------");
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
            assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
@@ -156,7 +156,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariables2();
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
                executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
            assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
@@ -219,7 +219,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariablesVID1();
                executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
            assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
@@ -269,7 +269,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariables1();
                executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
            assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
@@ -308,7 +308,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariables2();
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
                executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
            assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
@@ -345,7 +345,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariables2();
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
                executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
        
                assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
                assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
@@ -395,7 +395,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
                System.out.println("----------------------------------------------------------");
                System.out.println("- got workflow response -");
                System.out.println("----------------------------------------------------------");
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
            Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest"));
index 27f421d..1e865df 100644 (file)
@@ -107,7 +107,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
                                \r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
                \r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                \r
                injectSDNCCallbacks(callbacks, "assign, query");\r
@@ -169,7 +169,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
                                \r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
                \r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                \r
                injectSDNCCallbacks(callbacks, "assign, query");\r
@@ -261,7 +261,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
                                        \r
                        WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
                        \r
-                       String responseBody = response.getResponse();\r
+                       String responseBody = response.getContent();\r
                        System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                        \r
                        injectSDNCCallbacks(callbacks, "assign, query");\r
@@ -348,7 +348,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
                                                \r
                                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
                                \r
-                               String responseBody = response.getResponse();\r
+                               String responseBody = response.getContent();\r
                                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                                \r
                                injectSDNCCallbacks(callbacks, "assign, query");\r
index 23999c9..2e5a7a4 100644 (file)
@@ -98,7 +98,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
@@ -148,7 +148,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
@@ -192,7 +192,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
@@ -239,7 +239,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                injectVNFRestCallbacks(callbacks, "volumeGroupException");
@@ -280,7 +280,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
@@ -320,7 +320,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                waitForProcessEnd(businessKey, 100000);
                checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false);
@@ -358,7 +358,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                waitForProcessEnd(businessKey, 100000);
                checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false);
index 075ddab..db43de7 100644 (file)
@@ -96,7 +96,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
 
                        WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
 
-                       String responseBody = response.getResponse();
+                       String responseBody = response.getContent();
                        System.out.println("Workflow (Synch) Response:\n" + responseBody);
 
                        //injectSDNCCallbacks(callbacks, "assign, query");
@@ -114,7 +114,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
        //      injectSDNCCallbacks(callbacks, "assign");
        //      injectSDNCCallbacks(callbacks, "activate");
                //waitForProcessEnd(businessKey, 10000);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                //assertVariables("true", "true", "false", "true", "Success", null);
 
@@ -130,7 +130,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
                setVariables(variables, null, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables(null, null, null, null, null, "WorkflowException[processKey=CreateVnfInfra,errorCode=2500,errorMessage=Internal Error - WorkflowException Object and/or RequestInfo is null! CreateVnfInfra]");
 
@@ -148,7 +148,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
                setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables(null, null, null, null, null, "WorkflowException[processKey=DoCreateVnf,errorCode=404,errorMessage=Service Instance Not Found]");
 
@@ -180,7 +180,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
                setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                assertVariables(null, null, null, null, null, "WorkflowException[processKey=DoCreateVnf,errorCode=5000,errorMessage=Generic Vnf Already Exist.]");
 
index aa05953..1a52041 100644 (file)
@@ -78,7 +78,7 @@ public class DeleteGenericALaCarteServiceInstanceTest extends WorkflowTest {
 \r
                Map<String, String> variables = setupVariables();\r
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteGenericALaCarteServiceInstance", variables);\r
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "WorkflowResponse");\r
                //assertNotNull(workflowResp);\r
index 06eb79c..9c32abe 100644 (file)
@@ -254,7 +254,7 @@ public class DeleteNetworkInstanceTest extends WorkflowTest {
 \r
                executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);\r
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);\r
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());\r
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());\r
 \r
                String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");\r
                Assert.assertNotNull(workflowResp);\r
@@ -338,4 +338,4 @@ public class DeleteNetworkInstanceTest extends WorkflowTest {
 \r
        }\r
 \r
-}
\ No newline at end of file
+}\r
index cdc547c..ba375f5 100644 (file)
@@ -546,7 +546,7 @@ public class DeleteVfModuleInfraTest extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("DeleteVfModuleInfra",\r
                                "v1", businessKey, deleteVfModuleRequest, variables);\r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
 \r
                // "changedelete" operation not required for deleting a Vf Module\r
index 84050c4..0e2cf1b 100644 (file)
@@ -74,7 +74,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest {
                        "v1", businessKey, deleteVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                injectVNFRestCallbacks(callbacks, "volumeGroupDelete");
@@ -113,7 +113,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest {
                        "v1", businessKey, deleteVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                //injectVNFRestCallbacks(callbacks, "volumeGroupDelete");
@@ -153,7 +153,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest {
                        "v1", businessKey, deleteVfModuleVolRequest, testVariables);
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000);
 
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);
                
                //injectVNFRestCallbacks(callbacks, "volumeGroupDelete");
index 89bf141..3ab3f71 100644 (file)
@@ -82,7 +82,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                Map<String, String> variables = new HashMap<>();
                setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
                Object cascadeDelete = BPMNUtil.getRawVariable(processEngineRule, "DeleteVnfInfra", "DELVI_cascadeDelete");
                String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ;
                String inUse = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "DELVI_vnfInUse");
@@ -112,7 +112,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                Map<String, String> variables = new HashMap<>();
                setVariables(variables, deleteVnfInfraRequestCascadeDelete, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ;
                String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse");
@@ -143,7 +143,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ;
                String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse");
@@ -177,7 +177,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
-               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
                String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ;
                String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse");
index f7cf3f4..4161431 100644 (file)
@@ -187,7 +187,7 @@ public class ReplaceVnfInfraTest extends WorkflowTest {
                \r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
                \r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                \r
                //injectSDNCCallbacks(callbacks, "deactivate");\r
index 7a43bbd..80a4518 100644 (file)
@@ -99,7 +99,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest {
                System.out.println("----------------------------------------------------------");
                System.out.println("- got workflow response -");
                System.out.println("----------------------------------------------------------");
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
            Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest"));
@@ -146,7 +146,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariablesVIPER1();
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
                executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
            Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest"));
@@ -196,7 +196,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariablesMissingNetworkId();
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
                executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
            Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest"));
@@ -260,7 +260,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest {
                Map<String, String> variables = setupVariablesVID1();
                //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
                executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
-               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+               //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
 
            assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
            Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest"));
index 37c548a..63cf62d 100644 (file)
@@ -101,7 +101,7 @@ public class UpdateVfModuleInfraTest extends WorkflowTest {
                \r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
                \r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                \r
                injectSDNCCallbacks(callbacks, "changeassign, query");\r
index b24eb56..91327b0 100644 (file)
@@ -84,7 +84,7 @@ public class UpdateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleVolumeInfraV1",     "v1", businessKey, updaetVfModuleVolRequest, testVariables);\r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
 \r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                \r
                injectVNFRestCallbacks(callbacks, "volumeGroupUpdate");\r
@@ -130,7 +130,7 @@ public class UpdateVfModuleVolumeInfraV1Test extends WorkflowTest {
                TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleVolumeInfraV1",     "v1", businessKey, updaetVfModuleVolRequest, testVariables);\r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
 \r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                \r
                injectVNFRestCallbacks(callbacks, "volumeGroupUpdate");\r
index 36e9f2b..5ab1a04 100644 (file)
@@ -137,7 +137,7 @@ public class UpdateVnfInfraTest extends WorkflowTest {
                \r
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);\r
                \r
-               String responseBody = response.getResponse();\r
+               String responseBody = response.getContent();\r
                System.out.println("Workflow (Synch) Response:\n" + responseBody);\r
                \r
                injectSDNCCallbacks(callbacks, "changeassign, query");\r
index 1a1e377..aca6002 100644 (file)
@@ -117,7 +117,7 @@ public class VnfConfigUpdateTest extends WorkflowTest {
                
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
                
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);              
        
                // TODO add appropriate assertions
index 17c4819..7d8a7e1 100644 (file)
@@ -132,7 +132,7 @@ public class VnfInPlaceUpdateTest extends WorkflowTest {
                
                WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000);
                
-               String responseBody = response.getResponse();
+               String responseBody = response.getContent();
                System.out.println("Workflow (Synch) Response:\n" + responseBody);              
        
                // TODO add appropriate assertions
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
new file mode 100644 (file)
index 0000000..1799e7f
--- /dev/null
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure.pnf.delegate;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PnfCheckInputsTest {
+
+    private PnfCheckInputs delegate;
+
+    @Before
+    public void setUp() throws Exception {
+        delegate = new PnfCheckInputs();
+    }
+
+    private DelegateExecution mockDelegateExecution() {
+        DelegateExecution delegateExecution = mock(DelegateExecution.class);
+        when(delegateExecution.getVariable("testProcessKey")).thenReturn("testProcessKeyValue");
+        return delegateExecution;
+    }
+
+    @Test
+    public void shouldThrowException_whenPnfIdNotSet() throws Exception {
+        // given
+        DelegateExecution delegateExecution = mockDelegateExecution();
+        // when, then
+        assertThatThrownBy(() -> delegate.execute(delegateExecution)).isInstanceOf(BpmnError.class);
+    }
+
+    private DelegateExecution mockDelegateExecutionWithCorrelationId() {
+        DelegateExecution delegateExecution = mockDelegateExecution();
+        when(delegateExecution.getVariable(CORRELATION_ID)).thenReturn("testCorrelationId");
+        return delegateExecution;
+    }
+
+    @Test
+    public void shouldThrowException_whenTimeoutIsNotSetAndDefaultIsNotDefined() throws Exception {
+        // given
+        DelegateExecution delegateExecution = mockDelegateExecutionWithCorrelationId();
+        // when, then
+        assertThatThrownBy(() -> delegate.execute(delegateExecution)).isInstanceOf(BpmnError.class);
+    }
+
+    @Test
+    public void shouldSetDefaultTimeout_whenTimeoutIsNotSet() throws Exception {
+        // given
+        String defaultTimeout = "T1D";
+        delegate.setDefaultTimeout(defaultTimeout);
+        DelegateExecution delegateExecution = mockDelegateExecutionWithCorrelationId();
+        // when
+        delegate.execute(delegateExecution);
+        // then
+        verify(delegateExecution).setVariable(eq(TIMEOUT_FOR_NOTIFICATION), eq(defaultTimeout));
+    }
+}
\ No newline at end of file
index 6dc3bbf..980a0b1 100644 (file)
@@ -62,4 +62,9 @@
   </bean>
 
   <bean id="dmaapClient" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.DmaapClientTestImpl"/>
+
+
+  <bean id="pnfCheckInputs" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.PnfCheckInputs">
+    <property name="defaultTimeout" value="PT1S"/>
+  </bean>
 </beans>
index 1304fc2..85f9753 100644 (file)
@@ -60,14 +60,15 @@ public class URNResource extends AbstractCockpitPluginResource{
   public List<URNData> getUrnDataMap() \r
   {  \r
          List<URNData> list = new ArrayList();\r
-         \r
+         PreparedStatement psData = null;\r
+         ResultSet r = null;\r
          try {\r
                        \r
                    conn = getDBConnection();\r
-                           PreparedStatement psData = conn\r
+                           psData = conn\r
                                                .prepareStatement("select * from MSO_URN_MAPPING order by NAME_");\r
                            \r
-                           ResultSet r = psData.executeQuery();\r
+                           r = psData.executeQuery();\r
                            \r
                                while(r.next()) \r
                                {\r
@@ -78,14 +79,15 @@ public class URNResource extends AbstractCockpitPluginResource{
                                        \r
                                        list.add(d);                                    \r
                                }\r
-                               \r
-                           psData.close();\r
-                               conn.close();\r
                        \r
                } catch (Exception e) \r
                {\r
                        \r
                        e.printStackTrace();\r
+               } finally {\r
+                       try { r.close(); } catch (Exception e) { /* ignored */ }\r
+                       try { psData.close(); } catch (Exception e) { /* ignored */ }\r
+                       try { conn.close(); } catch (Exception e) { /* ignored */ }\r
                }\r
      \r
     for(URNData d: list)\r
@@ -158,24 +160,26 @@ public class URNResource extends AbstractCockpitPluginResource{
          nRow.setVer_("1");    \r
          final String myKey = key_;\r
          final String myValue = value_;\r
-         \r
+          \r
+           PreparedStatement psData = null;\r
                msoLogger.debug("----------- START ----------------------");\r
                try {\r
                        \r
                    conn = getDBConnection();\r
-                           PreparedStatement psData = conn\r
+                               psData = conn\r
                                                .prepareStatement("Insert into MSO_URN_MAPPING values ('" + key_ + "', '" + value_  + "', '1')");\r
                            \r
                            psData.executeUpdate();\r
                            \r
-                           psData.close();\r
-                               conn.close();\r
                        //}                      \r
                        \r
                } catch (Exception e) \r
                {\r
                        \r
                        e.printStackTrace();\r
+               } finally {\r
+                       try { psData.close(); } catch (Exception e) { /* ignored */ }\r
+                       try { conn.close(); } catch (Exception e) { /* ignored */ }\r
                }\r
        // getQueryService().executeQuery("cockpit.urnMap.insertNewRow", nRow, URNData.class);\r
    }\r
@@ -184,21 +188,22 @@ public class URNResource extends AbstractCockpitPluginResource{
   public void getPersistData(URNData d) {  \r
          \r
                //getQueryService().executeQuery("cockpit.urnMap.persistURNData", d, URNData.class);\r
-           \r
+         PreparedStatement psData = null;\r
          try {\r
                        \r
                    conn = getDBConnection();\r
-                       PreparedStatement psData = conn\r
+                               psData = conn\r
                                                .prepareStatement("UPDATE MSO_URN_MAPPING set VALUE_ ='"+ d.getURNValue() + "' WHERE NAME_='" + d.getURNName() + "'");\r
                            \r
                            psData.executeUpdate();\r
                            \r
-                           psData.close();\r
-                               conn.close();\r
                } catch (Exception e) \r
                {\r
                        \r
                        e.printStackTrace();\r
+               } finally {\r
+                       try { psData.close(); } catch (Exception e) { /* ignored */ }\r
+                       try { conn.close(); } catch (Exception e) { /* ignored */ }\r
                }\r
         \r
        }\r
diff --git a/common/src/main/java/org/openecomp/mso/utils/RootIgnoringJsonDeserializer.java b/common/src/main/java/org/openecomp/mso/utils/RootIgnoringJsonDeserializer.java
new file mode 100644 (file)
index 0000000..95f72c4
--- /dev/null
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.utils;
+
+import java.io.IOException;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * A JSON deserializer that ignores the root element if it is present.
+ */
+public class RootIgnoringJsonDeserializer<T> extends JsonDeserializer<T> {
+
+       private final ObjectMapper mapper = new ObjectMapper();
+       private final Class<T> clazz;
+       private final String jsonRootName;
+
+       public RootIgnoringJsonDeserializer(Class<T> clazz) {
+               this.clazz = clazz;
+
+               JsonRootName annotation = clazz.getAnnotation(JsonRootName.class);
+               
+               if (annotation == null || annotation.value() == null || annotation.value().equals("")) {
+                       jsonRootName = clazz.getSimpleName();
+               } else {
+                       jsonRootName = annotation.value();
+               }
+       }
+
+       @Override
+       public T deserialize(JsonParser jp, DeserializationContext dc) 
+                       throws IOException, JsonProcessingException {
+          JsonNode rootNode = jp.getCodec().readTree(jp);
+          Map.Entry<String,JsonNode> field = rootNode.fields().next();
+
+          if (jsonRootName.equals(field.getKey())) {
+                  rootNode = field.getValue();
+          }
+
+          return mapper.convertValue(rootNode, clazz);
+       }
+}
\ No newline at end of file
diff --git a/common/src/main/java/org/openecomp/mso/utils/RootIgnoringObjectMapper.java b/common/src/main/java/org/openecomp/mso/utils/RootIgnoringObjectMapper.java
new file mode 100644 (file)
index 0000000..6f3c5b7
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.utils;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+
+/**
+ * An ObjectMapper for a specific class that ignores the root element
+ * if it is present.
+ */
+public class RootIgnoringObjectMapper<T> extends ObjectMapper {
+
+       private static final long serialVersionUID = 6812584067195377395L;
+
+       public RootIgnoringObjectMapper(Class<T> clazz) {
+               SimpleModule module = new SimpleModule();
+               module.addDeserializer(clazz, new RootIgnoringJsonDeserializer<T>(clazz));
+               registerModule(module);
+       }
+}
\ No newline at end of file
diff --git a/common/src/test/java/org/openecomp/mso/utils/RootIgnoringObjectMapperTest.java b/common/src/test/java/org/openecomp/mso/utils/RootIgnoringObjectMapperTest.java
new file mode 100644 (file)
index 0000000..1c7e845
--- /dev/null
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class RootIgnoringObjectMapperTest {
+
+       @Test
+       public void someObjectWithoutRootTest() throws Exception {
+               ObjectMapper mapper = new RootIgnoringObjectMapper<SomeObject>(SomeObject.class);
+
+               String content = "{"
+                       + "\"attribute\":\"charm\""
+                       + "}";
+
+               SomeObject response = mapper.readValue(content, SomeObject.class);
+               assertEquals("SomeObject[attribute=charm]", response.toString());
+       }
+       
+       @Test
+       public void someObjectWithRootTest() throws Exception {
+               ObjectMapper mapper = new RootIgnoringObjectMapper<SomeObject>(SomeObject.class);
+
+               String content = "{\"SomeObject\":{"
+                       + "\"attribute\":\"charm\""
+                       + "}}";
+
+               SomeObject response = mapper.readValue(content, SomeObject.class);
+               assertEquals("SomeObject[attribute=charm]", response.toString());
+       }
+       
+       @Test
+       public void annotatedObjectWithoutRootTest() throws Exception {
+               ObjectMapper mapper = new RootIgnoringObjectMapper<AnnotatedObject>(AnnotatedObject.class);
+
+               String content = "{"
+                       + "\"attribute\":\"charm\""
+                       + "}";
+
+               AnnotatedObject response = mapper.readValue(content, AnnotatedObject.class);
+               assertEquals("AnnotatedObject[attribute=charm]", response.toString());
+       }
+       
+       @Test
+       public void annotatedObjectWithRootTest() throws Exception {
+               ObjectMapper mapper = new RootIgnoringObjectMapper<AnnotatedObject>(AnnotatedObject.class);
+
+               String content = "{\"annotated-object\":{"
+                       + "\"attribute\":\"charm\""
+                       + "}}";
+
+               AnnotatedObject response = mapper.readValue(content, AnnotatedObject.class);
+               assertEquals("AnnotatedObject[attribute=charm]", response.toString());
+       }
+
+       public static class SomeObject {
+
+               @JsonProperty("attribute")
+               private String attribute;
+
+               public String toString() {
+                       return getClass().getSimpleName() + "[attribute=" + attribute + "]";
+               }
+       }
+
+       @JsonRootName(value = "annotated-object")
+       public static class AnnotatedObject extends SomeObject {
+       }
+}
\ No newline at end of file
index 78f354d..8346e2b 100644 (file)
@@ -1971,6 +1971,10 @@ Request Parameters:
 +-------------------+---------+-----------+-------+-----------------------+
 |service-type       |M        |1          |String |Service Type           |
 +-------------------+---------+-----------+-------+-----------------------+
+|subscriber-name    |O        |1          |String |Subscriber name        |
++-------------------+---------+-----------+-------+-----------------------+
+|subscriber-type    |O        |1          |String |Subscriber type        |
++-------------------+---------+-----------+-------+-----------------------+
 
 Response:
 
@@ -2556,7 +2560,7 @@ https://developer.openstack.org/api-ref/compute/#create-server
 +--------------------+-----------------------------------------------------------------------------------------------------------------------+
 |Interface Definition|Description                                                                                                            |
 +====================+=======================================================================================================================+
-|URI                 |http://msb.onap.org/api/multicloud/v0/{cloud-owner}_{cloud-region}/nova/v2.1/{tenant_id}/servers                       |
+|URI                 |http://msb.onap.org/api/multicloud/v0/{cloud-owner}_{cloud-region}/nova/v2.37/{tenant_id}/servers                      |
 +--------------------+-----------------------------------------------------------------------------------------------------------------------+
 |Operation Type      |POST                                                                                                                   |
 +--------------------+-----------------------------------------------------------------------------------------------------------------------+
@@ -2640,6 +2644,8 @@ Response:
 +-------------------------+------------------+------------------------------------------------------------------------------+
 |Attribute                |Content           |Description                                                                   |
 +=========================+==================+==============================================================================+
+|Location                 |String            |The location URL of the server.                                               |
++-------------------------+------------------+------------------------------------------------------------------------------+
 |server                   |object            |A server object.                                                              |
 +-------------------------+------------------+------------------------------------------------------------------------------+
 |id                       |String            |The UUID of the server.                                                       |
@@ -2808,6 +2814,10 @@ Request Body:
 +----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
 |description                 |O        |1          |string                    |A human-readable description for the resource.                                                   |
 +----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
+|is_default                  |O        |1          |boolean                   |The network is default or not.                                                                   |
++----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
+|availability_zone_hints     |O        |1          |array                     |The availability zone candidate for the network.                                                 |
++----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
 
 Response:
 
@@ -2822,10 +2832,16 @@ Response:
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |availability_zones           |array             |The availability zone for the network.                                        |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
+|created_at                   |String            |Time at which the resource has been created (in UTC ISO8601 format).          |
++-----------------------------+------------------+------------------------------------------------------------------------------+
 |dns_domain                   |String            |A valid DNS domain.                                                           |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |id                           |String            |The ID of the network.                                                        |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
+|ipv4_address_scope           |String            |The ID of the IPv4 address scope that the network is associated with.         |
++-----------------------------+------------------+------------------------------------------------------------------------------+
+|ipv6_address_scope           |String            |The ID of the IPv6 address scope that the network is associated with.         |
++-----------------------------+------------------+------------------------------------------------------------------------------+
 |mtu                          |integer           |The maximum transmission unit (MTU) value to address fragmentation.           |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |name                         |String            |Human-readable name of the network.                                           |
@@ -2856,10 +2872,14 @@ Response:
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |tenant_id                    |String            |The ID of the project.                                                        |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
+|updated_at                   |String            |Time at which the resource has been updated (in UTC ISO8601 format).          |
++-----------------------------+------------------+------------------------------------------------------------------------------+
 |vlan_transparent             |boolean           |Indicates the VLAN transparency mode of the network.                          |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |description                  |String            |A human-readable description for the resource.                                |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
+|is_default                   |boolean           |The network is default pool or not.                                           |
++-----------------------------+------------------+------------------------------------------------------------------------------+
 
 Delete Network
 +++++++++++++++
@@ -2881,7 +2901,7 @@ Request Body:
 +----------------------------+---------+-----------+--------------------------+--------------------------------------------------------------+
 |Attribute                   |Qualifier|Cardinality|Content                   |Description                                                   |
 +============================+=========+===========+==========================+==============================================================+
-|network_id                  |M        |1          |Object                    |The ID of the network.                                        |
+|network_id                  |M        |1          |String                    |The ID of the network.                                        |
 +----------------------------+---------+-----------+--------------------------+--------------------------------------------------------------+
 
 Create Subnet
@@ -2940,6 +2960,8 @@ Request Body:
 +----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
 |use_default_subnetpool      |O        |1          |boolean                   |Whether to allocate this subnet from the default subnet pool.                                    |
 +----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
+|service_types               |O        |1          |array                     |The service types associated with the subnet.                                                    |
++----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
 
 Response:
 
@@ -3070,6 +3092,8 @@ Request Body:
 +----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
 |project_id                  |O        |1          |string                    |The ID of the project that owns the resource.                                                    |
 +----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
+|qos_policy_id               |O        |1          |string                    |QoS policy associated with the port.                                                             |
++----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
 |security_groups             |O        |1          |array                     |The IDs of security groups applied to the port.                                                  |
 +----------------------------+---------+-----------+--------------------------+-------------------------------------------------------------------------------------------------+
 |tenant_id                   |O        |1          |string                    |The ID of the project that owns the resource.                                                    |
@@ -3118,6 +3142,8 @@ Response:
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |id                           |string            |The ID of the resource.                                                       |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
+|ip_allocation                |string            |Indicates when ports use either deferred, immediate or no IP allocation (none)|
++-----------------------------+------------------+------------------------------------------------------------------------------+
 |mac_address                  |string            |The MAC address of the port.                                                  |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |name                         |string            |Human-readable name of the resource.                                          |
@@ -3130,6 +3156,8 @@ Response:
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |revision_number              |integer           |The revision number of the resource.                                          |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
+|qos_policy_id                |string            |The ID of the QoS policy associated with the port.                            |
++-----------------------------+------------------+------------------------------------------------------------------------------+
 |security_groups              |array             |The IDs of security groups applied to the port.                               |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |status                       |string            |The port status. Values are ACTIVE, DOWN, BUILD and ERROR.                    |
@@ -3206,6 +3234,10 @@ Response:
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |project_id                   |string            |The ID of the project.                                                        |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
+|created_at                   |string            |Time at which the resource has been created (in UTC ISO8601 format).          |
++-----------------------------+------------------+------------------------------------------------------------------------------+
+|updated_at                   |string            |Time at which the resource has been updated (in UTC ISO8601 format).          |
++-----------------------------+------------------+------------------------------------------------------------------------------+
 |revision_number              |integer           |The revision number of the resource.                                          |
 +-----------------------------+------------------+------------------------------------------------------------------------------+
 |name                         |string            |Human-readable name of the resource.                                          |
index a806fe3..f05f9ce 100644 (file)
@@ -8,6 +8,59 @@ Service Orchestrator Release Notes
 
 The SO provides the highest level of service orchestration in the ONAP architecture. 
 
+Version: 1.2.2
+--------------
+
+:Release Date: 2018-05-24
+
+The Beijing release is the second release of the Service Orchestrator (SO) project.
+
+**New Features**
+* Enhance Platform maturity by improving CLAMP maturity matrix see `Wiki <https://wiki.onap.org/display/DW/Beijing+Release+Platform+Maturity>`_.
+* Manual scaling of network services and VNFs.
+* Homing and placement capabiliities through OOF interaction. 
+* Ability to perform change management.
+* Integrated to APPC
+* Integrated to OOF 
+* Integrated to OOM
+Bug Fixes
+---------
+The defects fixed in this release could be found `here<https://jira.onap.org/issues/?jql=project%20%3D%20SO%20AND%20affectedVersion%20%3D%20%22Beijing%20Release%22%20AND%20status%20%3D%20Closed%20>`_.
+
+**Known Issues**
+**Security Issues**
+SO CII Badging details can be found `here<https://bestpractices.coreinfrastructure.org/en/projects/1702>`_. 
+The remaining security issues and their workarounds are captured `here <https://wiki.onap.org/pages/viewpage.action?pageId=28377799>`_.
+
+**Upgrade Notes**
+
+**Deprecation Notes**
+
+
+Version: 1.1.2
+--------------
+
+:Release Date: 2018-01-18
+
+Bug Fixes
+---------
+The key defects fixed in this release :
+
+- `SO-344 <https://jira.onap.org/browse/SO-344>`_
+  Only pass one VNF to DoCreateVnfAndModules.
+
+- `SO-348 <https://jira.onap.org/browse/SO-348>`_
+  Json Analyze Exception in PreProcessRequest.
+
+- `SO-352 <https://jira.onap.org/browse/SO-352>`_
+  SO failed to create VNF - with error message: Internal Error Occurred in CreateVnfInfra QueryCatalogDB Process.
+
+- `SO-354 <https://jira.onap.org/browse/SO-354>`_
+  Change the Service Type And Service Role
+
+
 Version: 1.1.1
 --------------
 
index 3c5c5ec..64b7d86 100644 (file)
 
 package org.openecomp.mso.apihandler.camundabeans;
 
+import java.util.Map;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+// This class must be 100% JSON-compatible with the BPMN WorkflowResponse class.
+// TODO: BPMN and the API-H should use a common class.
 
 /**
- * JavaBean JSON class for a "variables" which contains the xml payload that
- * will be passed to the Camunda process
- * 
+ * A synchronous response from a workflow.
  */
-
+@JsonRootName(value = "WorkflowResponse")
 public class CamundaResponse {
-       
-       @JsonProperty("response")
-       private String response;
+
+       @JsonProperty("processInstanceId")
+       private String processInstanceId;
+
        @JsonProperty("messageCode")
        private int messageCode;
+
        @JsonProperty("message")
        private String message;
-       @JsonProperty("processInstanceID")
-       private String processInstanceID;
-       @JsonProperty("variables")
-       private String variables;
 
-       public String getProcessInstanceID() {
-               return processInstanceID;
-       }
-
-       public void setProcessInstanceID(String processInstanceID) {
-               this.processInstanceID = processInstanceID;
-       }
-
-       public String getVariables() {
-               return variables;
-       }
-
-       public void setVariables(String variables) {
-               this.variables = variables;
-       }
+       @JsonProperty("variables")
+       private Map<String,String> variables;
 
-       public CamundaResponse() {
-       }
+       @JsonProperty("content")
+       private String content;
 
-       public String getResponse() {
-               return response;
+       public String getProcessInstanceId() {
+               return processInstanceId;
        }
 
-       public void setResponse(String response) {
-               this.response = response;
+       public void setProcessInstanceId(String processInstanceId) {
+               this.processInstanceId = processInstanceId;
        }
 
        public int getMessageCode() {
@@ -85,13 +73,30 @@ public class CamundaResponse {
                this.message = message;
        }
 
+       public Map<String,String> getVariables() {
+               return variables;
+       }
+
+       public void setVariables(Map<String,String> variables) {
+               this.variables = variables;
+       }
+
+       public String getContent() {
+               return content;
+       }
+
+       public void setContent(String content) {
+               this.content = content;
+       }
+
        @Override
        public String toString() {
-               return "CamundaResponse [response=" + response + ", messageCode="
-                               + messageCode + ", message=" + message + "]";
+               return getClass().getSimpleName() + "["
+                       + "processInstanceId=" + processInstanceId
+                       + ",messageCode=" + messageCode
+                       + ",message=" + message
+                       + ",variables=" + variables
+                       + ",content=" + content
+                       + "]";
        }
-
-       
-       
-       
-}
+}
\ No newline at end of file
index 732b778..a8b8984 100644 (file)
@@ -27,21 +27,22 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.util.EntityUtils;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
 import org.openecomp.mso.apihandler.camundabeans.CamundaResponse;
-import org.openecomp.mso.logger.MsoLogger;
 import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.utils.RootIgnoringObjectMapper;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 public class ResponseHandler {
 
        private CamundaResponse response;
        private int status;
-       private String responseBody="";
+       private String content = "";
        private HttpResponse httpResponse;
        private int type;
        private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH);
-    private static final String RESPONSE_BODY_MSG = "response body is: ";
+    private static final String RESPONSE_CONTENT_MSG = "response content is: ";
 
        public ResponseHandler(HttpResponse httpResponse, int type) {
                this.httpResponse = httpResponse;
@@ -67,29 +68,31 @@ public class ResponseHandler {
        
 
        
+       @SuppressWarnings("unchecked")
        private void parseCamunda(){
                try{
-                               HttpEntity entity = httpResponse.getEntity();
-                               responseBody = EntityUtils.toString(entity);
-                       } catch (IOException e) {
-                               msoLogger.debug("IOException getting Camunda response body", e);
-                       }
-               
-                       ObjectMapper mapper = new ObjectMapper(); 
-                       try {
-                               response = mapper.readValue(responseBody, CamundaResponse.class);
-                       } catch (IOException e) {
-                               msoLogger.debug("IOException getting Camunda response body", e);
-                       }
-                       msoLogger.debug("json response is: " + responseBody);
-                       if(response!=null){
-                               responseBody = response.getResponse();
-                       }
-                       msoLogger.debug(RESPONSE_BODY_MSG + responseBody);
-                       
-               
+                       HttpEntity entity = httpResponse.getEntity();
+                       content = EntityUtils.toString(entity);
+               } catch (IOException e) {
+                       msoLogger.debug("IOException getting Camunda response content", e);
+               }
+
+               ObjectMapper mapper = new RootIgnoringObjectMapper<CamundaResponse>(CamundaResponse.class);
+
+               try {
+                       response = mapper.readValue(content, CamundaResponse.class);
+               } catch (IOException e) {
+                       msoLogger.debug("IOException getting Camunda response content", e);
+               }
+               msoLogger.debug("json response is: " + content);
+               if(response!=null){
+                       content = response.getContent();
+               }
+               msoLogger.debug(RESPONSE_CONTENT_MSG + content);
+
+
                if(status!=HttpStatus.SC_ACCEPTED){
-                       msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "Camunda", String.valueOf(status), responseBody, "Camunda", "parseCamunda", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda");
+                       msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "Camunda", String.valueOf(status), content, "Camunda", "parseCamunda", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda");
                }
        }
        
@@ -99,16 +102,16 @@ public class ResponseHandler {
 
                try {
                        if (bpelEntity!=null) {
-                               responseBody = EntityUtils.toString(bpelEntity);
-                               msoLogger.debug(RESPONSE_BODY_MSG + responseBody);
+                               content = EntityUtils.toString(bpelEntity);
+                               msoLogger.debug(RESPONSE_CONTENT_MSG + content);
 
                        }
                        if(status!=HttpStatus.SC_ACCEPTED){
-                               msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "BPEL", String.valueOf(status), responseBody, "BPEL", "parseBpel", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from BPEL");
+                               msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "BPEL", String.valueOf(status), content, "BPEL", "parseBpel", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from BPEL");
                        }
                } 
                catch (IOException e) {
-                       msoLogger.debug("IOException getting BPEL response body", e);
+                       msoLogger.debug("IOException getting BPEL response content", e);
                }
        }
        
@@ -118,16 +121,16 @@ public class ResponseHandler {
 
                try {
                        if (camundataskEntity!=null) {
-                               responseBody = EntityUtils.toString(camundataskEntity);
-                               msoLogger.debug(RESPONSE_BODY_MSG + responseBody);
+                               content = EntityUtils.toString(camundataskEntity);
+                               msoLogger.debug(RESPONSE_CONTENT_MSG + content);
 
                        }
                        if(status!=HttpStatus.SC_NO_CONTENT && status != HttpStatus.SC_ACCEPTED){
-                               msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "CAMUNDATASK", String.valueOf(status), responseBody, "CAMUNDATASK", "parseCamundaTask", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda Task");
+                               msoLogger.error(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, "CAMUNDATASK", String.valueOf(status), content, "CAMUNDATASK", "parseCamundaTask", MsoLogger.ErrorCode.BusinessProcesssError, "Error in APIH from Camunda Task");
                        }
                } 
                catch (IOException e) {
-                       msoLogger.debug("IOException getting Camunda Task response body", e);
+                       msoLogger.debug("IOException getting Camunda Task response content", e);
                }
        }
 
@@ -175,18 +178,17 @@ public class ResponseHandler {
        }
 
 
-       public String getResponseBody() {
-               return responseBody;
+       public String getContent() {
+               return content;
        }
 
 
-       public void setResponseBody(String responseBody) {
-               this.responseBody = responseBody;
+       public void setContent(String content) {
+               this.content = content;
        }
 
 
        public int getStatus() {
                return status;
        }
-
 }
index 9b36a98..7fc2815 100644 (file)
@@ -23,14 +23,10 @@ package org.openecomp.mso.camunda.tests;
 
 import static org.junit.Assert.assertEquals;
 
-import java.io.IOException;
-
 import org.junit.Test;
 import org.openecomp.mso.apihandler.camundabeans.CamundaResponse;
+import org.openecomp.mso.utils.RootIgnoringObjectMapper;
 
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 /**
@@ -41,19 +37,42 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 public class CamundaResponseTest {
 
        @Test
-       public final void testDeserialization() throws JsonGenerationException,
-                       JsonMappingException, IOException {
-               ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally
-               mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
-               
-               String responseBody = "{ \"response\": \"<xml>xml</xml>\","+
-                                 "\"messageCode\": 200,"+
-                                 "\"message\": \"Successfully started the process\"," +
-                                 "\"processInstanceID\":null,\"variables\":null}";
-       
-               CamundaResponse response = mapper.readValue(responseBody, CamundaResponse.class);
-               assertEquals(response.toString(), "CamundaResponse [response=<xml>xml</xml>, messageCode=200, message=Successfully started the process]");
+       public final void testDeserializationWithoutRootElement() throws Exception {
+
+               ObjectMapper mapper = new RootIgnoringObjectMapper<CamundaResponse>(CamundaResponse.class);
+
+               String content = "{"
+                       + "\"messageCode\":202"
+                       + ",\"message\":\"Successfully started the process\""
+                       + ",\"content\":\"<xml>xml</xml>\""
+                       + ",\"processInstanceId\":\"4d3b3201a7ce\""
+                       + ",\"variables\":null"
+                       + "}";
 
+               CamundaResponse response = mapper.readValue(content, CamundaResponse.class);
+
+               assertEquals(
+                       "CamundaResponse[processInstanceId=4d3b3201a7ce,messageCode=202,message=Successfully started the process,variables=null,content=<xml>xml</xml>]",
+                       response.toString());
        }
 
-}
+       @Test
+       public final void testDeserializationWithRootElement() throws Exception {
+
+               ObjectMapper mapper = new RootIgnoringObjectMapper<CamundaResponse>(CamundaResponse.class);
+
+               String content = "{\"WorkflowResponse\":{"
+                       + "\"messageCode\":202"
+                       + ",\"message\":\"Successfully started the process\""
+                       + ",\"content\":\"<xml>xml</xml>\""
+                       + ",\"processInstanceId\":\"4d3b3201a7ce\""
+                       + ",\"variables\":null"
+                       + "}}";
+
+               CamundaResponse response = mapper.readValue(content, CamundaResponse.class);
+
+               assertEquals(
+                       "CamundaResponse[processInstanceId=4d3b3201a7ce,messageCode=202,message=Successfully started the process,variables=null,content=<xml>xml</xml>]",
+                       response.toString());
+       }
+}
\ No newline at end of file
index d0031f3..e04aba0 100644 (file)
@@ -47,13 +47,15 @@ public class ResponseHandlerTest {
 
     @Test
     public void tesParseCamundaResponse () throws JsonGenerationException, JsonMappingException, IOException {
-        // String body
-        // ="{\"links\":[{\"method\":\"GET\",\"href\":\"http://localhost:9080/engine-rest/process-instance/2047c658-37ae-11e5-9505-7a1020524153\",\"rel\":\"self\"}],\"id\":\"2047c658-37ae-11e5-9505-7a1020524153\",\"definitionId\":\"dummy:10:73298961-37ad-11e5-9505-7a1020524153\",\"businessKey\":null,\"caseInstanceId\":null,\"ended\":true,\"suspended\":false}";
 
-        String body = "{ \"response\": \"<xml>xml</xml>\"," + "\"messageCode\": 200,"
-                      + "\"message\": \"Successfully started the process\"}";
+               String content = "{\"WorkflowResponse\":{"
+                               + "\"messageCode\":202"
+                               + ",\"message\":\"Successfully started the process\""
+                               + ",\"content\":\"<xml>xml</xml>\""
+                               + ",\"processInstanceId\":\"4d3b3201a7ce\""
+                               + "}}";
 
-        HttpResponse response = createResponse (200, body, "application/json");
+        HttpResponse response = createResponse (200, content, "application/json");
 
         ResponseHandler respHandler = new ResponseHandler (response, 1);
 
@@ -81,7 +83,7 @@ public class ResponseHandlerTest {
 
         int status = respHandler.getStatus ();
         assertEquals (status, HttpStatus.SC_ACCEPTED);
-        assertTrue (respHandler.getResponseBody () != null);
+        assertTrue (respHandler.getContent() != null);
     }
 
     @Test
@@ -100,17 +102,21 @@ public class ResponseHandlerTest {
     @Test
     public void tesGenricErrorResponse () throws JsonGenerationException, JsonMappingException, IOException {
 
-        String body = "{ \"response\": \"<xml>xml</xml>\"," + "\"messageCode\": 500,"
-                      + "\"message\": \"Something went wrong\"}";
+               String content = "{\"WorkflowResponse\":{"
+                               + "\"messageCode\":500"
+                               + ",\"message\":\"Something went wrong\""
+                               + ",\"content\":\"<xml>xml</xml>\""
+                               + ",\"processInstanceId\":\"4d3b3201a7ce\""
+                               + "}}";
 
-        HttpResponse response = createResponse (500, body, "application/json");
+        HttpResponse response = createResponse (500, content, "application/json");
 
         ResponseHandler respHandler = new ResponseHandler (response, 1);
 
         int status = respHandler.getStatus ();
         assertEquals (HttpStatus.SC_BAD_GATEWAY, status);
         assertEquals (respHandler.getResponse ().getMessage (), "Something went wrong");
-        System.out.println (respHandler.getResponseBody ());
+        System.out.println (respHandler.getContent());
 
     }
 
index 8cb5935..dca2069 100644 (file)
@@ -970,7 +970,7 @@ public class E2EServiceInstances {
                        HashMap<String, String> instanceIdMap) {
                // BPMN accepted the request, the request is in progress
                if (bpelStatus == HttpStatus.SC_ACCEPTED) {
-                       String camundaJSONResponseBody = respHandler.getResponseBody();
+                       String camundaJSONResponseBody = respHandler.getContent();
                        msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody);
                        msoLogger.recordAuditEvent(startTime,
                                        MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
@@ -981,7 +981,7 @@ public class E2EServiceInstances {
                } else {
                        List<String> variables = new ArrayList<>();
                        variables.add(bpelStatus + "");
-                       String camundaJSONResponseBody = respHandler.getResponseBody();
+                       String camundaJSONResponseBody = respHandler.getContent();
                        if (camundaJSONResponseBody != null
                                        && !camundaJSONResponseBody.isEmpty()) {
                                Response resp = msoRequest.buildServiceErrorResponse(
index b809fc2..216a7ba 100644 (file)
@@ -37,6 +37,8 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
 import org.apache.http.HttpStatus;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.openecomp.mso.apihandler.common.ErrorNumbers;
 import org.openecomp.mso.logger.MessageEnum;
@@ -300,7 +302,7 @@ public class OrchestrationRequests {
         Request request = new Request();
 
         ObjectMapper mapper = new ObjectMapper();
-       // mapper.configure(Feature.WRAP_ROOT_VALUE, true);
+        mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
 
        request.setRequestId(requestDB.getRequestId());
        request.setRequestScope(requestDB.getRequestScope());
index 2070b22..581ad34 100644 (file)
@@ -782,7 +782,7 @@ public class ServiceInstances {
 
                // BPEL accepted the request, the request is in progress
                if (bpelStatus == HttpStatus.SC_ACCEPTED) {
-                       String camundaJSONResponseBody = respHandler.getResponseBody ();
+                       String camundaJSONResponseBody = respHandler.getContent();
                        msoLogger.debug ("Received from Camunda: " + camundaJSONResponseBody);
                        msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.IN_PROGRESS);
                        (RequestsDatabase.getInstance()).updateInfraStatus (msoRequest.getRequestId (),
@@ -795,7 +795,7 @@ public class ServiceInstances {
                } else {
                        List<String> variables = new ArrayList<>();
                        variables.add(bpelStatus + "");
-                       String camundaJSONResponseBody = respHandler.getResponseBody ();
+                       String camundaJSONResponseBody = respHandler.getContent();
                        if (camundaJSONResponseBody != null && !camundaJSONResponseBody.isEmpty ()) {
                                msoRequest.setStatus (org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
                                Response resp =  msoRequest.buildServiceErrorResponse(bpelStatus,
@@ -968,15 +968,15 @@ public class ServiceInstances {
                RequestParameters reqParam = msoRequest.getServiceInstancesRequest().getRequestDetails().getRequestParameters();
                if(reqParam!=null && reqParam.isaLaCarte()!=null && reqParam.isaLaCarte() && recipe==null){
                        return null;
+               } else if (recipe==null) {
+                       //aLaCarte wasn't sent, so we'll try the default
+                       serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName);
+                       if (serviceRecord == null) {
+                               serviceRecord = db.getServiceByModelName(defaultServiceModelName);
+                       }
+                       recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
                }
 
-               //aLaCarte wasn't sent, so we'll try the default
-               serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName);
-               if (serviceRecord == null) {
-                       serviceRecord = db.getServiceByModelName(defaultServiceModelName);
-               }
-
-               recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
                if(modelInfo.getModelVersionId() == null) {
                        modelInfo.setModelVersionId(serviceRecord.getModelUUID());
                }
index 368807f..9aac16a 100644 (file)
@@ -176,7 +176,7 @@ public class TasksHandler {
                        msoLogger.debug ("Received good response from Camunda");
                                                
                        msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "BPMN completed the request");
-                       String respBody = respHandler.getResponseBody();                
+                       String respBody = respHandler.getContent();             
                        if (respBody != null) {                         
                                JSONArray data = new JSONArray(respBody);
                                
@@ -276,7 +276,7 @@ public class TasksHandler {
                        msoLogger.debug ("Received good response from Camunda");
                                                
                        msoLogger.recordAuditEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "BPMN completed the request");
-                       String respBody = respHandler.getResponseBody();                
+                       String respBody = respHandler.getContent();             
                        if (respBody != null) {
                                taskList = buildTaskList(taskId, respBody);                             
                        }
index 4801811..ecbe97c 100644 (file)
@@ -281,10 +281,11 @@ public class CloudOrchestration {
        
        private CloudOrchestrationRequest convertJsonToCloudOrchestrationRequest(String requestJSON, Action action, long startTime,
                CloudOrchestrationRequest cor) throws Exception {
+               CloudOrchestrationRequest new_cor = null;
                try{
                        msoLogger.debug("Converting incoming JSON request to Object");
                        ObjectMapper mapper = new ObjectMapper();
-                       cor = mapper.readValue(requestJSON, CloudOrchestrationRequest.class);
+                       new_cor = mapper.readValue(requestJSON, CloudOrchestrationRequest.class);
                } catch(Exception e){
                        msoLogger.debug ("Mapping of request to JSON object failed : ", e);
                        if (getTenantIsolationRequest().getRequestId () != null) {
@@ -295,7 +296,7 @@ public class CloudOrchestration {
                        msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, "Mapping of request to JSON object failed");
                        throw new Exception(e);
                }
-               return cor;
+               return new_cor;
        }
        
        public TenantIsolationRequest getTenantIsolationRequest() {
index 5c4ddfb..901e03f 100644 (file)
@@ -199,7 +199,7 @@ public class E2EServiceInstancesTest {
                                HttpResponse resp = new BasicHttpResponse(pv, 202,
                                                "test response");
                                BasicHttpEntity entity = new BasicHttpEntity();
-                               String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                               String body = "{\"content\":\"success\",\"message\":\"success\"}";
                                InputStream instream = new ByteArrayInputStream(body.getBytes());
                                entity.setContent(instream);
                                resp.setEntity(entity);
@@ -258,7 +258,7 @@ public class E2EServiceInstancesTest {
                                HttpResponse resp = new BasicHttpResponse(pv, 500,
                                                "test response");
                                BasicHttpEntity entity = new BasicHttpEntity();
-                               String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                               String body = "{\"content\":\"success\",\"message\":\"success\"}";
                                InputStream instream = new ByteArrayInputStream(body.getBytes());
                                entity.setContent(instream);
                                resp.setEntity(entity);
@@ -318,7 +318,7 @@ public class E2EServiceInstancesTest {
                                HttpResponse resp = new BasicHttpResponse(pv, 500,
                                                "test response");
                                BasicHttpEntity entity = new BasicHttpEntity();
-                               String body = "{\"response\":\"\",\"message\":\"success\"}";
+                               String body = "{\"content\":\"\",\"message\":\"success\"}";
                                InputStream instream = new ByteArrayInputStream(body.getBytes());
                                entity.setContent(instream);
                                resp.setEntity(entity);
@@ -609,7 +609,7 @@ public class E2EServiceInstancesTest {
                 ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
                 HttpResponse resp = new BasicHttpResponse(pv, 200, "test response");
                 BasicHttpEntity entity = new BasicHttpEntity();
-                String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                String body = "{\"content\":\"success\",\"message\":\"success\"}";
                 InputStream instream = new ByteArrayInputStream(body.getBytes());
                 entity.setContent(instream);
                 resp.setEntity(entity);
@@ -802,7 +802,7 @@ public class E2EServiceInstancesTest {
                                HttpResponse resp = new BasicHttpResponse(pv, 202,
                                                "test response");
                                BasicHttpEntity entity = new BasicHttpEntity();
-                               String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                               String body = "{\"content\":\"success\",\"message\":\"success\"}";
                                InputStream instream = new ByteArrayInputStream(body.getBytes());
                                entity.setContent(instream);
                                resp.setEntity(entity);
@@ -863,7 +863,7 @@ public class E2EServiceInstancesTest {
                                HttpResponse resp = new BasicHttpResponse(pv, 202,
                                                "test response");
                                BasicHttpEntity entity = new BasicHttpEntity();
-                               String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                               String body = "{\"content\":\"success\",\"message\":\"success\"}";
                                InputStream instream = new ByteArrayInputStream(body.getBytes());
                                entity.setContent(instream);
                                resp.setEntity(entity);
@@ -925,7 +925,7 @@ public class E2EServiceInstancesTest {
                 HttpResponse resp = new BasicHttpResponse(pv, 202,
                         "test response");
                 BasicHttpEntity entity = new BasicHttpEntity();
-                String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                String body = "{\"content\":\"success\",\"message\":\"success\"}";
                 InputStream instream = new ByteArrayInputStream(body.getBytes());
                 entity.setContent(instream);
                 resp.setEntity(entity);
@@ -992,7 +992,7 @@ public class E2EServiceInstancesTest {
                 HttpResponse resp = new BasicHttpResponse(pv, 202,
                         "test response");
                 BasicHttpEntity entity = new BasicHttpEntity();
-                String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                String body = "{\"content\":\"success\",\"message\":\"success\"}";
                 InputStream instream = new ByteArrayInputStream(body.getBytes());
                 entity.setContent(instream);
                 resp.setEntity(entity);
@@ -1053,7 +1053,7 @@ public class E2EServiceInstancesTest {
                 HttpResponse resp = new BasicHttpResponse(pv, 202,
                         "test response");
                 BasicHttpEntity entity = new BasicHttpEntity();
-                String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                String body = "{\"content\":\"success\",\"message\":\"success\"}";
                 InputStream instream = new ByteArrayInputStream(body.getBytes());
                 entity.setContent(instream);
                 resp.setEntity(entity);
@@ -1160,7 +1160,7 @@ public class E2EServiceInstancesTest {
                 HttpResponse resp = new BasicHttpResponse(pv, 202,
                         "compareModelwithTargetVersion, test response");
                 BasicHttpEntity entity = new BasicHttpEntity();
-                String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                String body = "{\"content\":\"success\",\"message\":\"success\"}";
                 InputStream instream = new ByteArrayInputStream(body.getBytes());
                 entity.setContent(instream);
                 resp.setEntity(entity);
@@ -1229,7 +1229,7 @@ public class E2EServiceInstancesTest {
                 HttpResponse resp = new BasicHttpResponse(pv, 202,
                         "test response");
                 BasicHttpEntity entity = new BasicHttpEntity();
-                String body = "{\"response\":\"success\",\"message\":\"success\"}";
+                String body = "{\"content\":\"success\",\"message\":\"success\"}";
                 InputStream instream = new ByteArrayInputStream(body.getBytes());
                 entity.setContent(instream);
                 resp.setEntity(entity);
index fa1cce4..048efb1 100644 (file)
@@ -203,6 +203,7 @@ public class OrchestrationRequestsTest {
                        throws JsonParseException, JsonMappingException, IOException, ValidationException {\r
                ObjectMapper mapper = new ObjectMapper();\r
                String requestJSON = " {\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"ab1234\"}}}";\r
+               //String requestJSON = "{\"requestDetails\":{\"requestInfo\":{\"instanceName\":\"Vfmodule_vLB-0514-1\",\"source\":\"VID\",\"suppressRollback\":false,\"requestorId\":\"demo\"},\"modelInfo\":{\"modelType\":\"vfModule\",\"modelInvariantId\":\"80d62376-2d6d-4618-b666-bf00d0e58296\",\"modelVersionId\":\"578b52e5-4572-444d-8de7-2c140ec2e6e5\",\"modelName\":\"Vloadbalancer..base_vlb..module-0\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"bf87db73-2854-4cd1-adfd-8cd08e12befe\",\"modelCustomizationName\":\"Vloadbalancer..base_vlb..module-0\"},\"requestParameters\":{\"usePreload\":true},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"RegionOne\",\"tenantId\":\"ebb0ea7144004bacac1e39ff23105fa7\"},\"relatedInstanceList\":[{\"relatedInstance\":{\"instanceId\":\"60e28eb9-2808-4a5a-830f-ec982f01dcfe\",\"modelInfo\":{\"modelType\":\"service\",\"modelName\":\"vLoadBalancer\",\"modelInvariantId\":\"3f95e3ed-394d-4301-8c9b-c5f39ff89cfd\",\"modelVersion\":\"1.0\",\"modelVersionId\":\"da1b5347-7bcb-4cc4-8c29-d18dafdb1a47\"}}},{\"relatedInstance\":{\"instanceId\":\"338811a1-f7cd-4093-9903-d0f69b7cb176\",\"modelInfo\":{\"modelType\":\"vnf\",\"modelName\":\"vLoadBalancer\",\"modelInvariantId\":\"040740de-1ce8-4737-ad39-970684b0e3e8\",\"modelVersion\":\"1.0\",\"modelVersionId\":\"5fd1ce25-c414-4baf-903b-5042a60cfb02\",\"modelCustomizationId\":\"5801ace5-7cc7-4011-b677-165a0e8a2a27\",\"modelCustomizationName\":\"vLoadBalancer 0\"}}}]}}";\r
                \r
                MsoRequest msoRequest = new MsoRequest("rq1234d1-5a33-55df-13ab-12abad84e333");\r
                ServiceInstancesRequest sir = mapper.readValue(requestJSON, ServiceInstancesRequest.class);\r
@@ -222,6 +223,7 @@ public class OrchestrationRequestsTest {
                                infraRequests.setServiceInstanceId("ea4d5374-d28d-4bbf-9691-22985f088b12");\r
                                infraRequests.setRequestStatus(Status.IN_PROGRESS.name());\r
                                infraRequests.setStartTime(Timestamp.valueOf(LocalDateTime.now()));\r
+                               infraRequests.setRequestBody(requestJSON);\r
                                return infraRequests;\r
                        }\r
 \r
index a86a993..938a103 100644 (file)
@@ -229,7 +229,7 @@ public class ServiceInstanceTest {
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
-               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+               String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                entity.setContent(instream);\r
                resp.setEntity(entity);\r
@@ -295,7 +295,7 @@ public class ServiceInstanceTest {
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
-               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+               String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                entity.setContent(instream);\r
                resp.setEntity(entity);\r
@@ -362,7 +362,7 @@ public class ServiceInstanceTest {
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
-               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+               String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                entity.setContent(instream);\r
                resp.setEntity(entity);\r
@@ -912,7 +912,7 @@ public class ServiceInstanceTest {
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
 \r
-                               final String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               final String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                                entity.setContent(instream);\r
                                resp.setEntity(entity);\r
@@ -1077,7 +1077,7 @@ public class ServiceInstanceTest {
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
 \r
-                               final String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               final String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                                entity.setContent(instream);\r
                                resp.setEntity(entity);\r
@@ -1124,7 +1124,7 @@ public class ServiceInstanceTest {
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
 \r
-                               final String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               final String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                                entity.setContent(instream);\r
                                resp.setEntity(entity);\r
index 4fb5ebc..91c19dd 100644 (file)
@@ -3826,6 +3826,22 @@ public class CatalogDatabase implements Closeable {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateAllottedResourceCustomization", null);
         }
     }
+
+    public void saveVnfResource (VnfResource vnfResource) {
+        long startTime = System.currentTimeMillis ();
+        LOGGER.debug ("Catalog database - save vnf Resource with Name " + vnfResource.getModelName());
+        try {
+            VnfResource existing = this.getVnfResourceByModelUuid(vnfResource.getModelUuid());
+            if (existing == null) {
+                this.getSession().save(vnfResource);
+            } else {
+                LOGGER.debug("Found existing vnfResource with this modelUuid - no need to save");
+            }
+
+        } finally {
+            LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "saveOrUpdateVnfResourceCustomization", null);
+        }
+    }
     
     public void saveNetworkResource (NetworkResource networkResource) throws RecordNotFoundException {
         long startTime = System.currentTimeMillis ();
index 7976e51..b6281fc 100644 (file)
Binary files a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/resource_Extvl.csar and b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/resource_Extvl.csar differ
index fc21af3..daa270b 100644 (file)
Binary files a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service-ServiceFdnt-csar-0904-2.csar and b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service-ServiceFdnt-csar-0904-2.csar differ
index 41ee2c7..21b5f5e 100644 (file)
Binary files a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service-ServiceFdnt-with-allotted.csar and b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service-ServiceFdnt-with-allotted.csar differ
index fa117c4..6bbac7d 100644 (file)
Binary files a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg516VmmscSrvc_csar.csar and b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg516VmmscSrvc_csar.csar differ
index abab752..5303ce3 100644 (file)
                                                </image>
                                                <image>
                                                        <name>openecomp/mso:%l</name>
+                                                       <alias>onap/so:%1</alias>
                                                        <alias>mso</alias>
+                                                       <alias>so</alias>
                                                        <build>
                                                                <tags>
                                                                        <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>