aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/test
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2019-03-25 19:41:23 +0000
committerwaqas.ikram <waqas.ikram@est.tech>2019-03-25 19:41:23 +0000
commit448899ee55a6cf1c55b5510adceba8b3bab98297 (patch)
tree33247077dcf4d56e37ed1d5a28081f0c70f9de18 /bpmn/so-bpmn-tasks/src/test
parente2a3995dd8dba9b9a18635ce37e4805dadcdb0fd (diff)
Added input parameter loading handling from SDNC
Change-Id: I9076d793468db659358c7ef0e7cc859886d7fe17 Issue-ID: SO-1624 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test')
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java125
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImplTest.java181
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/VnfParameterTest.java38
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponse.json127
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidAdditionalAndExtVmData.json47
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidData.json39
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidVnfParamsTag.json34
8 files changed, 595 insertions, 2 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java
new file mode 100644
index 0000000000..803b58b4b8
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParametersProvider;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.NullInputParameter;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.client.exception.BBObjectNotFoundException;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+public class InputParameterRetrieverTaskTest extends BaseTaskTest {
+
+ private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
+
+ @Mock
+ private InputParametersProvider inputParametersProvider;
+
+ @Test
+ public void testGGetInputParameters_inputParameterStoredInExecutionContext() throws BBObjectNotFoundException {
+ final InputParameterRetrieverTask objUnderTest =
+ new InputParameterRetrieverTask(inputParametersProvider, extractPojosForBB);
+
+ final InputParameter inputParameter = new InputParameter(Collections.emptyMap(), Collections.emptyList());
+ when(inputParametersProvider.getInputParameter(Mockito.any(GenericVnf.class))).thenReturn(inputParameter);
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(new GenericVnf());
+ objUnderTest.getInputParameters(stubbedxecution);
+
+ final Object actual = stubbedxecution.getVariable(Constants.INPUT_PARAMETER);
+ assertNotNull(actual);
+ assertTrue(actual instanceof InputParameter);
+ }
+
+ @Test
+ public void testGGetInputParameters_ThrowExecption_NullInputParameterStoredInExecutionContext()
+ throws BBObjectNotFoundException {
+ final InputParameterRetrieverTask objUnderTest =
+ new InputParameterRetrieverTask(inputParametersProvider, extractPojosForBB);
+
+ when(inputParametersProvider.getInputParameter(Mockito.any(GenericVnf.class)))
+ .thenThrow(RuntimeException.class);
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(new GenericVnf());
+ objUnderTest.getInputParameters(stubbedxecution);
+
+ final Object actual = stubbedxecution.getVariable(Constants.INPUT_PARAMETER);
+ assertNotNull(actual);
+ assertTrue(actual instanceof NullInputParameter);
+ }
+
+
+ private class StubbedBuildingBlockExecution implements BuildingBlockExecution {
+
+ private final Map<String, Serializable> execution = new HashMap<>();
+
+ @Override
+ public GeneralBuildingBlock getGeneralBuildingBlock() {
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getVariable(final String key) {
+ return (T) execution.get(key);
+ }
+
+ @Override
+ public <T> T getRequiredVariable(final String key) throws RequiredExecutionVariableExeception {
+ return null;
+ }
+
+ @Override
+ public void setVariable(final String key, final Serializable value) {
+ execution.put(key, value);
+ }
+
+ @Override
+ public Map<ResourceKey, String> getLookupMap() {
+ return Collections.emptyMap();
+ }
+
+ @Override
+ public String getFlowToBeCalled() {
+ return null;
+ }
+
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
index ddfc08e08f..20abe6ece1 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
@@ -29,6 +29,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_REQUEST_PARAM_NAME;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_RESPONSE_PARAM_NAME;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.INPUT_PARAMETER;
import java.io.Serializable;
import java.util.Collections;
@@ -41,8 +42,7 @@ import org.mockito.Mock;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterCreateVnfTask;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterServiceProvider;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
@@ -83,6 +83,8 @@ public class VnfmAdapterCreateVnfTaskTest extends BaseTaskTest {
public void testBuildCreateVnfRequest_withValidValues_storesRequestInExecution() throws Exception {
final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+ stubbedxecution.setVariable(INPUT_PARAMETER,
+ new InputParameter(Collections.emptyMap(), Collections.emptyList()));
when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
objUnderTest.buildCreateVnfRequest(stubbedxecution);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImplTest.java
new file mode 100644
index 0000000000..d21942d08f
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImplTest.java
@@ -0,0 +1,181 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.FORWARD_SLASH;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.PRELOAD_VNFS_URL;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.DUMMY_GENERIC_VND_ID;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
+import org.onap.so.client.exception.BadResponseException;
+import org.onap.so.client.exception.MapperException;
+import org.onap.so.client.sdnc.SDNCClient;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class InputParametersProviderImplTest {
+
+ private static final String BASE_DIR = "src/test/resources/__files/";
+
+ private static final Path PRE_LOAD_SDNC_RESPONSE = Paths.get(BASE_DIR + "SDNCClientPrelaodDataResponse.json");
+
+ private static final Path INVALID_PRE_LOAD_SDNC_RESPONSE =
+ Paths.get(BASE_DIR + "SDNCClientPrelaodDataResponseWithInvalidData.json");
+
+ private static final Path INVALID_ADDITIONAL_AND_EXT_VM_DATA =
+ Paths.get(BASE_DIR + "SDNCClientPrelaodDataResponseWithInvalidAdditionalAndExtVmData.json");
+
+
+ private static final Path INVALID_VNF_PARAMS =
+ Paths.get(BASE_DIR + "SDNCClientPrelaodDataResponseWithInvalidVnfParamsTag.json");
+
+
+ private static final String MODEL_NAME = "MODEL_NAME";
+
+ private static final String GENERIC_VNF_NAME = "GENERIC_VNF_NAME";
+
+ private static final String URL = PRELOAD_VNFS_URL + GENERIC_VNF_NAME + FORWARD_SLASH + MODEL_NAME;
+
+ private static final String GENERIC_VNF_TYPE = MODEL_NAME;
+
+ @Mock
+ private SDNCClient mockedSdncClient;
+
+ @Test
+ public void testGetInputParameter_ValidResponseFromSdnc_NotEmptyInputParameter() throws Exception {
+ assertValues(getGenericVnf());
+ }
+
+ @Test
+ public void testGetInputParameter_ValidResponseFromSdncAndVnfType_NotEmptyInputParameter() throws Exception {
+ assertValues(getGenericVnf(GENERIC_VNF_TYPE));
+ }
+
+ @Test
+ public void testGetInputParameter_ValidResponseFromSdncInvalidData_EmptyInputParameter() throws Exception {
+ when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(INVALID_PRE_LOAD_SDNC_RESPONSE));
+ final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
+ assertNotNull(actual);
+ assertTrue(actual.getAdditionalParams().isEmpty());
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+ }
+
+ @Test
+ public void testGetInputParameter_ExceptionThrownFromSdnc_EmptyInputParameter() throws Exception {
+ when(mockedSdncClient.get(Mockito.eq(URL))).thenThrow(RuntimeException.class);
+ final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
+ assertNotNull(actual);
+ assertTrue(actual instanceof NullInputParameter);
+ assertTrue(actual.getAdditionalParams().isEmpty());
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+ }
+
+ @Test
+ public void testGetInputParameter_InvalidResponseData_EmptyInputParameter() throws Exception {
+ when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(INVALID_ADDITIONAL_AND_EXT_VM_DATA));
+ final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
+ assertNotNull(actual);
+ assertTrue(actual.getAdditionalParams().isEmpty());
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+ }
+
+ @Test
+ public void testGetInputParameter_EmptyResponseData_EmptyInputParameter() throws Exception {
+ when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn("");
+ final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
+ assertNotNull(actual);
+ assertTrue(actual instanceof NullInputParameter);
+ assertTrue(actual.getAdditionalParams().isEmpty());
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+ }
+
+ @Test
+ public void testGetInputParameter_InvalidVnfParamsResponseData_EmptyInputParameter() throws Exception {
+ when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(INVALID_VNF_PARAMS));
+ final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
+ assertNotNull(actual);
+ assertTrue(actual.getAdditionalParams().isEmpty());
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+ }
+
+ private void assertValues(final GenericVnf genericVnf) throws MapperException, BadResponseException, IOException {
+ when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(PRE_LOAD_SDNC_RESPONSE));
+ final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParameter actual = objUnderTest.getInputParameter(genericVnf);
+ assertNotNull(actual);
+
+ final Map<String, String> actualAdditionalParams = actual.getAdditionalParams();
+ assertEquals(3, actualAdditionalParams.size());
+
+ final String actualInstanceType = actualAdditionalParams.get("instance_type");
+ assertEquals("m1.small", actualInstanceType);
+
+ final List<ExternalVirtualLink> actualExtVirtualLinks = actual.getExtVirtualLinks();
+ assertEquals(1, actualExtVirtualLinks.size());
+
+ final ExternalVirtualLink actualExternalVirtualLink = actualExtVirtualLinks.get(0);
+ assertEquals("ac1ed33d-8dc1-4800-8ce8-309b99c38eec", actualExternalVirtualLink.getId());
+ }
+
+ private String getReponseAsString(final Path filePath) throws IOException {
+ return new String(Files.readAllBytes(filePath));
+ }
+
+ private GenericVnf getGenericVnf() {
+ final GenericVnf genericVnf = getGenericVnf(GENERIC_VNF_TYPE);
+ final ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
+ modelInfoGenericVnf.setModelName(MODEL_NAME);
+ genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf);
+ return genericVnf;
+ }
+
+ private GenericVnf getGenericVnf(final String vnfType) {
+ final GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId(DUMMY_GENERIC_VND_ID);
+ genericVnf.setVnfName(GENERIC_VNF_NAME);
+ genericVnf.setVnfType(vnfType);
+ return genericVnf;
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/VnfParameterTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/VnfParameterTest.java
new file mode 100644
index 0000000000..46018b8f39
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/VnfParameterTest.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import org.junit.Test;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+public class VnfParameterTest {
+ @Test
+ public void testVnfParameter_equalAndHasCode() throws ClassNotFoundException {
+ EqualsVerifier.forClass(VnfParameter.class).suppress(Warning.STRICT_INHERITANCE, Warning.NONFINAL_FIELDS)
+ .verify();
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponse.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponse.json
new file mode 100644
index 0000000000..0de25616e3
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponse.json
@@ -0,0 +1,127 @@
+{
+ "vnf-preload-list": [
+ {
+ "vnf-name": "GENERIC_VNF_NAME",
+ "vnf-type": "SIMPLE",
+ "preload-data":
+ {
+ "network-topology-information":
+ {
+ },
+ "vnf-topology-information":
+ {
+ "vnf-topology-identifier":
+ {
+ "service-type": "vCPE",
+ "vnf-type": "SIMPLE",
+ "vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-type": "SIMPLE"
+ },
+ "vnf-parameters": [
+ {
+ "vnf-parameter-name": "extra_console",
+ "vnf-parameter-value": "ttyS1"
+ },
+ {
+ "vnf-parameter-name": "vnfUsername",
+ "vnf-parameter-value": "vnf_user"
+ },
+ {
+ "vnf-parameter-name": "additionalParams",
+ "vnf-parameter-value": "{\"image_id\": \"DUMMYVNF\",\"instance_type\": \"m1.small\",\"ftp_address\": \"ftp://0.0.0.0:2100/\"}"
+ },
+ {
+ "vnf-parameter-name": "fsb_admin_gateway_ip_1",
+ "vnf-parameter-value": "0.0.0.0"
+ },
+ {
+ "vnf-parameter-name": "availability_zone_1"
+ },
+ {
+ "vnf-parameter-name": "fsb_admin_gateway_ip_2"
+ },
+ {
+ "vnf-parameter-name": "fsb_admin_prefix_length",
+ "vnf-parameter-value": "28"
+ },
+ {
+ "vnf-parameter-name": "ONAPMME_OMCN_vLC_P4_prefix_length",
+ "vnf-parameter-value": "28"
+ },
+ {
+ "vnf-parameter-name": "gpbs",
+ "vnf-parameter-value": "2"
+ },
+ {
+ "vnf-parameter-name": "fsb_admin_ip_2",
+ "vnf-parameter-value": "192.0.0.1"
+ },
+ {
+ "vnf-parameter-name": "internal_mtu",
+ "vnf-parameter-value": "1500"
+ },
+ {
+ "vnf-parameter-name": "storage_drbd_sync_rate",
+ "vnf-parameter-value": "0"
+ },
+ {
+ "vnf-parameter-name": "ONAPMME_MEDIA_vLC_P3_net_id",
+ "vnf-parameter-value": "ONAPMME_MEDIA_vLC_P3"
+ },
+ {
+ "vnf-parameter-name": "extVirtualLinks",
+ "vnf-parameter-value": "[{\"id\":\"ac1ed33d-8dc1-4800-8ce8-309b99c38eec\",\"tenant\":{\"cloudOwner\":\"CloudOwner\",\"regionName\":\"RegionOne\",\"tenantId\":\"80c26954-2536-4bca-9e20-10f8a2c9c2ad\"},\"resourceId\":\"8ef8cd54-75fd-4372-a6dd-2e05ea8fbd9b\",\"extCps\":[{\"cpdId\":\"f449292f-2f0f-4656-baa3-a18d86bac80f\",\"cpConfig\":[{\"cpInstanceId\":\"07876709-b66f-465c-99a7-0f4d026197f2\",\"linkPortId\":null,\"cpProtocolData\":null}]}],\"extLinkPorts\":null}]"
+ },
+ {
+ "vnf-parameter-name": "vnfIpAddress",
+ "vnf-parameter-value": "127.0.0.0"
+ },
+ {
+ "vnf-parameter-name": "node_type",
+ "vnf-parameter-value": "sgsnl"
+ },
+ {
+ "vnf-parameter-name": "ONAPMME_SIG_vLC_P2_net_id",
+ "vnf-parameter-value": "ONAPMME_SIG_vLC_P2"
+ },
+ {
+ "vnf-parameter-name": "updateOss",
+ "vnf-parameter-value": "false"
+ },
+ {
+ "vnf-parameter-name": "tmo",
+ "vnf-parameter-value": "0"
+ },
+ {
+ "vnf-parameter-name": "ss7",
+ "vnf-parameter-value": "Not_Applicable"
+ },
+ {
+ "vnf-parameter-name": "ONAPMME_OMCN_vLC_P4_net_id",
+ "vnf-parameter-value": "ONAPMME_OMCN_vLC_P4"
+ },
+ {
+ "vnf-parameter-name": "key_name"
+ },
+ {
+ "vnf-parameter-name": "fsb_admin_dns_server_ip_2"
+ },
+ {
+ "vnf-parameter-name": "time_zone",
+ "vnf-parameter-value": "GMT"
+ },
+ {
+ "vnf-parameter-name": "enableRollback",
+ "vnf-parameter-value": "false"
+ }
+ ]
+ },
+ "oper-status":
+ {
+ "order-status": "PendingAssignment"
+ }
+ }
+ }
+ ]
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidAdditionalAndExtVmData.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidAdditionalAndExtVmData.json
new file mode 100644
index 0000000000..c2cf2b2f28
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidAdditionalAndExtVmData.json
@@ -0,0 +1,47 @@
+{
+ "vnf-preload-list": [
+ {
+ "vnf-name": "GENERIC_VNF_NAME",
+ "vnf-type": "SIMPLE",
+ "preload-data":
+ {
+ "network-topology-information":
+ {
+ },
+ "vnf-topology-information":
+ {
+ "vnf-topology-identifier":
+ {
+ "service-type": "vCPE",
+ "vnf-type": "SIMPLE",
+ "vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-type": "SIMPLE"
+ },
+ "vnf-parameters": [
+ {
+ "vnf-parameter-name": "extra_console",
+ "vnf-parameter-value": "ttyS1"
+ },
+ {
+ "vnf-parameter-name": "vnfUsername",
+ "vnf-parameter-value": "vnf_user"
+ },
+ {
+ "vnf-parameter-name": "additionalParams",
+ "vnf-parameter-value": "[\"abc\"]"
+ },
+ {
+ "vnf-parameter-name": "extVirtualLinks",
+ "vnf-parameter-value": "{\"def\":\"123\"}"
+ }
+ ]
+ },
+ "oper-status":
+ {
+ "order-status": "PendingAssignment"
+ }
+ }
+ }
+ ]
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidData.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidData.json
new file mode 100644
index 0000000000..552adb9125
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidData.json
@@ -0,0 +1,39 @@
+{
+ "vnf-preload-list": [
+ {
+ "vnf-name": "GENERIC_VNF_NAME",
+ "vnf-type": "SIMPLE",
+ "preload-data":
+ {
+ "network-topology-information":
+ {
+ },
+ "vnf-topology-information":
+ {
+ "vnf-topology-identifier":
+ {
+ "service-type": "vCPE",
+ "vnf-type": "SIMPLE",
+ "vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-type": "SIMPLE"
+ },
+ "vnf-parameters": [
+ {
+ "vnf-parameter-name": "extra_console",
+ "vnf-parameter-value": "ttyS1"
+ },
+ {
+ "vnf-parameter-name": "vnfUsername",
+ "vnf-parameter-value": "vnf_user"
+ }
+ ]
+ },
+ "oper-status":
+ {
+ "order-status": "PendingAssignment"
+ }
+ }
+ }
+ ]
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidVnfParamsTag.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidVnfParamsTag.json
new file mode 100644
index 0000000000..e19ad1c9d3
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientPrelaodDataResponseWithInvalidVnfParamsTag.json
@@ -0,0 +1,34 @@
+{
+ "vnf-preload-list": [
+ {
+ "vnf-name": "GENERIC_VNF_NAME",
+ "vnf-type": "SIMPLE",
+ "preload-data":
+ {
+ "network-topology-information":
+ {
+ },
+ "vnf-topology-information":
+ {
+ "vnf-topology-identifier":
+ {
+ "service-type": "vCPE",
+ "vnf-type": "SIMPLE",
+ "vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-name": "GENERIC_VNF_NAME",
+ "generic-vnf-type": "SIMPLE"
+ },
+ "vnf-parameters": [
+ {
+ "hello": "world"
+ }
+ ]
+ },
+ "oper-status":
+ {
+ "order-status": "PendingAssignment"
+ }
+ }
+ }
+ ]
+}