- Select the ETSI configuration file using Browse
 
+          - the name of the file on the local file system must be etsi_config.json
+
         - Click on Done
 
 - Click on Check in
 
+++ /dev/null
-{
-    "apiVersion":"3.1",
-    "computeResourceFlavours": [
-        {
-            "vnfdVirtualComputeDescId": "server_compute",
-            "resourceId": "m1.small"
-        }
-    ],
-    "extVirtualLinks": [
-        {
-            "extCps": [
-                {
-                    "cpdId": "commisioning_ecp"
-                }
-            ],
-            "resourceId": "pub_net"
-        },
-        {
-            "extCps": [
-                {
-                    "cpdId": "vnftovnf_ecp"
-                }
-            ],
-            "resourceId": "preservedNetwork"
-        }
-    ],
-    "zones": [
-        {
-            "resourceId": "compute-a",
-            "id": "zoneInfoId"
-        }
-    ],
-    "flavourId": "scalable",
-    "grantlessMode": true,
-    "softwareImages": [
-        {
-            "resourceId": "ubuntu.16.04",
-            "vnfdSoftwareImageId": "server_image"
-        }
-    ],
-    "vims": [
-        {
-            "accessInfo": {
-                "username": "<username>",
-                "tenant": "<tenantName>",
-                "password": "<password>",
-                "region": "RegionOne"
-            },
-            "interfaceInfo": {
-                "endpoint": "https://<keyStoneIp>:5000/v2.0/",
-                "trustedCertificates": [],
-                "skipCertificateVerification": true,
-                "skipCertificateHostnameCheck": true
-            },
-            "vimInfoType": "OPENSTACK_V2_INFO",
-            "id": "vim_id"
-        }
-    ],
-    "instantiationLevelId": "default"
-}
 
+++ /dev/null
-{
-    "apiVersion":"3.1",
-    "computeResourceFlavours": [
-        {
-            "vnfdVirtualComputeDescId": "server_compute",
-            "resourceId": "m1.small"
-        }
-    ],
-    "extVirtualLinks": [
-        {
-            "extCps": [
-                {
-                    "cpdId": "commisioning_ecp"
-                }
-            ],
-            "resourceId": "pub_net"
-        },
-        {
-            "extCps": [
-                {
-                    "cpdId": "vnftovnf_ecp"
-                }
-            ],
-            "resourceId": "preservedNetwork"
-        }
-    ],
-    "zones": [
-        {
-            "resourceId": "compute-a",
-            "id": "zoneInfoId"
-        }
-    ],
-    "flavourId": "scalable",
-    "grantlessMode": true,
-    "softwareImages": [
-        {
-            "resourceId": "ubuntu.16.04",
-            "vnfdSoftwareImageId": "server_image"
-        }
-    ],
-    "vims": [
-        {
-            "accessInfo": {
-                "username": "<username>",
-                "tenant": "<tenantName>",
-                "password": "<password>",
-                "region": "RegionOne"
-            }, 
-            "interfaceInfo": {
-                "endpoint": "https://<keyStoneIp>:5000/v2.0/",
-                "trustedCertificates": [],
-                "skipCertificateVerification": true,
-                "skipCertificateHostnameCheck": true 
-            },
-            "vimInfoType": "OPENSTACK_V2_INFO",
-            "id": "vim_id"
-        }
-   ],
-    "instantiationLevelId": "default"
-}
 
--- /dev/null
+{
+  "extensions": [
+    {
+      "name": "myNameKey",
+      "value": "myName"
+    }
+  ],
+  "computeResourceFlavours": [
+    {
+      "vnfdVirtualComputeDescId": "server_compute",
+      "resourceId": "m1.small"
+    }
+  ],
+  "extVirtualLinks": [
+    {
+      "extCps": [
+        {
+          "cpdId": "universal_ecp"
+        }
+      ],
+      "resourceId": "pub_net"
+    }
+  ],
+  "zones": [
+    {
+      "resourceId": "compute-a",
+      "id": "zoneInfoId"
+    }
+  ],
+  "flavourId": "scalable",
+  "vimType": "OPENSTACK_V3_INFO",
+  "instantiationLevel": "default",
+  "softwareImages": [
+    {
+      "resourceId": "ubuntu.16.04",
+      "vnfdSoftwareImageId": "server_image"
+    }
+  ]
+}
\ No newline at end of file
 
 Simple
 ------
 
-- CSAR: :download:`csar <sampleVnfs/simple/simple.csar>`
+- CSAR R1: :download:`csar <sampleVnfs/simple/simple.v1.csar>`
+
+- CSAR R2: :download:`csar <sampleVnfs/simple/simple.v2.csar>`
+
+- Original CBAM package: :download:`csar <sampleVnfs/simple_cmcc/cbam.package.zip>`
+
+- ETSI configuration: :download:`csar <sampleVnfs/simple/etsi_config.json>`
 
 - NS creation request on VF-C API :download:`create.json <sampleVnfs/simple/vfc.ns.create.request.json>` (several fields must be changed to fit actual environment)
 
 
 The Simple VNF altered to suite the CMCC lab environment (no support for floating IPs)
 
-- CSAR: :download:`csar <sampleVnfs/simple_cmcc/simple.csar>`
+- CSAR R1: :download:`csar <sampleVnfs/simple_cmcc/simple.v1.csar>`
+
+- CSAR R2: :download:`csar <sampleVnfs/simple_cmcc/simple.v2.csar>`
+
+- Original CBAM package: :download:`csar <sampleVnfs/simple_cmcc/cbam.package.zip>`
 
 - ETSI configuration: :download:`csar <sampleVnfs/simple_cmcc/etsi_config.json>`
 
 Simple Dual
 -----------
 
-- CSAR: :download:`csar <sampleVnfs/simpleDual/simpleDual.csar>`
+- CSAR R1: :download:`csar <sampleVnfs/simpleDual/simpleDual.v1.csar>`
 
-- NS creation request on VF-C API :download:`create.json <sampleVnfs/simpleDual/vfc.ns.create.request.json>` (several fields must be changed to fit actual environment)
+- CSAR R2: :download:`csar <sampleVnfs/simpleDual/simpleDual.v2.csar>`
 
-- NS instantiation request on VF-C API :download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.json>` (several fields must be changed to fit actual environment)
+- Original CBAM package: :download:`csar <sampleVnfs/simpleDual/cbam.package.zip>`
 
-- NS heal request on VF-C API: :download:`heal.json <sampleVnfs/simpleDual/vfc.ns.heal.request.json>` (several fields must be changed to fit actual environment)
+- ETSI configuration: :download:`csar <sampleVnfs/simple_cmcc/etsi_config.json>`
+
+- NS creation request on VF-C API :download:`create.json <sampleVnfs/simpleDual/vfc.ns.create.request.json>` (several fields must be changed to fit actual environment)
+
+- NS instantiation request on VF-C API :download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.direct.json>` (several fields must be changed to fit actual environment)
 
-- VNF scale request on VF-C API: :download:`scale.json <sampleVnfs/simpleDual/vfc.vnf.scale.request.json>` (several fields must be changed to fit actual environment)
+- NS instantiation request on VF-C API when ETSI config is not supplied: download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.json>` (several fields must be changed to fit actual environment)
 
+- E2E scaling data: :download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.direct.json>` (several fields must be changed to fit actual environment)
 
-VOLTE IMS
----------
+- NS heal request on VF-C API: :download:`heal.json <sampleVnfs/simpleDual/vfc.ns.heal.request.json>` (several fields must be changed to fit actual environment)
 
-- TODO
\ No newline at end of file
+- VNF scale request on VF-C API: :download:`scale.json <sampleVnfs/simpleDual/vfc.vnf.scale.request.json>` (several fields must be changed to fit actual environment)
\ No newline at end of file
 
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Set;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
- * Transforms a CBAM package into an ONAP package
+ * Generic non ONAP version dependent package conversion
  */
-public class OnapAbstractVnfdBuilder {
+abstract class OnapAbstractVnfdBuilder {
     public static final String DESCRIPTION = "description";
     public static final String PROPERTIES = "properties";
     public static final String REQUIREMENTS = "requirements";
         return null;
     }
 
-    private JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
+    protected JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
         for (Map.Entry<String, JsonElement> node : nodes) {
             if (name.equals(node.getKey())) {
                 return node.getValue();
         }
         throw new NoSuchElementException("The VNFD does not have a node called " + name + " but required by an other node");
     }
+
+    protected String buildEcp(String name, JsonElement ecp, Set<Map.Entry<String, JsonElement>> nodes) {
+        if (ecp.getAsJsonObject().has(REQUIREMENTS)) {
+            String icpName = getRequirement(ecp.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "internal_connection_point");
+            if (icpName != null) {
+                return buildEcpInternal(name, icpName, nodes);
+            } else {
+                logger.warn("The {} ecp does not have an internal connection point", name);
+            }
+        } else {
+            logger.warn("The {} ecp does not have an requirements section", name);
+        }
+        return "";
+    }
+
+    private String buildEcpInternal(String ecpName, String icpName, Set<Map.Entry<String, JsonElement>> nodes) {
+        JsonObject icpNode = get(icpName, nodes).getAsJsonObject();
+        if (icpNode.has(REQUIREMENTS)) {
+            String vdu = getRequirement(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "virtual_binding");
+            //internal connection point is bound to VDU
+            if (vdu != null) {
+                return buildVduCpd(ecpName, vdu, child(icpNode, PROPERTIES));
+            } else {
+                logger.warn("The {} internal connection point of the {} ecp does not have a VDU", icpName, ecpName);
+            }
+        } else {
+            logger.warn("The {} internal connection point of the {} ecp does not have a requirements section", icpName, ecpName);
+        }
+        return "";
+    }
+
+    /**
+     * @param cbamVnfd the CBAM VNFD
+     * @return the converted ONAP VNFD
+     */
+    public String toOnapVnfd(String cbamVnfd) {
+        JsonObject root = new Gson().toJsonTree(new Yaml().load(cbamVnfd)).getAsJsonObject();
+        JsonObject topologyTemplate = child(root, "topology_template");
+        JsonObject substitution_mappings = child(topologyTemplate, "substitution_mappings");
+        Map<String, JsonElement> virtualLinks = new HashMap<>();
+        if (topologyTemplate.has("node_templates")) {
+            Set<Map.Entry<String, JsonElement>> nodeTemplates = child(topologyTemplate, "node_templates").entrySet();
+            StringBuilder body = new StringBuilder();
+            for (Map.Entry<String, JsonElement> node : nodeTemplates) {
+                String type = childElement(node.getValue().getAsJsonObject(), "type").getAsString();
+                if ("tosca.nodes.nfv.VDU".equals(type)) {
+                    body.append(buildVdu(node.getKey(), substitution_mappings, node.getValue().getAsJsonObject(), nodeTemplates));
+                } else if ("tosca.nodes.nfv.VirtualStorage".equals(type)) {
+                    body.append(buildVolume(node.getKey(), node.getValue().getAsJsonObject()));
+                } else if ("tosca.nodes.nfv.VL".equals(type)) {
+                    virtualLinks.put(node.getKey(), node.getValue());
+                    body.append(buildVl(node.getValue().getAsJsonObject().get(PROPERTIES).getAsJsonObject(), node.getKey()));
+                } else if ("tosca.nodes.nfv.ICP".equals(type)) {
+                    body.append(buildIcp(node.getKey(), node.getValue().getAsJsonObject()));
+                } else if ("tosca.nodes.nfv.ECP".equals(type)) {
+                    body.append(buildEcp(node.getKey(), node.getValue(), nodeTemplates));
+                } else {
+                    logger.warn("The {} type is not converted", type);
+                }
+            }
+            return buildHeader(topologyTemplate, virtualLinks) + body.toString();
+        }
+        return buildHeader(topologyTemplate, virtualLinks);
+    }
+
+    abstract protected String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks);
+
+    abstract protected String buildVduCpd(String name, String vdu, JsonObject properties);
+
+    abstract protected String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes);
+
+    abstract protected String buildIcp(String name, JsonObject icp);
+
+    abstract protected String buildVolume(String nodeName, JsonObject volume);
+
+    abstract protected String buildVl(JsonObject vlProperties, String name);
 }
 
 
 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer;
 
-import com.google.common.annotations.VisibleForTesting;
-import com.google.gson.Gson;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Set;
-import java.util.regex.Pattern;
 import org.slf4j.Logger;
-import org.yaml.snakeyaml.Yaml;
 
 import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.child;
 import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.childElement;
+import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.LifecycleManager.ETSI_CONFIG;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
  * Transforms a CBAM package into an ONAP package
  */
-public class OnapVnfdBuilder {
-    public static final String DESCRIPTION = "description";
-    public static final String PROPERTIES = "properties";
-    public static final String REQUIREMENTS = "requirements";
-    private static Logger logger = getLogger(OnapVnfdBuilder.class);
-
-    @VisibleForTesting
-    static String indent(String content, int prefixSize) {
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < prefixSize; i++) {
-            sb.append("  ");
-        }
-        Pattern pattern = Pattern.compile("^(.*)$", Pattern.MULTILINE);
-        return pattern.matcher(content).replaceAll(sb.toString() + "$1");
-    }
+public class OnapR1VnfdBuilder extends OnapAbstractVnfdBuilder {
+    private static Logger logger = getLogger(OnapR1VnfdBuilder.class);
 
     private static String trimUnit(String data) {
-        //FIXME the unit should not be trimmed VF-C bug
+        //The R1 templates in Amsterdam release can not handle the scalar-unit types in Tosca
+        //templates, so that the MB, GB, ... units need to be removed even though the created
+        //Tosca template will be invalid
         return data.trim().replaceAll("[^0-9]", "");
     }
 
-    public static String getRequirement(JsonArray requirements, String key) {
-        for (int i = 0; i < requirements.size(); i++) {
-            JsonElement requirement = requirements.get(i);
-            Map.Entry<String, JsonElement> next = requirement.getAsJsonObject().entrySet().iterator().next();
-            String s = next.getKey();
-            if (key.equals(s)) {
-                return next.getValue().getAsString();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * @param cbamVnfd the CBAM VNFD
-     * @return the converted ONAP VNFD
-     */
-    public String toOnapVnfd(String cbamVnfd) {
-        JsonObject root = new Gson().toJsonTree(new Yaml().load(cbamVnfd)).getAsJsonObject();
-        JsonObject topologyTemplate = child(root, "topology_template");
-        if (topologyTemplate.has("node_templates")) {
-            Set<Map.Entry<String, JsonElement>> nodeTemplates = child(topologyTemplate, "node_templates").entrySet();
-            StringBuilder body = new StringBuilder();
-            for (Map.Entry<String, JsonElement> node : nodeTemplates) {
-                String type = childElement(node.getValue().getAsJsonObject(), "type").getAsString();
-                if ("tosca.nodes.nfv.VDU".equals(type)) {
-                    body.append(buildVdu(node.getKey(), node.getValue().getAsJsonObject(), nodeTemplates));
-                } else if ("tosca.nodes.nfv.VirtualStorage".equals(type)) {
-                    body.append(buildVolume(node.getKey(), node.getValue().getAsJsonObject()));
-                } else if ("tosca.nodes.nfv.VL".equals(type)) {
-                    body.append(buildVl(node.getKey()));
-                } else if ("tosca.nodes.nfv.ICP".equals(type)) {
-                    body.append(buildIcp(node.getKey(), node.getValue().getAsJsonObject()));
-                } else if ("tosca.nodes.nfv.ECP".equals(type)) {
-                    body.append(buildEcp(node.getKey(), node.getValue(), nodeTemplates));
-                } else {
-                    logger.warn("The {} type is not converted", type);
-                }
-            }
-            return buildHeader(topologyTemplate) + body.toString();
-        }
-        return buildHeader(topologyTemplate);
-    }
-
-    private String buildHeader(JsonObject toplogyTemplate) {
+    @Override
+    protected String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks) {
         JsonObject properties = child(child(toplogyTemplate, "substitution_mappings"), PROPERTIES);
         String descriptorVersion = properties.get("descriptor_version").getAsString();
         return "tosca_definitions_version: tosca_simple_yaml_1_0\n" +
                 "  vnfdVersion: " + descriptorVersion + "\n\n" +
                 "topology_template:\n" +
                 "  inputs:\n" +
-                "    etsi_config:\n" +
+                "    " + ETSI_CONFIG + ":\n" +
                 "      type: string\n" +
                 "      description: The ETSI configuration\n" +
                 "  node_templates:\n";
     }
 
-    private JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
-        for (Map.Entry<String, JsonElement> node : nodes) {
-            if (name.equals(node.getKey())) {
-                return node.getValue();
-            }
-        }
-        throw new NoSuchElementException("The VNFD does not have a node called " + name + " but required by an other node");
-    }
-
-    private String buildVdu(String name, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
+    @Override
+    protected String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
         String memorySize = "";
         String cpuCount = "";
         StringBuilder body = new StringBuilder();
         return header + body.toString();
     }
 
-    private String buildEcp(String name, JsonElement ecp, Set<Map.Entry<String, JsonElement>> nodes) {
-        if (ecp.getAsJsonObject().has(REQUIREMENTS)) {
-            String icpName = getRequirement(ecp.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "internal_connection_point");
-            if (icpName != null) {
-                return buildEcpInternal(name, icpName, nodes);
-            } else {
-                logger.warn("The {} ecp does not have an internal connection point", name);
-            }
-        } else {
-            logger.warn("The {} ecp does not have an requirements section", name);
-        }
-        return "";
-    }
-
-    private String buildEcpInternal(String ecpName, String icpName, Set<Map.Entry<String, JsonElement>> nodes) {
-        JsonObject icpNode = get(icpName, nodes).getAsJsonObject();
-        if (icpNode.has(REQUIREMENTS)) {
-            String vdu = getRequirement(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "virtual_binding");
-            //internal connection point is bound to VDU
-            if (vdu != null) {
-                return buildVduCpd(ecpName, vdu, child(icpNode, PROPERTIES));
-            } else {
-                logger.warn("The {} internal connection point of the {} ecp does not have a VDU", icpName, ecpName);
-            }
-        } else {
-            logger.warn("The {} internal connection point of the {} ecp does not have a requirements section", icpName, ecpName);
-        }
-        return "";
-    }
-
-    private String buildIcp(String name, JsonObject icp) {
+    protected String buildIcp(String name, JsonObject icp) {
         if (icp.has(REQUIREMENTS)) {
             JsonArray requirements = icp.get(REQUIREMENTS).getAsJsonArray();
             String vdu = getRequirement(requirements, "virtual_binding");
         return "";
     }
 
-    private String buildVduCpd(String name, String vdu, JsonObject properties) {
+    protected String buildVduCpd(String name, String vdu, JsonObject properties) {
         return indent(name + ":\n" +
                 "  type: tosca.nodes.nfv.VduCpd\n" +
                 "  " + PROPERTIES + ":\n" +
                 "    - virtual_binding: " + vdu + "\n", 2);
     }
 
-    private String buildVolume(String nodeName, JsonObject volume) {
+    protected String buildVolume(String nodeName, JsonObject volume) {
         return indent(nodeName + ":\n" +
                 "  type: tosca.nodes.nfv.VDU.VirtualStorage\n" +
                 "  properties:\n" +
                 "    size_of_storage: " + trimUnit(childElement(child(volume, PROPERTIES), "size_of_storage").getAsString()) + "\n", 2);
     }
 
-    private String buildVl(String name) {
+    @Override
+    protected String buildVl(JsonObject vlProperties, String name) {
         return indent(name + ":\n" +
                 "  type: tosca.nodes.nfv.VnfVirtualLinkDesc\n" +
                 "  properties:\n" +
 
 
 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer;
 
-import com.google.gson.Gson;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
-import java.util.HashMap;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Set;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.core.SelfRegistrationManager;
 import org.slf4j.Logger;
-import org.yaml.snakeyaml.Yaml;
 
-import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfdBuilder.getRequirement;
-import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfdBuilder.indent;
 import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.child;
 import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.childElement;
+import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.LifecycleManager.ETSI_CONFIG;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
  * Transforms a CBAM package into an ONAP package
  */
-public class OnapR2VnfdBuilder {
-    public static final String DESCRIPTION = "description";
-    public static final String PROPERTIES = "properties";
-    public static final String REQUIREMENTS = "requirements";
+public class OnapR2VnfdBuilder extends OnapAbstractVnfdBuilder {
     private static Logger logger = getLogger(OnapR2VnfdBuilder.class);
 
-    private static String trimUnit(String data) {
-        //FIXME the unit should not be trimmed VF-C bug
-        return data;
-        //data.trim().replaceAll("[^0-9]", "");
-    }
-
-    /**
-     * @param cbamVnfd the CBAM VNFD
-     * @return the converted ONAP VNFD
-     */
-    public String toOnapVnfd(String cbamVnfd) {
-        JsonObject root = new Gson().toJsonTree(new Yaml().load(cbamVnfd)).getAsJsonObject();
-        JsonObject topologyTemplate = child(root, "topology_template");
-        JsonObject substitution_mappings = child(topologyTemplate, "substitution_mappings");
-        Map<String, JsonElement> virtualLinks = new HashMap<>();
-        if (topologyTemplate.has("node_templates")) {
-            Set<Map.Entry<String, JsonElement>> nodeTemplates = child(topologyTemplate, "node_templates").entrySet();
-
-            StringBuilder body = new StringBuilder();
-            for (Map.Entry<String, JsonElement> node : nodeTemplates) {
-                String type = childElement(node.getValue().getAsJsonObject(), "type").getAsString();
-                if ("tosca.nodes.nfv.VDU".equals(type)) {
-                    body.append(buildVdu(node.getKey(), substitution_mappings, node.getValue().getAsJsonObject(), nodeTemplates));
-                } else if ("tosca.nodes.nfv.VirtualStorage".equals(type)) {
-                    body.append(buildVolume(node.getKey(), node.getValue().getAsJsonObject()));
-                } else if ("tosca.nodes.nfv.VL".equals(type)) {
-                    virtualLinks.put(node.getKey(), node.getValue());
-                    body.append(buildVl(node.getValue().getAsJsonObject().get(PROPERTIES).getAsJsonObject(), node.getKey()));
-                } else if ("tosca.nodes.nfv.ICP".equals(type)) {
-                    body.append(buildIcp(node.getKey(), node.getValue().getAsJsonObject()));
-                } else if ("tosca.nodes.nfv.ECP".equals(type)) {
-                    body.append(buildEcp(node.getKey(), node.getValue(), nodeTemplates));
-                } else {
-                    logger.warn("The {} type is not converted", type);
-                }
-            }
-            return buildHeader(topologyTemplate, virtualLinks) + body.toString();
-        }
-        return buildHeader(topologyTemplate, virtualLinks);
-    }
-
-    private String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks) {
+    protected String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks) {
         JsonObject substitution_mappings = child(toplogyTemplate, "substitution_mappings");
         String vnfContent = buildVnf(substitution_mappings, virtualLinks);
         return "tosca_definitions_version: tosca_simple_profile_yaml_1_1\n" +
                 "\n" +
                 "topology_template:\n" +
                 "  inputs:\n" +
-                "    etsi_config:\n" +
+                "    " + ETSI_CONFIG + ":\n" +
                 "      type: string\n" +
                 "      description: The ETSI configuration\n" +
                 "  node_templates:\n" + vnfContent;
     }
 
-    private JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
-        for (Map.Entry<String, JsonElement> node : nodes) {
-            if (name.equals(node.getKey())) {
-                return node.getValue();
-            }
-        }
-        throw new NoSuchElementException("The VNFD does not have a node called " + name + " but required by an other node");
-    }
-
-    private String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
+    protected String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
         String memorySize = "";
         String cpuCount = "";
         StringBuilder body = new StringBuilder();
             if ("virtual_compute".equals(s)) {
                 JsonObject virtualCompute = get(next.getValue().getAsString(), nodes).getAsJsonObject();
                 cpuCount = childElement(child(child(virtualCompute, PROPERTIES), "virtual_cpu"), "num_virtual_cpu").getAsString();
-                memorySize = trimUnit(childElement(child(child(virtualCompute, PROPERTIES), "virtual_memory"), "virtual_mem_size").getAsString());
+                memorySize = childElement(child(child(virtualCompute, PROPERTIES), "virtual_memory"), "virtual_mem_size").getAsString();
             } else if ("virtual_storage".equals(s)) {
                 String item = indent(
                         "- virtual_storage:\n" +
                 indent(
                         "properties:\n" +
                                 "  virtual_memory:\n" +
-                                "    virtual_mem_size: " + trimUnit(memorySize) + "\n" +
+                                "    virtual_mem_size: " + memorySize + "\n" +
                                 "  virtual_cpu:\n" +
                                 "    num_virtual_cpu: " + cpuCount + "\n", 3) +
                 "  " + REQUIREMENTS + ":\n", 2);
         return header + body.toString();
     }
 
-    private String buildEcp(String name, JsonElement ecp, Set<Map.Entry<String, JsonElement>> nodes) {
-        if (ecp.getAsJsonObject().has(REQUIREMENTS)) {
-            String icpName = getRequirement(ecp.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "internal_connection_point");
-            if (icpName != null) {
-                return buildEcpInternal(name, icpName, nodes);
-            } else {
-                logger.warn("The {} ecp does not have an internal connection point", name);
-            }
-        } else {
-            logger.warn("The {} ecp does not have an requirements section", name);
-        }
-        return "";
-    }
-
     private String buildVnf(JsonObject vnf, Map<String, JsonElement> virtualLinks) {
         JsonObject vnfProperties = child(vnf, PROPERTIES);
         JsonObject flavourProperties = child(child(child(vnf, "capabilities"), "deployment_flavour"), "properties");
                 vlContent.toString();
     }
 
-    private String buildEcpInternal(String ecpName, String icpName, Set<Map.Entry<String, JsonElement>> nodes) {
-        JsonObject icpNode = get(icpName, nodes).getAsJsonObject();
-        if (icpNode.has(REQUIREMENTS)) {
-            String vdu = getRequirement(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "virtual_binding");
-            //internal connection point is bound to VDU
-            if (vdu != null) {
-                return buildVduCpd(ecpName, vdu, child(icpNode, PROPERTIES));
-            } else {
-                logger.warn("The {} internal connection point of the {} ecp does not have a VDU", icpName, ecpName);
-            }
-        } else {
-            logger.warn("The {} internal connection point of the {} ecp does not have a requirements section", icpName, ecpName);
-        }
-        return "";
-    }
-
-    private String buildIcp(String name, JsonObject icp) {
+    protected String buildIcp(String name, JsonObject icp) {
         if (icp.has(REQUIREMENTS)) {
             JsonArray requirements = icp.get(REQUIREMENTS).getAsJsonArray();
             String vdu = getRequirement(requirements, "virtual_binding");
         return "";
     }
 
-    private String buildVduCpd(String name, String vdu, JsonObject properties) {
+    protected String buildVduCpd(String name, String vdu, JsonObject properties) {
         return indent(name + ":\n" +
                 "  type: tosca.nodes.nfv.VduCp\n" +
                 "  " + PROPERTIES + ":\n" +
                 "    - virtual_binding: " + vdu + "\n", 2);
     }
 
-    private String buildVolume(String nodeName, JsonObject volume) {
+    protected String buildVolume(String nodeName, JsonObject volume) {
         return indent(nodeName + ":\n" +
                 "  type: tosca.nodes.nfv.Vdu.VirtualStorage\n" +
                 "  properties:\n" +
                 "    type_of_storage: volume\n" +
-                "    size_of_storage: " + trimUnit(childElement(child(volume, PROPERTIES), "size_of_storage").getAsString()) + "\n", 2);
+                "    size_of_storage: " + childElement(child(volume, PROPERTIES), "size_of_storage").getAsString() + "\n", 2);
     }
 
-    private String buildVl(JsonObject vlProperties, String name) {
+    protected String buildVl(JsonObject vlProperties, String name) {
+        JsonObject connectivityType = child(vlProperties, "connectivity_type");
         return indent(name + ":\n" +
                 "  type: tosca.nodes.nfv.VnfVirtualLink\n" +
                 "  properties:\n" +
                 "    connectivity_type:\n" +
-                "      layer_protocol: [ " + childElement(child(vlProperties, "connectivity_type"), "layer_protocol").getAsString() + " ]\n" +
-                "      flow_pattern: " + childElement(child(vlProperties, "connectivity_type"), "flow_pattern").getAsString() + "\n" +
+                "      layer_protocol: [ " + childElement(connectivityType, "layer_protocol").getAsString() + " ]\n" +
+                (connectivityType.has("flow_pattern") ? "      flow_pattern: " + childElement(connectivityType, "flow_pattern").getAsString() + "\n" : "") +
                 "    vl_profile:\n" +
                 "      max_bit_rate_requirements:\n" +
                 "        root: " + Integer.MAX_VALUE + "\n" + //FIXME GAP IN CBAM TEMPLATE
 
  * Transforms a CBAM package into an ONAP package
  */
 
-public class OnapR1VnfPackageBuilder {
+public class OnapVnfPackageBuilder {
 
     /**
      * Entry point for the command line package transformer
      * @param args not used (required due to signature)
      */
     public static void main(String[] args) throws Exception {
-        byte[] covert = new OnapR1VnfPackageBuilder().covert(systemFunctions().in(), SupportedOnapPackageVersions.V1);
+        byte[] covert = new OnapVnfPackageBuilder().covert(systemFunctions().in(), SupportedOnapPackageVersions.V1);
         systemFunctions().out().write(covert);
     }
 
         byte[] cbamVnfdContent = vnfdContent.toByteArray();
         String onapVnfd = SupportedOnapPackageVersions.V2 == version ?
                 new OnapR2VnfdBuilder().toOnapVnfd(new String(cbamVnfdContent, StandardCharsets.UTF_8)) :
-                new OnapVnfdBuilder().toOnapVnfd(new String(cbamVnfdContent, StandardCharsets.UTF_8));
+                new OnapR1VnfdBuilder().toOnapVnfd(new String(cbamVnfdContent, StandardCharsets.UTF_8));
         byte[] modifiedCbamPackage = new CbamVnfPackageBuilder().toModifiedCbamVnfPackage(cbamVnfPackage, vnfdLocation, new CbamVnfdBuilder().build(new String(cbamVnfdContent)));
         return buildNewOnapPackage(modifiedCbamPackage, onapVnfd);
     }
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.Part;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapR1VnfPackageBuilder;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfPackageBuilder;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.SupportedOnapPackageVersions;
 import org.slf4j.Logger;
 import org.springframework.stereotype.Controller;
 @RequestMapping(value = BASE_URL)
 public class ConverterApi {
     private static Logger logger = getLogger(ConverterApi.class);
-    private OnapR1VnfPackageBuilder vnfPackageConverter = new OnapR1VnfPackageBuilder();
+    private OnapVnfPackageBuilder vnfPackageConverter = new OnapVnfPackageBuilder();
 
     /**
      * Return the converted ONAP package
 
                 return child(child(operation.getValue().getAsJsonObject(), "inputs"), "additional_parameters").entrySet();
             }
         }
+
         throw buildFatalFailure(logger, "Unable to find operation named " + operationName);
     }
 
 
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.direct.notification.*;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.so.TestSoLifecycleManager;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.vfc.*;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestCbamVnfPackageBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestCbamVnfdBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestOnapVnfPackageBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestOnapVnfdBuilder;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.*;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.restapi.*;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring.TestRealConfig;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring.TestServletInitializer;
         TestVfcNotificationSender.class,
 
         TestCbamVnfdBuilder.class,
-        TestOnapVnfdBuilder.class,
+        TestOnapR1VnfdBuilder.class,
+        TestOnapR2VnfdBuilder.class,
         TestCbamVnfPackageBuilder.class,
         TestOnapVnfPackageBuilder.class,
 
 
--- /dev/null
+/*
+ * Copyright 2016-2017, Nokia Corporation
+ *
+ * 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.
+ */
+package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer;
+
+import org.junit.Test;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
+
+import static junit.framework.TestCase.assertEquals;
+
+public class TestOnapAbstractVnfdBuilder extends TestBase {
+
+    @Test
+    public void indent() {
+        assertEquals("    x", OnapAbstractVnfdBuilder.indent("x", 2));
+        assertEquals("    x\n", OnapAbstractVnfdBuilder.indent("x\n", 2));
+        assertEquals("    x\n    y", OnapAbstractVnfdBuilder.indent("x\ny", 2));
+        assertEquals("    x\n    y\n", OnapAbstractVnfdBuilder.indent("x\ny\n", 2));
+        assertEquals("    \n", OnapAbstractVnfdBuilder.indent("\n", 2));
+    }
+}
 
 import static org.springframework.test.util.ReflectionTestUtils.setField;
 
 
-public class TestOnapVnfdBuilder extends TestBase {
-    private OnapVnfdBuilder packageTransformer = new OnapVnfdBuilder();
+public class TestOnapR1VnfdBuilder extends TestBase {
+    private OnapR1VnfdBuilder packageTransformer = new OnapR1VnfdBuilder();
 
 
     @Before
     public void init() {
-        setField(OnapVnfdBuilder.class, "logger", logger);
-    }
-
-    @Test
-    public void indent() {
-        assertEquals("    x", packageTransformer.indent("x", 2));
-        assertEquals("    x\n", packageTransformer.indent("x\n", 2));
-        assertEquals("    x\n    y", packageTransformer.indent("x\ny", 2));
-        assertEquals("    x\n    y\n", packageTransformer.indent("x\ny\n", 2));
-        assertEquals("    \n", packageTransformer.indent("\n", 2));
+        setField(OnapAbstractVnfdBuilder.class, "logger", logger);
+        setField(OnapR1VnfdBuilder.class, "logger", logger);
     }
 
     /**
      * if a node refers to a non existing node it results in a failure
      */
     @Test
-    public void testInconsitentVnfd() {
+    public void testInconsistentVnfd() {
         try {
             packageTransformer.toOnapVnfd(new String(TestUtil.loadFile("unittests/packageconverter/nodes.vnfd.inconsistent.cbam.yaml")));
             fail();
 
 
 import static junit.framework.TestCase.assertEquals;
 import static junit.framework.TestCase.fail;
+import static org.mockito.Mockito.verify;
 import static org.springframework.test.util.ReflectionTestUtils.setField;
 
 
 
     @Before
     public void init() {
-        setField(OnapVnfdBuilder.class, "logger", logger);
+        setField(OnapAbstractVnfdBuilder.class, "logger", logger);
+        setField(OnapR2VnfdBuilder.class, "logger", logger);
     }
 
 
     @Test
     public void testNodes() {
         assertEquals(new String(TestUtil.loadFile("unittests/packageconverter/nodes.vnfd.onap.v2.yaml")), packageTransformer.toOnapVnfd(new String(TestUtil.loadFile("unittests/packageconverter/nodes.vnfd.cbam.yaml"))));
-       /* verify(logger).warn("The {} ecp does not have an internal connection point", "myEcpWithoutIcp");
+        verify(logger).warn("The {} ecp does not have an internal connection point", "myEcpWithoutIcp");
         verify(logger).warn("The {} ecp does not have an requirements section", "ecpWithIcpWithOutRequirements");
         verify(logger).warn("The {} internal connection point of the {} ecp does not have a VDU", "icpWithoutVdu", "myEcpWithoutIcpWithoutVdu");
         verify(logger).warn("The {} internal connection point of the {} ecp does not have a requirements section", "icpWithOutRequiements", "myEcpWithoutIcpWithoutIcpReq");
         verify(logger).warn("The {} internal connection point does not have a VDU", "icpWithOutVdu");
         verify(logger).warn("The {} internal connection point does not have a requirements section", "icpWithOutRequiements");
         verify(logger).warn("The {} internal connection point does not have a VL", "icpWithOutVl");
-        verify(logger).warn("The {} type is not converted", "tosca.nodes.nfv.Unknown")*/
+        verify(logger).warn("The {} type is not converted", "tosca.nodes.nfv.Unknown");
     }
 
     /**
 
         when(systemFunctions.loadFile("MainServiceTemplate.mf")).thenCallRealMethod();
 
         String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
-        String expectedOnapVnfd = new OnapVnfdBuilder().toOnapVnfd(cbamVnfd);
+        String expectedOnapVnfd = new OnapR1VnfdBuilder().toOnapVnfd(cbamVnfd);
 
         //when
-        OnapR1VnfPackageBuilder.main(null);
+        OnapVnfPackageBuilder.main(null);
         //verify
         assertFileInZip(bos.toByteArray(), "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
         assertFileInZip(bos.toByteArray(), "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
         assertItenticalZips(expectedModifiedCbamPackage, actualModifiedCbamVnfPackage.toByteArray());
     }
 
+    /**
+     * Test conversion for V1 package
+     */
+    @Test
+    public void testConversionViaV1() throws Exception {
+        when(systemFunctions.loadFile("cbam.pre.collectConnectionPoints.js")).thenCallRealMethod();
+        when(systemFunctions.loadFile("cbam.collectConnectionPoints.js")).thenCallRealMethod();
+        when(systemFunctions.loadFile("cbam.post.collectConnectionPoints.js")).thenCallRealMethod();
+        when(systemFunctions.loadFile("TOSCA.meta")).thenCallRealMethod();
+        when(systemFunctions.loadFile("MainServiceTemplate.mf")).thenCallRealMethod();
+
+        String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
+        String expectedOnapVnfd = new OnapR1VnfdBuilder().toOnapVnfd(cbamVnfd);
+        //when
+        byte[] convertedPackage = new OnapVnfPackageBuilder().covert(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip")), SupportedOnapPackageVersions.V1);
+        //verify
+        assertFileInZip(convertedPackage, "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
+        assertFileInZip(convertedPackage, "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
+        assertFileInZip(convertedPackage, "MainServiceTemplate.mf", TestUtil.loadFile("MainServiceTemplate.mf"));
+        ByteArrayOutputStream actualModifiedCbamVnfPackage = getFileInZip(new ByteArrayInputStream(convertedPackage), "Artifacts/Deployment/OTHER/cbam.package.zip");
+        byte[] expectedModifiedCbamPackage = new CbamVnfPackageBuilder().toModifiedCbamVnfPackage(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip"), "vnfdloc/a.yaml", new CbamVnfdBuilder().build(cbamVnfd));
+        assertItenticalZips(expectedModifiedCbamPackage, actualModifiedCbamVnfPackage.toByteArray());
+    }
+
+    /**
+     * Test conversion for V2 package
+     */
+    @Test
+    public void testConversionViaV2() throws Exception {
+        when(systemFunctions.loadFile("cbam.pre.collectConnectionPoints.js")).thenCallRealMethod();
+        when(systemFunctions.loadFile("cbam.collectConnectionPoints.js")).thenCallRealMethod();
+        when(systemFunctions.loadFile("cbam.post.collectConnectionPoints.js")).thenCallRealMethod();
+        when(systemFunctions.loadFile("TOSCA.meta")).thenCallRealMethod();
+        when(systemFunctions.loadFile("MainServiceTemplate.mf")).thenCallRealMethod();
+
+        String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
+        String expectedOnapVnfd = new OnapR2VnfdBuilder().toOnapVnfd(cbamVnfd);
+        //when
+        byte[] convertedPackage = new OnapVnfPackageBuilder().covert(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip")), SupportedOnapPackageVersions.V2);
+        //verify
+        assertFileInZip(convertedPackage, "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
+        assertFileInZip(convertedPackage, "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
+        assertFileInZip(convertedPackage, "MainServiceTemplate.mf", TestUtil.loadFile("MainServiceTemplate.mf"));
+        ByteArrayOutputStream actualModifiedCbamVnfPackage = getFileInZip(new ByteArrayInputStream(convertedPackage), "Artifacts/Deployment/OTHER/cbam.package.zip");
+        byte[] expectedModifiedCbamPackage = new CbamVnfPackageBuilder().toModifiedCbamVnfPackage(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip"), "vnfdloc/a.yaml", new CbamVnfdBuilder().build(cbamVnfd));
+        assertItenticalZips(expectedModifiedCbamPackage, actualModifiedCbamVnfPackage.toByteArray());
+    }
 
     /**
      * Prevents moving the class (customer documentation) must be updated
      */
     @Test
     public void testPreventMove() {
-        assertEquals("b3JnLm9uYXAudmZjLm5mdm8uZHJpdmVyLnZuZm0uc3ZuZm0ubm9raWEucGFja2FnZXRyYW5zZm9ybWVyLk9uYXBSMVZuZlBhY2thZ2VCdWlsZGVy", Base64.getEncoder().encodeToString(OnapR1VnfPackageBuilder.class.getCanonicalName().getBytes()));
+        assertEquals("b3JnLm9uYXAudmZjLm5mdm8uZHJpdmVyLnZuZm0uc3ZuZm0ubm9raWEucGFja2FnZXRyYW5zZm9ybWVyLk9uYXBWbmZQYWNrYWdlQnVpbGRlcg==", Base64.getEncoder().encodeToString(OnapVnfPackageBuilder.class.getCanonicalName().getBytes()));
     }
 
 
 
 import org.mockito.Mockito;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.CbamVnfPackageBuilder;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.CbamVnfdBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfdBuilder;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapR1VnfdBuilder;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.TestUtil;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
 import org.springframework.http.HttpHeaders;
 
     private void verifyVnfPackageWritterToOutputStream(ByteArrayOutputStream bos) throws Exception {
         String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
-        String expectedOnapVnfd = new OnapVnfdBuilder().toOnapVnfd(cbamVnfd);
+        String expectedOnapVnfd = new OnapR1VnfdBuilder().toOnapVnfd(cbamVnfd);
         assertFileInZip(bos.toByteArray(), "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
         assertFileInZip(bos.toByteArray(), "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
         assertFileInZip(bos.toByteArray(), "MainServiceTemplate.mf", TestUtil.loadFile("MainServiceTemplate.mf"));
         }
     }
 
+    /**
+     * error is propagated if unable to extract version from HTTP request
+     */
+    @Test
+    public void testUnableToExtractVersion() throws Exception {
+        IOException expectedException = new IOException();
+        Part part = Mockito.mock(Part.class);
+        when(part.getInputStream()).thenReturn(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip")));
+        when(httpRequest.getPart("fileToUpload")).thenReturn(part);
+        when(httpRequest.getPart("version")).thenThrow(expectedException);
+        when(part.getInputStream()).thenReturn(new ByteArrayInputStream("V1".getBytes()));
+        try {
+            converterApi.convert(httpResponse, httpRequest);
+            fail();
+        } catch (Exception e) {
+            verify(logger).error("Unable to determine the desired ONAP package version", expectedException);
+            assertEquals("Unable to determine the desired ONAP package version", e.getMessage());
+            assertEquals(expectedException, e.getCause());
+        }
+    }
+
     /**
      * error is propagated if unable to extract package from HTTP request
      */
 
 # See the License for the specific language governing permissions and
 # limitations under the License.
 ###############################################################################
-
 server.error.whitelabel.enabled=false
-
 ###############################################################################
 # Beginning  of mandatory properties                                          #
 ###############################################################################
 trustedCertificates=
 # the identifier of the VNFM in A&AI core system registry
 vnfmId=7c267318-2a6a-4d47-b039-a7cce5fea38b
-
 ###############################################################################
 # Configuration parameters for direct integration
 ###############################################################################
 sdcUsername=SDC
 #The password to access SDC
 sdcPassword=SDC
-
 ###############################################################################
 # End of mandatory properties for driver                                      #
 ###############################################################################
 
 # See the License for the specific language governing permissions and
 # limitations under the License.
 ###############################################################################
-
 server.error.whitelabel.enabled=false
-
 ###############################################################################
 # Beginning of mandatory properties                                           #
 ###############################################################################
 trustedCertificates=
 # the identifier of the VNFM in A&AI core system registry
 vnfmId=53fbba58-464e-4cc4-8d33-aaaf072f0a27
-
 ###############################################################################
 # Configuration parameters for direct integration
 ###############################################################################
 sdcUsername=SDC
 #The password to access SDC
 sdcPassword=SDC
-
 ###############################################################################
 # End of mandatory properties for driver                                      #
 ###############################################################################
 
       Basic:
         instantiate:
         terminate:
+    capabilities:
+      deployment_flavour:
+        properties:
+          flavour_id: myFlavorId
+          description: myFlavorDescription
 
       properties:
         connectivity_type:
           layer_protocol: ipv4
-          flow_pattern: mesh
         description: myDescription
 
     icpWithOutEcp:
 
       properties:
         connectivity_type:
           layer_protocol: [ ipv4 ]
-          flow_pattern: mesh
         vl_profile:
           max_bit_rate_requirements:
             root: 2147483647