diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java
index 110fc6c..84ff054 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java
@@ -26,6 +26,7 @@
 import javax.xml.bind.annotation.XmlElement;
 import org.onap.so.adapters.requestsdb.exceptions.MsoRequestsDbException;
 import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.db.request.beans.InstanceNfvoMapping;
 import org.onap.so.db.request.beans.ResourceOperationStatus;
 
 /**
@@ -55,6 +56,20 @@
             throws MsoRequestsDbException;
 
     @WebMethod
+    public void setInstanceNfvoMappingRepository(
+            @WebParam(name = "instanceId") @XmlElement(required = true) String instanceId,
+            @WebParam(name = "nfvoName") @XmlElement(required = true) String nfvoName,
+            @WebParam(name = "endpoint") @XmlElement(required = true) String endpoint,
+            @WebParam(name = "username") @XmlElement(required = true) String username,
+            @WebParam(name = "password") @XmlElement(required = true) String password,
+            @WebParam(name = "apiRoot") @XmlElement(required = false) String apiRoot) throws MsoRequestsDbException;
+
+    @WebMethod
+    public InstanceNfvoMapping getInstanceNfvoMapping(
+            @WebParam(name = "instanceId") @XmlElement(required = true) String instanceId)
+            throws MsoRequestsDbException;
+
+    @WebMethod
     public InfraActiveRequests getInfraRequest(
             @WebParam(name = "requestId") @XmlElement(required = true) String requestId) throws MsoRequestsDbException;
 
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
index 085a255..052a53b 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
@@ -31,12 +31,14 @@
 import org.onap.so.db.request.beans.InfraActiveRequests;
 import org.onap.so.db.request.beans.OperationStatus;
 import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.beans.InstanceNfvoMapping;
 import org.onap.so.db.request.beans.ResourceOperationStatusId;
 import org.onap.so.db.request.beans.SiteStatus;
 import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository;
 import org.onap.so.db.request.data.repository.OperationStatusRepository;
 import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
 import org.onap.so.db.request.data.repository.SiteStatusRepository;
+import org.onap.so.db.request.data.repository.InstanceNfvoMappingRepository;
 import org.onap.so.logger.ErrorCode;
 import org.onap.so.requestsdb.RequestsDbConstant;
 import org.slf4j.Logger;
@@ -59,6 +61,9 @@
     private InfraActiveRequestsRepository infraActive;
 
     @Autowired
+    private InstanceNfvoMappingRepository instanceNfvoMappingRepository;
+
+    @Autowired
     private SiteStatusRepository siteRepo;
 
     @Autowired
@@ -69,6 +74,40 @@
 
     @Transactional
     @Override
+    public void setInstanceNfvoMappingRepository(String instanceId, String nfvoName, String endpoint, String username,
+            String password, String apiRoot) {
+        InstanceNfvoMapping instanceNfvoMapping = new InstanceNfvoMapping();
+        if (apiRoot != null) {
+            instanceNfvoMapping.setApiRoot(apiRoot);
+        }
+        if (endpoint != null) {
+            instanceNfvoMapping.setEndpoint(endpoint);
+        }
+        if (instanceId != null) {
+            instanceNfvoMapping.setInstanceId(instanceId);
+        }
+        if (nfvoName != null) {
+            instanceNfvoMapping.setNfvoName(nfvoName);
+        }
+        if (username != null) {
+            instanceNfvoMapping.setUsername(username);
+        }
+        if (password != null) {
+            instanceNfvoMapping.setPassword(password);
+        }
+
+        instanceNfvoMappingRepository.save(instanceNfvoMapping);
+    }
+
+    @Transactional
+    @Override
+    public InstanceNfvoMapping getInstanceNfvoMapping(String instanceId) {
+        InstanceNfvoMapping instanceNfvoMapping = instanceNfvoMappingRepository.findOneByInstanceId(instanceId);
+        return instanceNfvoMapping;
+    }
+
+    @Transactional
+    @Override
     public void updateInfraRequest(String requestId, String lastModifiedBy, String statusMessage, String responseBody,
             RequestStatusType requestStatus, String progress, String vnfOutputs, String serviceInstanceId,
             String networkId, String vnfId, String vfModuleId, String volumeGroupId, String serviceInstanceName,
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.1.1__Add_Instance_NFVO_Mapping_Table.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.1.1__Add_Instance_NFVO_Mapping_Table.sql
new file mode 100644
index 0000000..165a9b3
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.1.1__Add_Instance_NFVO_Mapping_Table.sql
@@ -0,0 +1,12 @@
+use requestdb;
+
+CREATE TABLE `instance_nfvo_mapping` (
+  `INSTANCE_ID` varchar(256) NOT NULL,
+  `NFVO_NAME` varchar(256) DEFAULT NULL,
+  `ENDPOINT` varchar(256) DEFAULT NULL,
+  `USERNAME` varchar(256) DEFAULT NULL,
+  `PASSWORD` varchar(256) DEFAULT NULL,
+  `API_ROOT` varchar(256) DEFAULT NULL,
+  `JOB_ID` varchar(256) DEFAULT NULL,
+  PRIMARY KEY (`INSTANCE_ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
\ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
index fef9dbc..9ded5b4 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
@@ -39,8 +39,10 @@
 import org.onap.so.db.request.beans.InfraActiveRequests;
 import org.onap.so.db.request.beans.OperationStatus;
 import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.beans.InstanceNfvoMapping;
 import org.onap.so.db.request.data.repository.OperationStatusRepository;
 import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.onap.so.db.request.data.repository.InstanceNfvoMappingRepository;
 import org.onap.so.requestsdb.RequestsDbConstant;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.web.server.LocalServerPort;
@@ -58,6 +60,9 @@
     @Autowired
     private ResourceOperationStatusRepository resourceOperationStatusRepo;
 
+    @Autowired
+    private InstanceNfvoMappingRepository instanceNfvoMappingRepository;
+
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
@@ -257,6 +262,29 @@
     }
 
     @Test
+    public void setInstanceNfvoMappingRepository() throws MsoRequestsDbException {
+        InstanceNfvoMapping instanceNfvoMapping = new InstanceNfvoMapping();
+        String instanceId = "9b9f02c0-298b-458a-bc9c-be3692e4f354";
+        String nfvoName = "testNFVO";
+        String endpoint = "http://127.0.0.1:80/";
+        String username = "admin";
+        String password = "admin";
+        String apiRoot = "v1";
+
+        instanceNfvoMapping.setApiRoot(apiRoot);
+        instanceNfvoMapping.setEndpoint(endpoint);
+        instanceNfvoMapping.setInstanceId(instanceId);
+        instanceNfvoMapping.setNfvoName(nfvoName);
+        instanceNfvoMapping.setUsername(username);
+        instanceNfvoMapping.setPassword(password);
+
+        dbAdapter.setInstanceNfvoMappingRepository(instanceId, nfvoName, endpoint, username, password, apiRoot);
+        InstanceNfvoMapping dbInstNfvoMap = dbAdapter.getInstanceNfvoMapping(instanceId);
+        assertThat(dbInstNfvoMap, sameBeanAs(instanceNfvoMapping));
+    }
+
+
+    @Test
     public void updateServiceOperation() throws MsoRequestsDbException {
         String serviceId = "serviceid";
         String operationId = "operationid";
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/constant/CommonConstant.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/constant/CommonConstant.java
index 04c6749..51a0fc0 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/constant/CommonConstant.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/constant/CommonConstant.java
@@ -33,17 +33,32 @@
     public static final String STR_EMPTY = "";
 
     public static final String NFVO_CREATE_URL = "/api/nslcm/v1/ns";
+    public static final String SOL005_NFVO_CREATE_URL = "/api/nslcm/v1/ns_instances";
 
     public static final String NFVO_INSTANTIATE_URL = "/api/nslcm/v1/ns/%s/instantiate";
+    public static final String SOL005_NFVO_INSTANTIATE_URL = "/api/nslcm/v1/ns_instances/%s/instantiate";
 
     public static final String NFVO_TERMINATE_URL = "/api/nslcm/v1/ns/%s/terminate";
+    public static final String SOL005_NFVO_TERMINATE_URL = "/api/nslcm/v1/ns_instances/%s/terminate";
 
     public static final String NFVO_DELETE_URL = "/api/nslcm/v1/ns/%s";
+    public static final String SOL005_NFVO_DELETE_URL = "/api/nslcm/v1/ns_instances/%s";
 
     public static final String NFVO_QUERY_URL = "/api/nslcm/v1/jobs/%s";
+    public static final String SOL005_NFVO_QUERY_URL = "/api/nslcm/v1/ns_lcm_op_occs/%s";
 
     public static final String NFVO_SCALE_URL = "/api/nslcm/v1/ns/%s/scale";
 
+    public enum operationState {
+        PROCESSING, COMPLETED, PARTIALLY_COMPLETED, FAILED_TEMP, FAILED, ROLLING_BACK, ROLLED_BACK
+    }
+    public enum lcmOperationType {
+        INSTANTIATE, SCALE, UPDATE, TERMINATE, HEAL
+    };
+    public enum cancelMode {
+        GRACEFUL, FORCEFUL
+    };
+
     /**
      * 
      * <br>
@@ -107,8 +122,11 @@
     public static final String DESC = "description";
 
     public static final String NS_INSTANCE_ID = "nsInstanceId";
+    public static final String SOL005_NS_INSTANCE_ID = "id";
+
 
     public static final String JOB_ID = "jobId";
+    public static final String JOB_URI = "Location";
 
     public static final String ADDITIONAL_PARAM_FOR_NS = "additionalParamForNs";
 
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AddPnfData.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AddPnfData.java
new file mode 100644
index 0000000..d312501
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AddPnfData.java
@@ -0,0 +1,68 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class AddPnfData {
+    private String pnfId;
+    private String pnfName;
+    private String pnfdId;
+    private String pnfProfileId;
+    private List<PnfExtCpData> cpData;
+
+    /***
+     *
+     * @return id of pnf
+     */
+    public String getPnfId() {
+        return pnfId;
+    }
+
+    public void setPnfId(String pnfId) {
+        this.pnfId = pnfId;
+    }
+
+    public String getPnfName() {
+        return pnfName;
+    }
+
+    public void setPnfName(String pnfName) {
+        this.pnfName = pnfName;
+    }
+
+    public String getPnfdId() {
+        return pnfdId;
+    }
+
+    public void setPnfdId(String pnfdId) {
+        this.pnfdId = pnfdId;
+    }
+
+    public String getPnfProfileId() {
+        return pnfProfileId;
+    }
+
+    public void setPnfProfileId(String pnfProfileId) {
+        this.pnfProfileId = pnfProfileId;
+    }
+
+    public List<PnfExtCpData> getCpData() {
+        return cpData;
+    }
+
+    public void setCpData(List<PnfExtCpData> cpData) {
+        this.cpData = cpData;
+    }
+}
+
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AddressRange.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AddressRange.java
new file mode 100644
index 0000000..9f357a5
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AddressRange.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class AddressRange {
+    private String minAddress;
+    private String maxAddress;
+
+    public String getMinAddress() {
+        return minAddress;
+    }
+
+    public void setMinAddress(String minAddress) {
+        this.minAddress = minAddress;
+    }
+
+    public String getMaxAddress() {
+        return maxAddress;
+    }
+
+    public void setMaxAddress(String maxAddress) {
+        this.maxAddress = maxAddress;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedNs.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedNs.java
new file mode 100644
index 0000000..fa502f3
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedNs.java
@@ -0,0 +1,40 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class AffectedNs {
+    private String nsInstanceId;
+    private String nsdId;
+
+    private enum changeType {
+        ADD, REMOVE, INSTANTIATE, TERMINATE, SCALE, UPDATE, HEAL
+    }
+    private enum changeResult {
+        COMPLETED, ROLLED_BACK, FAILED, PARTIALLY_COMPLETED
+    }
+
+    public String getNsInstanceId() {
+        return nsInstanceId;
+    }
+
+    public void setNsInstanceId(String nsInstanceId) {
+        this.nsInstanceId = nsInstanceId;
+    }
+
+    public String getNsdId() {
+        return nsdId;
+    }
+
+    public void setNsdId(String nsdId) {
+        this.nsdId = nsdId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedPnf.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedPnf.java
new file mode 100644
index 0000000..9d98e1c
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedPnf.java
@@ -0,0 +1,67 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class AffectedPnf {
+    private String pnfid;
+    private String pnfdid;
+    private String pnfProfileId;
+    private String pnfName;
+    private String cpInstanceId;
+
+    private enum changeType {
+        ADD, REMOVE, MODIFY
+    }
+    private enum changeResult {
+        COMPLETED, ROLLED_BACK, FAILED
+    }
+
+    public String getPnfid() {
+        return pnfid;
+    }
+
+    public void setPnfid(String pnfid) {
+        this.pnfid = pnfid;
+    }
+
+    public String getPnfdid() {
+        return pnfdid;
+    }
+
+    public void setPnfdid(String pnfdid) {
+        this.pnfdid = pnfdid;
+    }
+
+    public String getPnfProfileId() {
+        return pnfProfileId;
+    }
+
+    public void setPnfProfileId(String pnfProfileId) {
+        this.pnfProfileId = pnfProfileId;
+    }
+
+    public String getPnfName() {
+        return pnfName;
+    }
+
+    public void setPnfName(String pnfName) {
+        this.pnfName = pnfName;
+    }
+
+    public String getCpInstanceId() {
+        return cpInstanceId;
+    }
+
+    public void setCpInstanceId(String cpInstanceId) {
+        this.cpInstanceId = cpInstanceId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedSap.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedSap.java
new file mode 100644
index 0000000..62f4f92
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedSap.java
@@ -0,0 +1,49 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class AffectedSap {
+    private String sapInstanceId;
+    private String sapdId;
+    private String sapName;
+
+    private enum changeType {
+        ADD, REMOVE, MODIFY
+    }
+    private enum changeResult {
+        COMPLETED, ROLLED_BACK, FAILED
+    }
+
+    public String getSapInstanceId() {
+        return sapInstanceId;
+    }
+
+    public void setSapInstanceId(String sapInstanceId) {
+        this.sapInstanceId = sapInstanceId;
+    }
+
+    public String getSapdId() {
+        return sapdId;
+    }
+
+    public void setSapdId(String sapdId) {
+        this.sapdId = sapdId;
+    }
+
+    public String getSapName() {
+        return sapName;
+    }
+
+    public void setSapName(String sapName) {
+        this.sapName = sapName;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVirtualLink.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVirtualLink.java
new file mode 100644
index 0000000..ecaa1c5
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVirtualLink.java
@@ -0,0 +1,49 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class AffectedVirtualLink {
+    private String nsVirtualLinkInstanceId;
+    private String nsVirtualLinkDescId;
+    private String vlProfileId;
+
+    private enum changeType {
+        ADD, DELETE, MODIFY, ADD_LINK_PORT, REMOVE_LINK_PORT
+    };
+    private enum changeResult {
+        COMPLETED, ROLLED_BACK, FAILED
+    }
+
+    public String getNsVirtualLinkInstanceId() {
+        return nsVirtualLinkInstanceId;
+    }
+
+    public void setNsVirtualLinkInstanceId(String nsVirtualLinkInstanceId) {
+        this.nsVirtualLinkInstanceId = nsVirtualLinkInstanceId;
+    }
+
+    public String getNsVirtualLinkDescId() {
+        return nsVirtualLinkDescId;
+    }
+
+    public void setNsVirtualLinkDescId(String nsVirtualLinkDescId) {
+        this.nsVirtualLinkDescId = nsVirtualLinkDescId;
+    }
+
+    public String getVlProfileId() {
+        return vlProfileId;
+    }
+
+    public void setVlProfileId(String vlProfileId) {
+        this.vlProfileId = vlProfileId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVnf.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVnf.java
new file mode 100644
index 0000000..6463c7a
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVnf.java
@@ -0,0 +1,78 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class AffectedVnf {
+    private String vnfInstanceId;
+    private String vnfdId;
+    private String vnfProfileId;
+    private String vnfName;
+
+    private enum changeType {
+        ADD,
+        REMOVE,
+        INSTANTIATE,
+        TERMINATE,
+        SCALE,
+        CHANGE_FLAVOUR,
+        HEAL,
+        OPERATE,
+        MODIFY_INFORMATION,
+        CHANGE_EXTERNAL_VNF_CONNECTIVITY
+    };
+    private enum changeResult {
+        COMPLETED, ROLLED_BACK, FAILED
+    }
+
+    private ChangedInfo changedInfo;
+
+
+    public String getVnfInstanceId() {
+        return vnfInstanceId;
+    }
+
+    public void setVnfInstanceId(String vnfInstanceId) {
+        this.vnfInstanceId = vnfInstanceId;
+    }
+
+    public String getVnfdId() {
+        return vnfdId;
+    }
+
+    public void setVnfdId(String vnfdId) {
+        this.vnfdId = vnfdId;
+    }
+
+    public String getVnfProfileId() {
+        return vnfProfileId;
+    }
+
+    public void setVnfProfileId(String vnfProfileId) {
+        this.vnfProfileId = vnfProfileId;
+    }
+
+    public String getVnfName() {
+        return vnfName;
+    }
+
+    public void setVnfName(String vnfName) {
+        this.vnfName = vnfName;
+    }
+
+    public ChangedInfo getChangedInfo() {
+        return changedInfo;
+    }
+
+    public void setChangedInfo(ChangedInfo changedInfo) {
+        this.changedInfo = changedInfo;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVnffg.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVnffg.java
new file mode 100644
index 0000000..04e9481
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffectedVnffg.java
@@ -0,0 +1,40 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class AffectedVnffg {
+    private String vnffgInstanceId;
+    private String vnffgdId;
+
+    private enum changeType {
+        ADD, REMOVE, MODIFY
+    }
+    private enum changeResult {
+        COMPLETED, ROLLED_BACK, FAILED
+    }
+
+    public String getVnffgInstanceId() {
+        return vnffgInstanceId;
+    }
+
+    public void setVnffgInstanceId(String vnffgInstanceId) {
+        this.vnffgInstanceId = vnffgInstanceId;
+    }
+
+    public String getVnffgdId() {
+        return vnffgdId;
+    }
+
+    public void setVnffgdId(String vnffgdId) {
+        this.vnffgdId = vnffgdId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRule.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRule.java
new file mode 100644
index 0000000..7f019bc
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRule.java
@@ -0,0 +1,51 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class AffinityOrAntiAffinityRule {
+    private String vnfdId;
+    private List<String> vnfProfileId;
+    private List<String> vnfInstanceId;
+
+    private enum affinityOrAntiAffiinty {
+        AFFINITY, ANTI_AFFIINTY
+    };
+    private enum scope {
+        NFVI_POP, ZONE, ZONE_GROUP, NFVI_NODE
+    };
+
+    public String getVnfdId() {
+        return vnfdId;
+    }
+
+    public void setVnfdId(String vnfdId) {
+        this.vnfdId = vnfdId;
+    }
+
+    public List<String> getVnfProfileId() {
+        return vnfProfileId;
+    }
+
+    public void setVnfProfileId(List<String> vnfProfileId) {
+        this.vnfProfileId = vnfProfileId;
+    }
+
+    public List<String> getVnfInstanceId() {
+        return vnfInstanceId;
+    }
+
+    public void setVnfInstanceId(List<String> vnfInstanceId) {
+        this.vnfInstanceId = vnfInstanceId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ChangedInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ChangedInfo.java
new file mode 100644
index 0000000..5de6cbf
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ChangedInfo.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class ChangedInfo {
+    private ModifyVnfInfoData changedVnfInfo;
+    private ExtVirtualLinkInfo changedExtConnectivity;
+
+    public ModifyVnfInfoData getChangedVnfInfo() {
+        return changedVnfInfo;
+    }
+
+    public void setChangedVnfInfo(ModifyVnfInfoData changedVnfInfo) {
+        this.changedVnfInfo = changedVnfInfo;
+    }
+
+    public ExtVirtualLinkInfo getChangedExtConnectivity() {
+        return changedExtConnectivity;
+    }
+
+    public void setChangedExtConnectivity(ExtVirtualLinkInfo changedExtConnectivity) {
+        this.changedExtConnectivity = changedExtConnectivity;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CivicAddressElement.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CivicAddressElement.java
new file mode 100644
index 0000000..2a63d39
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CivicAddressElement.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class CivicAddressElement {
+    private int caType;
+    private String caValue;
+
+    public int getCaType() {
+        return caType;
+    }
+
+    public void setCaType(int caType) {
+        this.caType = caType;
+    }
+
+    public String getCaValue() {
+        return caValue;
+    }
+
+    public void setCaValue(String caValue) {
+        this.caValue = caValue;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CpProtocolData.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CpProtocolData.java
new file mode 100644
index 0000000..27272ea
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CpProtocolData.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class CpProtocolData {
+    private String layerProtocol;
+    private IpOverEthernetAddressData ipOverEthernet;
+
+    public String getLayerProtocol() {
+        return layerProtocol;
+    }
+
+    public void setLayerProtocol(String layerProtocol) {
+        this.layerProtocol = layerProtocol;
+    }
+
+    public IpOverEthernetAddressData getIpOverEthernet() {
+        return ipOverEthernet;
+    }
+
+    public void setIpOverEthernet(IpOverEthernetAddressData ipOverEthernet) {
+        this.ipOverEthernet = ipOverEthernet;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CpProtocolInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CpProtocolInfo.java
new file mode 100644
index 0000000..5f1191e
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CpProtocolInfo.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+
+public class CpProtocolInfo {
+    @NotNull
+    private enum layerProtocol {
+        IP_OVER_ETHERNET
+    };
+
+    private IpOverEthernetAddressData ipOverEthernet;
+
+    public IpOverEthernetAddressData getIpOverEthernet() {
+        return ipOverEthernet;
+    }
+
+    public void setIpOverEthernet(IpOverEthernetAddressData ipOverEthernet) {
+        this.ipOverEthernet = ipOverEthernet;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CreateNsRequest.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CreateNsRequest.java
new file mode 100644
index 0000000..878ce60
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/CreateNsRequest.java
@@ -0,0 +1,53 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class CreateNsRequest {
+
+    String nsdId;
+
+    String nsName;
+
+    String nsDescription;
+
+
+    public String getNsdId() {
+        return nsdId;
+    }
+
+    public void setNsdId(String nsdId) {
+        this.nsdId = nsdId;
+    }
+
+    public String getNsDescription() {
+        return nsDescription;
+    }
+
+    public void setNsDescription(String nsDescription) {
+        this.nsDescription = nsDescription;
+    }
+
+    /**
+     * @return Returns the nsName.
+     */
+    public String getNsName() {
+        return nsName;
+    }
+
+    /**
+     * @param nsName The nsName to set.
+     */
+    public void setNsName(String nsName) {
+        this.nsName = nsName;
+    }
+
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtCpInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtCpInfo.java
new file mode 100644
index 0000000..63ca66b
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtCpInfo.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class ExtCpInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String cpdId;
+    private List<CpProtocolData> cpProtocolInfo;
+    private List<String> extLinkPortId;
+
+
+
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfo.java
new file mode 100644
index 0000000..a1ab3fd
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfo.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class ExtLinkPortInfo {
+    private String id;
+    private ResourceHandle resourceHandle;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public ResourceHandle getResourceHandle() {
+        return resourceHandle;
+    }
+
+    public void setResourceHandle(ResourceHandle resourceHandle) {
+        this.resourceHandle = resourceHandle;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtManagedVirtualLinkInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtManagedVirtualLinkInfo.java
new file mode 100644
index 0000000..3f643a8
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtManagedVirtualLinkInfo.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class ExtManagedVirtualLinkInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String vnfVirtualLinkDescId;
+    @NotNull
+    private ResourceHandle networkResource;
+    private List<VnfLinkPortInfo> vnfLinkPorts;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getVnfVirtualLinkDescId() {
+        return vnfVirtualLinkDescId;
+    }
+
+    public void setVnfVirtualLinkDescId(String vnfVirtualLinkDescId) {
+        this.vnfVirtualLinkDescId = vnfVirtualLinkDescId;
+    }
+
+    public ResourceHandle getNetworkResource() {
+        return networkResource;
+    }
+
+    public void setNetworkResource(ResourceHandle networkResource) {
+        this.networkResource = networkResource;
+    }
+
+    public List<VnfLinkPortInfo> getVnfLinkPorts() {
+        return vnfLinkPorts;
+    }
+
+    public void setVnfLinkPorts(List<VnfLinkPortInfo> vnfLinkPorts) {
+        this.vnfLinkPorts = vnfLinkPorts;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfo.java
new file mode 100644
index 0000000..ce7d1cf
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfo.java
@@ -0,0 +1,42 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class ExtVirtualLinkInfo {
+    private String id;
+    private ResourceHandle resourceHandle;
+    private ExtLinkPortInfo extLinkPorts;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public ResourceHandle getResourceHandle() {
+        return resourceHandle;
+    }
+
+    public void setResourceHandle(ResourceHandle resourceHandle) {
+        this.resourceHandle = resourceHandle;
+    }
+
+    public ExtLinkPortInfo getExtLinkPorts() {
+        return extLinkPorts;
+    }
+
+    public void setExtLinkPorts(ExtLinkPortInfo extLinkPorts) {
+        this.extLinkPorts = extLinkPorts;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiateNsRequest.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiateNsRequest.java
new file mode 100644
index 0000000..ff0730a
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiateNsRequest.java
@@ -0,0 +1,207 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class InstantiateNsRequest {
+
+    private String nsFlavourId;
+    private List<SapData> sapData;
+    private List<AddPnfData> addpnfData;
+    private List<VnfInstanceData> vnfInstanceData;
+    private List<String> nestedNsInstanceId;
+    private List<VnfLocationConstraint> localizationLanguage;
+    private Map<String, Object> aditionalParamsForNs;
+    private List<ParamsForVnf> additionalParamsForVnf;
+    private String startTime;
+    private String nsInstantiationLevelId;
+    private List<AffinityOrAntiAffinityRule> additionalAffinityOrAntiAffiniityRule;
+
+    /***
+     *
+     * @return nsFlavourId
+     */
+    public String getNsFlavourId() {
+        return nsFlavourId;
+    }
+
+    /***
+     *
+     * @param nsFlavourId
+     */
+    public void setNsFlavourId(String nsFlavourId) {
+        this.nsFlavourId = nsFlavourId;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public List<SapData> getSapData() {
+        return sapData;
+    }
+
+    /***
+     *
+     * @param sapData
+     */
+    public void setSapData(List<SapData> sapData) {
+        this.sapData = sapData;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public List<AddPnfData> getAddpnfData() {
+        return addpnfData;
+    }
+
+    /***
+     *
+     * @param addpnfData
+     */
+    public void setAddpnfData(List<AddPnfData> addpnfData) {
+        this.addpnfData = addpnfData;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public List<VnfInstanceData> getVnfInstanceData() {
+        return vnfInstanceData;
+    }
+
+    /***
+     *
+     * @param vnfInstanceData
+     */
+    public void setVnfInstanceData(List<VnfInstanceData> vnfInstanceData) {
+        this.vnfInstanceData = vnfInstanceData;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public List<String> getNestedNsInstanceId() {
+        return nestedNsInstanceId;
+    }
+
+    /***
+     *
+     * @param nestedNsInstanceId
+     */
+    public void setNestedNsInstanceId(List<String> nestedNsInstanceId) {
+        this.nestedNsInstanceId = nestedNsInstanceId;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public List<VnfLocationConstraint> getLocalizationLanguage() {
+        return localizationLanguage;
+    }
+
+    /***
+     *
+     * @param localizationLanguage
+     */
+    public void setLocalizationLanguage(List<VnfLocationConstraint> localizationLanguage) {
+        this.localizationLanguage = localizationLanguage;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public Map<String, Object> getAditionalParamsForNs() {
+        return aditionalParamsForNs;
+    }
+
+    /***
+     *
+     * @param aditionalParamsForNs
+     */
+    public void setAditionalParamsForNs(Map<String, Object> aditionalParamsForNs) {
+        this.aditionalParamsForNs = aditionalParamsForNs;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public List<ParamsForVnf> getAdditionalParamsForVnf() {
+        return additionalParamsForVnf;
+    }
+
+    /***
+     *
+     * @param additionalParamsForVnf
+     */
+    public void setAdditionalParamsForVnf(List<ParamsForVnf> additionalParamsForVnf) {
+        this.additionalParamsForVnf = additionalParamsForVnf;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public String getStartTime() {
+        return startTime;
+    }
+
+    /***
+     *
+     * @param startTime
+     */
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public String getNsInstantiationLevelId() {
+        return nsInstantiationLevelId;
+    }
+
+    /***
+     *
+     * @param nsInstantiationLevelId
+     */
+    public void setNsInstantiationLevelId(String nsInstantiationLevelId) {
+        this.nsInstantiationLevelId = nsInstantiationLevelId;
+    }
+
+    /***
+     *
+     * @return
+     */
+    public List<AffinityOrAntiAffinityRule> getAdditionalAffinityOrAntiAffiniityRule() {
+        return additionalAffinityOrAntiAffiniityRule;
+    }
+
+    /***
+     *
+     * @param additionalAffinityOrAntiAffiniityRule
+     */
+    public void setAdditionalAffinityOrAntiAffiniityRule(
+            List<AffinityOrAntiAffinityRule> additionalAffinityOrAntiAffiniityRule) {
+        this.additionalAffinityOrAntiAffiniityRule = additionalAffinityOrAntiAffiniityRule;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiatedVnfInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiatedVnfInfo.java
new file mode 100644
index 0000000..83a8a56
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiatedVnfInfo.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+import java.util.Map;
+
+public class InstantiatedVnfInfo {
+    @NotNull
+    private String flavourId;
+    @NotNull
+    private String vnfState;
+    private List<VnfScaleInfo> vnfScaleInfos;
+    @NotNull
+    private List<ExtCpInfo> extCpInfo;
+    private List<ExtVirtualLinkInfo> extVirtualLinkInfo;
+    private List<ExtManagedVirtualLinkInfo> extManagedVirtualLinkInfo;
+    // Defination of MonitoringParameter is not there in ETSI document
+    // considering as String
+    private List<String> monitoringParameters;
+    private String localizationLanguage;
+
+    private List<VnfcResourceInfo> vnfcResourceInfo;
+    // Defination of VirtualStorageResourceInfo is not there in ETSI document
+    // considering as String
+    private List<String> virtualStorageResourceInfo;
+
+    public String getFlavourId() {
+        return flavourId;
+    }
+
+    public void setFlavourId(String flavourId) {
+        this.flavourId = flavourId;
+    }
+
+    public String getVnfState() {
+        return vnfState;
+    }
+
+    public void setVnfState(String vnfState) {
+        this.vnfState = vnfState;
+    }
+
+    public List<VnfScaleInfo> getVnfScaleInfos() {
+        return vnfScaleInfos;
+    }
+
+    public void setVnfScaleInfos(List<VnfScaleInfo> vnfScaleInfos) {
+        this.vnfScaleInfos = vnfScaleInfos;
+    }
+
+    public List<ExtCpInfo> getExtCpInfo() {
+        return extCpInfo;
+    }
+
+    public void setExtCpInfo(List<ExtCpInfo> extCpInfo) {
+        this.extCpInfo = extCpInfo;
+    }
+
+    public List<ExtVirtualLinkInfo> getExtVirtualLinkInfo() {
+        return extVirtualLinkInfo;
+    }
+
+    public void setExtVirtualLinkInfo(List<ExtVirtualLinkInfo> extVirtualLinkInfo) {
+        this.extVirtualLinkInfo = extVirtualLinkInfo;
+    }
+
+    public List<ExtManagedVirtualLinkInfo> getExtManagedVirtualLinkInfo() {
+        return extManagedVirtualLinkInfo;
+    }
+
+    public void setExtManagedVirtualLinkInfo(List<ExtManagedVirtualLinkInfo> extManagedVirtualLinkInfo) {
+        this.extManagedVirtualLinkInfo = extManagedVirtualLinkInfo;
+    }
+
+    public List<String> getMonitoringParameters() {
+        return monitoringParameters;
+    }
+
+    public void setMonitoringParameters(List<String> monitoringParameters) {
+        this.monitoringParameters = monitoringParameters;
+    }
+
+    public String getLocalizationLanguage() {
+        return localizationLanguage;
+    }
+
+    public void setLocalizationLanguage(String localizationLanguage) {
+        this.localizationLanguage = localizationLanguage;
+    }
+
+    public List<VnfcResourceInfo> getVnfcResourceInfo() {
+        return vnfcResourceInfo;
+    }
+
+    public void setVnfcResourceInfo(List<VnfcResourceInfo> vnfcResourceInfo) {
+        this.vnfcResourceInfo = vnfcResourceInfo;
+    }
+
+    public List<String> getVirtualStorageResourceInfo() {
+        return virtualStorageResourceInfo;
+    }
+
+    public void setVirtualStorageResourceInfo(List<String> virtualStorageResourceInfo) {
+        this.virtualStorageResourceInfo = virtualStorageResourceInfo;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/IpAddresses.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/IpAddresses.java
new file mode 100644
index 0000000..32c5571
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/IpAddresses.java
@@ -0,0 +1,63 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class IpAddresses {
+    private String type;
+    private List<String> fixedAddresses;
+    private int numDynamicAddresses;
+    private AddressRange addressRange;
+    private String subnetId;
+
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public List<String> getFixedAddresses() {
+        return fixedAddresses;
+    }
+
+    public void setFixedAddresses(List<String> fixedAddresses) {
+        this.fixedAddresses = fixedAddresses;
+    }
+
+    public int getNumDynamicAddresses() {
+        return numDynamicAddresses;
+    }
+
+    public void setNumDynamicAddresses(int numDynamicAddresses) {
+        this.numDynamicAddresses = numDynamicAddresses;
+    }
+
+    public AddressRange getAddressRange() {
+        return addressRange;
+    }
+
+    public void setAddressRange(AddressRange addressRange) {
+        this.addressRange = addressRange;
+    }
+
+    public String getSubnetId() {
+        return subnetId;
+    }
+
+    public void setSubnetId(String subnetId) {
+        this.subnetId = subnetId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressData.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressData.java
new file mode 100644
index 0000000..48529e5
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressData.java
@@ -0,0 +1,35 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class IpOverEthernetAddressData {
+    private String macAddress;
+    private List<IpAddresses> ipAddresses;
+
+    public String getMacAddress() {
+        return macAddress;
+    }
+
+    public void setMacAddress(String macAddress) {
+        this.macAddress = macAddress;
+    }
+
+    public List<IpAddresses> getIpAddresses() {
+        return ipAddresses;
+    }
+
+    public void setIpAddresses(List<IpAddresses> ipAddresses) {
+        this.ipAddresses = ipAddresses;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Link.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Link.java
new file mode 100644
index 0000000..2459346
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Link.java
@@ -0,0 +1,24 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class Link {
+    private String href;
+
+    public String getHref() {
+        return href;
+    }
+
+    public void setHref(String href) {
+        this.href = href;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Links.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Links.java
new file mode 100644
index 0000000..8ad8f00
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Links.java
@@ -0,0 +1,78 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class Links {
+    private Link self;
+    private Link nsInstance;
+    private Link cancel;
+    private Link retry;
+    private Link rollback;
+    private Link continues;
+    private Link fail;
+
+    public Link getSelf() {
+        return self;
+    }
+
+    public void setSelf(Link self) {
+        this.self = self;
+    }
+
+    public Link getNsInstance() {
+        return nsInstance;
+    }
+
+    public void setNsInstance(Link nsInstance) {
+        this.nsInstance = nsInstance;
+    }
+
+    public Link getCancel() {
+        return cancel;
+    }
+
+    public void setCancel(Link cancel) {
+        this.cancel = cancel;
+    }
+
+    public Link getRetry() {
+        return retry;
+    }
+
+    public void setRetry(Link retry) {
+        this.retry = retry;
+    }
+
+    public Link getRollback() {
+        return rollback;
+    }
+
+    public void setRollback(Link rollback) {
+        this.rollback = rollback;
+    }
+
+    public Link getContinues() {
+        return continues;
+    }
+
+    public void setContinues(Link continues) {
+        this.continues = continues;
+    }
+
+    public Link getFail() {
+        return fail;
+    }
+
+    public void setFail(Link fail) {
+        this.fail = fail;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/LocationConstraints.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/LocationConstraints.java
new file mode 100644
index 0000000..b636d49
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/LocationConstraints.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class LocationConstraints {
+    private String countryCode;
+    private CivicAddressElement civicAddressElement;
+
+    public String getCountryCode() {
+        return countryCode;
+    }
+
+    public void setCountryCode(String countryCode) {
+        this.countryCode = countryCode;
+    }
+
+    public CivicAddressElement getCivicAddressElement() {
+        return civicAddressElement;
+    }
+
+    public void setCivicAddressElement(CivicAddressElement civicAddressElement) {
+        this.civicAddressElement = civicAddressElement;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Mask.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Mask.java
new file mode 100644
index 0000000..352f47e
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/Mask.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+
+public class Mask {
+    @NotNull
+    private int startingPoint;
+    @NotNull
+    private int length;
+    @NotNull
+    private String value;
+
+    public int getStartingPoint() {
+        return startingPoint;
+    }
+
+    public void setStartingPoint(int startingPoint) {
+        this.startingPoint = startingPoint;
+    }
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoData.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoData.java
new file mode 100644
index 0000000..55ab21e
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoData.java
@@ -0,0 +1,80 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.Map;
+
+public class ModifyVnfInfoData {
+    private String vnfInstanceId;
+    private String vnfInstanceName;
+    private String vnfInstanceDescription;
+    private String vnfPkgId;
+    private Map<String, Object> vnfConfigurableProperties;
+    private Map<String, Object> Metadata;
+    private Map<String, Object> Extensions;
+
+    public String getVnfInstanceId() {
+        return vnfInstanceId;
+    }
+
+    public void setVnfInstanceId(String vnfInstanceId) {
+        this.vnfInstanceId = vnfInstanceId;
+    }
+
+    public String getVnfInstanceName() {
+        return vnfInstanceName;
+    }
+
+    public void setVnfInstanceName(String vnfInstanceName) {
+        this.vnfInstanceName = vnfInstanceName;
+    }
+
+    public String getVnfInstanceDescription() {
+        return vnfInstanceDescription;
+    }
+
+    public void setVnfInstanceDescription(String vnfInstanceDescription) {
+        this.vnfInstanceDescription = vnfInstanceDescription;
+    }
+
+    public String getVnfPkgId() {
+        return vnfPkgId;
+    }
+
+    public void setVnfPkgId(String vnfPkgId) {
+        this.vnfPkgId = vnfPkgId;
+    }
+
+    public Map<String, Object> getVnfConfigurableProperties() {
+        return vnfConfigurableProperties;
+    }
+
+    public void setVnfConfigurableProperties(Map<String, Object> vnfConfigurableProperties) {
+        this.vnfConfigurableProperties = vnfConfigurableProperties;
+    }
+
+    public Map<String, Object> getMetadata() {
+        return Metadata;
+    }
+
+    public void setMetadata(Map<String, Object> metadata) {
+        Metadata = metadata;
+    }
+
+    public Map<String, Object> getExtensions() {
+        return Extensions;
+    }
+
+    public void setExtensions(Map<String, Object> extensions) {
+        Extensions = extensions;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NfpInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NfpInfo.java
new file mode 100644
index 0000000..a6e3963
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NfpInfo.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class NfpInfo {
+    @NotNull
+    private String id;
+    private String nfpdId;
+    private String nfpName;
+    private String description;
+    @NotNull
+    private List<NsCpHandle> nscpHandle;
+    private int totalCp;
+    @NotNull
+    private NfpRule nfpRule;
+
+    @NotNull
+    private enum nfpState {
+        ENABLED, DISABLED
+    };
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNfpdId() {
+        return nfpdId;
+    }
+
+    public void setNfpdId(String nfpdId) {
+        this.nfpdId = nfpdId;
+    }
+
+    public String getNfpName() {
+        return nfpName;
+    }
+
+    public void setNfpName(String nfpName) {
+        this.nfpName = nfpName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public List<NsCpHandle> getNscpHandle() {
+        return nscpHandle;
+    }
+
+    public void setNscpHandle(List<NsCpHandle> nscpHandle) {
+        this.nscpHandle = nscpHandle;
+    }
+
+    public int getTotalCp() {
+        return totalCp;
+    }
+
+    public void setTotalCp(int totalCp) {
+        this.totalCp = totalCp;
+    }
+
+    public NfpRule getNfpRule() {
+        return nfpRule;
+    }
+
+    public void setNfpRule(NfpRule nfpRule) {
+        this.nfpRule = nfpRule;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NfpRule.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NfpRule.java
new file mode 100644
index 0000000..b4f684a
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NfpRule.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class NfpRule {
+    private String etherDestinationAddress;
+    private String etherSourceAddress;
+
+    private enum etherType {
+        IPV4, IPV6
+    };
+
+    private List<String> vlanTag;
+
+    private enum protocol {
+        TCP, UDP, ICMP
+    }
+
+    private String dscp;
+    private PortRange sourcePortRange;
+    private PortRange destinationPortRange;
+    private String sourceIpAddressPrefix;
+    private String destinationIpAddressPrefix;
+    private List<Mask> extendedCriteria;
+
+    public String getEtherDestinationAddress() {
+        return etherDestinationAddress;
+    }
+
+    public void setEtherDestinationAddress(String etherDestinationAddress) {
+        this.etherDestinationAddress = etherDestinationAddress;
+    }
+
+    public String getEtherSourceAddress() {
+        return etherSourceAddress;
+    }
+
+    public void setEtherSourceAddress(String etherSourceAddress) {
+        this.etherSourceAddress = etherSourceAddress;
+    }
+
+    public List<String> getVlanTag() {
+        return vlanTag;
+    }
+
+    public void setVlanTag(List<String> vlanTag) {
+        this.vlanTag = vlanTag;
+    }
+
+    public String getDscp() {
+        return dscp;
+    }
+
+    public void setDscp(String dscp) {
+        this.dscp = dscp;
+    }
+
+    public PortRange getSourcePortRange() {
+        return sourcePortRange;
+    }
+
+    public void setSourcePortRange(PortRange sourcePortRange) {
+        this.sourcePortRange = sourcePortRange;
+    }
+
+    public PortRange getDestinationPortRange() {
+        return destinationPortRange;
+    }
+
+    public void setDestinationPortRange(PortRange destinationPortRange) {
+        this.destinationPortRange = destinationPortRange;
+    }
+
+    public String getSourceIpAddressPrefix() {
+        return sourceIpAddressPrefix;
+    }
+
+    public void setSourceIpAddressPrefix(String sourceIpAddressPrefix) {
+        this.sourceIpAddressPrefix = sourceIpAddressPrefix;
+    }
+
+    public String getDestinationIpAddressPrefix() {
+        return destinationIpAddressPrefix;
+    }
+
+    public void setDestinationIpAddressPrefix(String destinationIpAddressPrefix) {
+        this.destinationIpAddressPrefix = destinationIpAddressPrefix;
+    }
+
+    public List<Mask> getExtendedCriteria() {
+        return extendedCriteria;
+    }
+
+    public void setExtendedCriteria(List<Mask> extendedCriteria) {
+        this.extendedCriteria = extendedCriteria;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsCpHandle.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsCpHandle.java
new file mode 100644
index 0000000..326488f
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsCpHandle.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class NsCpHandle {
+    private String vnfInstanceId;
+    private String vnfExtCpInstanceId;
+    private String pnfInfoId;
+    private String pnfExtCpInstanceId;
+    private String nsInstanceId;
+    private String nsSapInstanceId;
+
+    public String getVnfInstanceId() {
+        return vnfInstanceId;
+    }
+
+    public void setVnfInstanceId(String vnfInstanceId) {
+        this.vnfInstanceId = vnfInstanceId;
+    }
+
+    public String getVnfExtCpInstanceId() {
+        return vnfExtCpInstanceId;
+    }
+
+    public void setVnfExtCpInstanceId(String vnfExtCpInstanceId) {
+        this.vnfExtCpInstanceId = vnfExtCpInstanceId;
+    }
+
+    public String getPnfInfoId() {
+        return pnfInfoId;
+    }
+
+    public void setPnfInfoId(String pnfInfoId) {
+        this.pnfInfoId = pnfInfoId;
+    }
+
+    public String getPnfExtCpInstanceId() {
+        return pnfExtCpInstanceId;
+    }
+
+    public void setPnfExtCpInstanceId(String pnfExtCpInstanceId) {
+        this.pnfExtCpInstanceId = pnfExtCpInstanceId;
+    }
+
+    public String getNsInstanceId() {
+        return nsInstanceId;
+    }
+
+    public void setNsInstanceId(String nsInstanceId) {
+        this.nsInstanceId = nsInstanceId;
+    }
+
+    public String getNsSapInstanceId() {
+        return nsSapInstanceId;
+    }
+
+    public void setNsSapInstanceId(String nsSapInstanceId) {
+        this.nsSapInstanceId = nsSapInstanceId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsInstance.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsInstance.java
new file mode 100644
index 0000000..d2d4b4e
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsInstance.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class NsInstance {
+    @NotNull
+    private String id;
+    @NotNull
+    private String nsInstanceName;
+    @NotNull
+    private String nsInstanceDescription;
+    @NotNull
+    private String nsdId;
+    @NotNull
+    private String nsdInfoId;
+    private String flavourId;
+    private List<VnfInstance> vnfInstance;
+    private List<PnfInfo> pnfInfo;
+    private List<NsVirtualLinkInfo> virtualLinkInfo;
+    private List<VnffgInfo> vnffgInfo;
+    private List<SapInfo> sapInfo;
+    private List<String> nestedNsInstanceId;
+
+    @NotNull
+    private enum nsState {
+        NOT_INSTANTIATED, INSTANTIATED
+    };
+
+    private List<NsScaleInfo> nsScaleStatus;
+    private List<AffinityOrAntiAffinityRule> additionalAffinityOrAntiAffinityRule;
+    @NotNull
+    private NsInstanceLinks _links;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNsInstanceName() {
+        return nsInstanceName;
+    }
+
+    public void setNsInstanceName(String nsInstanceName) {
+        this.nsInstanceName = nsInstanceName;
+    }
+
+    public String getNsInstanceDescription() {
+        return nsInstanceDescription;
+    }
+
+    public void setNsInstanceDescription(String nsInstanceDescription) {
+        this.nsInstanceDescription = nsInstanceDescription;
+    }
+
+    public String getNsdId() {
+        return nsdId;
+    }
+
+    public void setNsdId(String nsdId) {
+        this.nsdId = nsdId;
+    }
+
+    public String getNsdInfoId() {
+        return nsdInfoId;
+    }
+
+    public void setNsdInfoId(String nsdInfoId) {
+        this.nsdInfoId = nsdInfoId;
+    }
+
+    public String getFlavourId() {
+        return flavourId;
+    }
+
+    public void setFlavourId(String flavourId) {
+        this.flavourId = flavourId;
+    }
+
+    public List<VnfInstance> getVnfInstance() {
+        return vnfInstance;
+    }
+
+    public void setVnfInstance(List<VnfInstance> vnfInstance) {
+        this.vnfInstance = vnfInstance;
+    }
+
+    public List<PnfInfo> getPnfInfo() {
+        return pnfInfo;
+    }
+
+    public void setPnfInfo(List<PnfInfo> pnfInfo) {
+        this.pnfInfo = pnfInfo;
+    }
+
+    public List<NsVirtualLinkInfo> getVirtualLinkInfo() {
+        return virtualLinkInfo;
+    }
+
+    public void setVirtualLinkInfo(List<NsVirtualLinkInfo> virtualLinkInfo) {
+        this.virtualLinkInfo = virtualLinkInfo;
+    }
+
+    public List<VnffgInfo> getVnffgInfo() {
+        return vnffgInfo;
+    }
+
+    public void setVnffgInfo(List<VnffgInfo> vnffgInfo) {
+        this.vnffgInfo = vnffgInfo;
+    }
+
+    public List<SapInfo> getSapInfo() {
+        return sapInfo;
+    }
+
+    public void setSapInfo(List<SapInfo> sapInfo) {
+        this.sapInfo = sapInfo;
+    }
+
+    public List<String> getNestedNsInstanceId() {
+        return nestedNsInstanceId;
+    }
+
+    public void setNestedNsInstanceId(List<String> nestedNsInstanceId) {
+        this.nestedNsInstanceId = nestedNsInstanceId;
+    }
+
+    public List<NsScaleInfo> getNsScaleStatus() {
+        return nsScaleStatus;
+    }
+
+    public void setNsScaleStatus(List<NsScaleInfo> nsScaleStatus) {
+        this.nsScaleStatus = nsScaleStatus;
+    }
+
+    public List<AffinityOrAntiAffinityRule> getAdditionalAffinityOrAntiAffinityRule() {
+        return additionalAffinityOrAntiAffinityRule;
+    }
+
+    public void setAdditionalAffinityOrAntiAffinityRule(
+            List<AffinityOrAntiAffinityRule> additionalAffinityOrAntiAffinityRule) {
+        this.additionalAffinityOrAntiAffinityRule = additionalAffinityOrAntiAffinityRule;
+    }
+
+    public NsInstanceLinks get_links() {
+        return _links;
+    }
+
+    public void set_links(NsInstanceLinks _links) {
+        this._links = _links;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsInstanceLinks.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsInstanceLinks.java
new file mode 100644
index 0000000..08b3c63
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsInstanceLinks.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class NsInstanceLinks {
+    @NotNull
+    private Link self;
+    private List<Link> nestedNsInstances;
+    private Link instantiate;
+    private Link terminate;
+    private Link update;
+    private Link scale;
+    private Link heal;
+
+    public Link getSelf() {
+        return self;
+    }
+
+    public void setSelf(Link self) {
+        this.self = self;
+    }
+
+    public List<Link> getNestedNsInstances() {
+        return nestedNsInstances;
+    }
+
+    public void setNestedNsInstances(List<Link> nestedNsInstances) {
+        this.nestedNsInstances = nestedNsInstances;
+    }
+
+    public Link getInstantiate() {
+        return instantiate;
+    }
+
+    public void setInstantiate(Link instantiate) {
+        this.instantiate = instantiate;
+    }
+
+    public Link getTerminate() {
+        return terminate;
+    }
+
+    public void setTerminate(Link terminate) {
+        this.terminate = terminate;
+    }
+
+    public Link getUpdate() {
+        return update;
+    }
+
+    public void setUpdate(Link update) {
+        this.update = update;
+    }
+
+    public Link getScale() {
+        return scale;
+    }
+
+    public void setScale(Link scale) {
+        this.scale = scale;
+    }
+
+    public Link getHeal() {
+        return heal;
+    }
+
+    public void setHeal(Link heal) {
+        this.heal = heal;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLcmOpOcc.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLcmOpOcc.java
new file mode 100644
index 0000000..559b1f7
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLcmOpOcc.java
@@ -0,0 +1,125 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.onap.so.adapters.vfc.constant.CommonConstant;
+
+public class NsLcmOpOcc {
+    private String id;
+    private CommonConstant.operationState operationState;
+    private String statusEnteredTime;
+    private String nsInstanceId;
+    private CommonConstant.lcmOperationType lcmOperationType;
+    private String startTime;
+    private Boolean isAutomaticInvocation;
+    private String operationParams;
+    private Boolean isCancelPending;
+    private CommonConstant.cancelMode cancelMode;
+    private ProblemDetails error;
+    private Links links;
+
+    public CommonConstant.lcmOperationType getLcmOperationType() {
+        return lcmOperationType;
+    }
+
+    public void setLcmOperationType(CommonConstant.lcmOperationType lcmOperationType) {
+        this.lcmOperationType = lcmOperationType;
+    }
+
+    public CommonConstant.cancelMode getCancelMode() {
+        return cancelMode;
+    }
+
+    public void setCancelMode(CommonConstant.cancelMode cancelMode) {
+        this.cancelMode = cancelMode;
+    }
+
+    public CommonConstant.operationState getOperationState() {
+        return operationState;
+    }
+
+    public void setOperationState(CommonConstant.operationState operationState) {
+        this.operationState = operationState;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getStatusEnteredTime() {
+        return statusEnteredTime;
+    }
+
+    public void setStatusEnteredTime(String statusEnteredTime) {
+        this.statusEnteredTime = statusEnteredTime;
+    }
+
+    public String getNsInstanceId() {
+        return nsInstanceId;
+    }
+
+    public void setNsInstanceId(String nsInstanceId) {
+        this.nsInstanceId = nsInstanceId;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public Boolean getAutomaticInvocation() {
+        return isAutomaticInvocation;
+    }
+
+    public void setAutomaticInvocation(Boolean automaticInvocation) {
+        isAutomaticInvocation = automaticInvocation;
+    }
+
+    public String getOperationParams() {
+        return operationParams;
+    }
+
+    public void setOperationParams(String operationParams) {
+        this.operationParams = operationParams;
+    }
+
+    public Boolean getCancelPending() {
+        return isCancelPending;
+    }
+
+    public void setCancelPending(Boolean cancelPending) {
+        isCancelPending = cancelPending;
+    }
+
+    public ProblemDetails getError() {
+        return error;
+    }
+
+    public void setError(ProblemDetails error) {
+        this.error = error;
+    }
+
+    public Links getLinks() {
+        return links;
+    }
+
+    public void setLinks(Links links) {
+        this.links = links;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLinkPortInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLinkPortInfo.java
new file mode 100644
index 0000000..20c8972
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLinkPortInfo.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class NsLinkPortInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private ResourceHandle resourceHandle;
+    private NsCpHandle nsCpHandle;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public ResourceHandle getResourceHandle() {
+        return resourceHandle;
+    }
+
+    public void setResourceHandle(ResourceHandle resourceHandle) {
+        this.resourceHandle = resourceHandle;
+    }
+
+    public NsCpHandle getNsCpHandle() {
+        return nsCpHandle;
+    }
+
+    public void setNsCpHandle(NsCpHandle nsCpHandle) {
+        this.nsCpHandle = nsCpHandle;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsScaleInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsScaleInfo.java
new file mode 100644
index 0000000..59acf56
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsScaleInfo.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+
+public class NsScaleInfo {
+    @NotNull
+    private String nsScalingAspectId;
+    @NotNull
+    private String nsScaleLevelId;
+
+    public String getNsScalingAspectId() {
+        return nsScalingAspectId;
+    }
+
+    public void setNsScalingAspectId(String nsScalingAspectId) {
+        this.nsScalingAspectId = nsScalingAspectId;
+    }
+
+    public String getNsScaleLevelId() {
+        return nsScaleLevelId;
+    }
+
+    public void setNsScaleLevelId(String nsScaleLevelId) {
+        this.nsScaleLevelId = nsScaleLevelId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsVirtualLinkInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsVirtualLinkInfo.java
new file mode 100644
index 0000000..ed2debd
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsVirtualLinkInfo.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class NsVirtualLinkInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String nsVirtualLinkDescId;
+    @NotNull
+    private List<ResourceHandle> resourceHandle;
+    private List<NsLinkPortInfo> linkPort;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNsVirtualLinkDescId() {
+        return nsVirtualLinkDescId;
+    }
+
+    public void setNsVirtualLinkDescId(String nsVirtualLinkDescId) {
+        this.nsVirtualLinkDescId = nsVirtualLinkDescId;
+    }
+
+    public List<ResourceHandle> getResourceHandle() {
+        return resourceHandle;
+    }
+
+    public void setResourceHandle(List<ResourceHandle> resourceHandle) {
+        this.resourceHandle = resourceHandle;
+    }
+
+    public List<NsLinkPortInfo> getLinkPort() {
+        return linkPort;
+    }
+
+    public void setLinkPort(List<NsLinkPortInfo> linkPort) {
+        this.linkPort = linkPort;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ParamsForVnf.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ParamsForVnf.java
new file mode 100644
index 0000000..b7324e5
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ParamsForVnf.java
@@ -0,0 +1,35 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.Map;
+
+public class ParamsForVnf {
+    private String vnfProfileId;
+    private Map<String, Object> additionalParams;
+
+    public String getVnfProfileId() {
+        return vnfProfileId;
+    }
+
+    public void setVnfProfileId(String vnfProfileId) {
+        this.vnfProfileId = vnfProfileId;
+    }
+
+    public Map<String, Object> getAdditionalParams() {
+        return additionalParams;
+    }
+
+    public void setAdditionalParams(Map<String, Object> additionalParams) {
+        this.additionalParams = additionalParams;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfExtCpData.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfExtCpData.java
new file mode 100644
index 0000000..d5d091f
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfExtCpData.java
@@ -0,0 +1,44 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class PnfExtCpData {
+    private String cpInstanceI16;
+    private String cpdId;
+    private List<CpProtocolData> cpProtocolData;
+
+    public String getCpInstanceI16() {
+        return cpInstanceI16;
+    }
+
+    public void setCpInstanceI16(String cpInstanceI16) {
+        this.cpInstanceI16 = cpInstanceI16;
+    }
+
+    public String getCpdId() {
+        return cpdId;
+    }
+
+    public void setCpdId(String cpdId) {
+        this.cpdId = cpdId;
+    }
+
+    public List<CpProtocolData> getCpProtocolData() {
+        return cpProtocolData;
+    }
+
+    public void setCpProtocolData(List<CpProtocolData> cpProtocolData) {
+        this.cpProtocolData = cpProtocolData;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfExtCpInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfExtCpInfo.java
new file mode 100644
index 0000000..402cb83
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfExtCpInfo.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class PnfExtCpInfo {
+    @NotNull
+    private String cpInstanceId;
+    @NotNull
+    private String cpdId;
+    @NotNull
+    private List<CpProtocolData> cpProtocolData;
+
+    public String getCpInstanceI16() {
+        return cpInstanceId;
+    }
+
+    public void setCpInstanceI16(String cpInstanceI16) {
+        this.cpInstanceId = cpInstanceI16;
+    }
+
+    public String getCpdId() {
+        return cpdId;
+    }
+
+    public void setCpdId(String cpdId) {
+        this.cpdId = cpdId;
+    }
+
+    public List<CpProtocolData> getCpProtocolData() {
+        return cpProtocolData;
+    }
+
+    public void setCpProtocolData(List<CpProtocolData> cpProtocolData) {
+        this.cpProtocolData = cpProtocolData;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfInfo.java
new file mode 100644
index 0000000..a1cc11b
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PnfInfo.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class PnfInfo {
+
+    @NotNull
+    private String pnfId;
+    @NotNull
+    private String pnfName;
+    @NotNull
+    private String pnfdId;
+    @NotNull
+    private String pnfdInfoId;
+    @NotNull
+    private String pnfProfileId;
+    private List<PnfExtCpData> cpData;
+
+    /***
+     *
+     * @return id of pnf
+     */
+    public String getPnfId() {
+        return pnfId;
+    }
+
+    public void setPnfId(String pnfId) {
+        this.pnfId = pnfId;
+    }
+
+    public String getPnfName() {
+        return pnfName;
+    }
+
+    public void setPnfName(String pnfName) {
+        this.pnfName = pnfName;
+    }
+
+    public String getPnfdId() {
+        return pnfdId;
+    }
+
+    public void setPnfdId(String pnfdId) {
+        this.pnfdId = pnfdId;
+    }
+
+    public String getPnfProfileId() {
+        return pnfProfileId;
+    }
+
+    public void setPnfProfileId(String pnfProfileId) {
+        this.pnfProfileId = pnfProfileId;
+    }
+
+    public List<PnfExtCpData> getCpData() {
+        return cpData;
+    }
+
+    public void setCpData(List<PnfExtCpData> cpData) {
+        this.cpData = cpData;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PortRange.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PortRange.java
new file mode 100644
index 0000000..8318a8c
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/PortRange.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+
+public class PortRange {
+    @NotNull
+    private int lowerPort;
+    @NotNull
+    private int upperPort;
+
+    public int getLowerPort() {
+        return lowerPort;
+    }
+
+    public void setLowerPort(int lowerPort) {
+        this.lowerPort = lowerPort;
+    }
+
+    public int getUpperPort() {
+        return upperPort;
+    }
+
+    public void setUpperPort(int upperPort) {
+        this.upperPort = upperPort;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ProblemDetails.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ProblemDetails.java
new file mode 100644
index 0000000..efaa5de
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ProblemDetails.java
@@ -0,0 +1,62 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class ProblemDetails {
+    private String type;
+    private String title;
+    private int status;
+    private String detail;
+    private String instance;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public String getDetail() {
+        return detail;
+    }
+
+    public void setDetail(String detail) {
+        this.detail = detail;
+    }
+
+    public String getInstance() {
+        return instance;
+    }
+
+    public void setInstance(String instance) {
+        this.instance = instance;
+    }
+
+
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ResourceChanges.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ResourceChanges.java
new file mode 100644
index 0000000..062a6aa
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ResourceChanges.java
@@ -0,0 +1,71 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class ResourceChanges {
+    private List<AffectedVnf> affectedVnfs;
+    private List<AffectedPnf> affectedPnfs;
+    private List<AffectedVirtualLink> affectedVls;
+    private List<AffectedVnffg> affectedVnffgs;
+    private List<AffectedNs> affectedNss;
+    private List<AffectedSap> affectedSaps;
+
+    public List<AffectedVnf> getAffectedVnfs() {
+        return affectedVnfs;
+    }
+
+    public void setAffectedVnfs(List<AffectedVnf> affectedVnfs) {
+        this.affectedVnfs = affectedVnfs;
+    }
+
+    public List<AffectedPnf> getAffectedPnfs() {
+        return affectedPnfs;
+    }
+
+    public void setAffectedPnfs(List<AffectedPnf> affectedPnfs) {
+        this.affectedPnfs = affectedPnfs;
+    }
+
+    public List<AffectedVirtualLink> getAffectedVls() {
+        return affectedVls;
+    }
+
+    public void setAffectedVls(List<AffectedVirtualLink> affectedVls) {
+        this.affectedVls = affectedVls;
+    }
+
+    public List<AffectedVnffg> getAffectedVnffgs() {
+        return affectedVnffgs;
+    }
+
+    public void setAffectedVnffgs(List<AffectedVnffg> affectedVnffgs) {
+        this.affectedVnffgs = affectedVnffgs;
+    }
+
+    public List<AffectedNs> getAffectedNss() {
+        return affectedNss;
+    }
+
+    public void setAffectedNss(List<AffectedNs> affectedNss) {
+        this.affectedNss = affectedNss;
+    }
+
+    public List<AffectedSap> getAffectedSaps() {
+        return affectedSaps;
+    }
+
+    public void setAffectedSaps(List<AffectedSap> affectedSaps) {
+        this.affectedSaps = affectedSaps;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ResourceHandle.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ResourceHandle.java
new file mode 100644
index 0000000..fbfecaa
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/ResourceHandle.java
@@ -0,0 +1,51 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class ResourceHandle {
+    private String vimId;
+    private String resourceProviderId;
+    private String resourceId;
+    private String vimLevelResourceType;
+
+    public String getVimId() {
+        return vimId;
+    }
+
+    public void setVimId(String vimId) {
+        this.vimId = vimId;
+    }
+
+    public String getResourceProviderId() {
+        return resourceProviderId;
+    }
+
+    public void setResourceProviderId(String resourceProviderId) {
+        this.resourceProviderId = resourceProviderId;
+    }
+
+    public String getResourceId() {
+        return resourceId;
+    }
+
+    public void setResourceId(String resourceId) {
+        this.resourceId = resourceId;
+    }
+
+    public String getVimLevelResourceType() {
+        return vimLevelResourceType;
+    }
+
+    public void setVimLevelResourceType(String vimLevelResourceType) {
+        this.vimLevelResourceType = vimLevelResourceType;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/SapData.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/SapData.java
new file mode 100644
index 0000000..d8e96e2
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/SapData.java
@@ -0,0 +1,56 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import java.util.List;
+
+public class SapData {
+    private String sapdId;
+    private String sapName;
+    private String description;
+    private List<CpProtocolData> sapProtocolData;
+
+    public String getSapdId() {
+        return sapdId;
+    }
+
+    public void setSapdId(String sapdId) {
+        this.sapdId = sapdId;
+    }
+
+    public String getSapName() {
+        return sapName;
+    }
+
+    public void setSapName(String sapName) {
+        this.sapName = sapName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public List<CpProtocolData> getSapProtocolData() {
+        return sapProtocolData;
+    }
+
+    public void setSapProtocolData(List<CpProtocolData> sapProtocolData) {
+        this.sapProtocolData = sapProtocolData;
+    }
+
+
+
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/SapInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/SapInfo.java
new file mode 100644
index 0000000..182aceb
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/SapInfo.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class SapInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String sapdId;
+    @NotNull
+    private String sapName;
+    @NotNull
+    private String description;
+    @NotNull
+    private List<CpProtocolInfo> sapProtocolInfo;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getSapdId() {
+        return sapdId;
+    }
+
+    public void setSapdId(String sapdId) {
+        this.sapdId = sapdId;
+    }
+
+    public String getSapName() {
+        return sapName;
+    }
+
+    public void setSapName(String sapName) {
+        this.sapName = sapName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public List<CpProtocolInfo> getSapProtocolInfo() {
+        return sapProtocolInfo;
+    }
+
+    public void setSapProtocolInfo(List<CpProtocolInfo> sapProtocolInfo) {
+        this.sapProtocolInfo = sapProtocolInfo;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfInstance.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfInstance.java
new file mode 100644
index 0000000..ccd6532
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfInstance.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.Map;
+
+public class VnfInstance {
+    @NotNull
+    private String id;
+    private String vnfInstanceName;
+    private String vnfInstanceDescription;
+    @NotNull
+    private String vnfdId;
+    @NotNull
+    private String vnfProvider;
+    @NotNull
+    private String vnfProductName;
+    @NotNull
+    private String vnfSoftwareVersion;
+    @NotNull
+    private String vnfdVersion;
+    @NotNull
+    private String vnfPkgId;
+    private Map<String, Object> vnfConfigurableProperties;
+    private String vimId;
+
+    private enum instantiationState {
+        NOT_INSTANTIATED, INSTANTIATED
+    };
+
+    private InstantiatedVnfInfo instantiatedVnfInfo;
+    private Map<String, Object> metadata;
+    private Map<String, Object> extensions;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getVnfInstanceName() {
+        return vnfInstanceName;
+    }
+
+    public void setVnfInstanceName(String vnfInstanceName) {
+        this.vnfInstanceName = vnfInstanceName;
+    }
+
+    public String getVnfInstanceDescription() {
+        return vnfInstanceDescription;
+    }
+
+    public void setVnfInstanceDescription(String vnfInstanceDescription) {
+        this.vnfInstanceDescription = vnfInstanceDescription;
+    }
+
+    public String getVnfdId() {
+        return vnfdId;
+    }
+
+    public void setVnfdId(String vnfdId) {
+        this.vnfdId = vnfdId;
+    }
+
+    public String getVnfProvider() {
+        return vnfProvider;
+    }
+
+    public void setVnfProvider(String vnfProvider) {
+        this.vnfProvider = vnfProvider;
+    }
+
+    public String getVnfProductName() {
+        return vnfProductName;
+    }
+
+    public void setVnfProductName(String vnfProductName) {
+        this.vnfProductName = vnfProductName;
+    }
+
+    public String getVnfSoftwareVersion() {
+        return vnfSoftwareVersion;
+    }
+
+    public void setVnfSoftwareVersion(String vnfSoftwareVersion) {
+        this.vnfSoftwareVersion = vnfSoftwareVersion;
+    }
+
+    public String getVnfdVersion() {
+        return vnfdVersion;
+    }
+
+    public void setVnfdVersion(String vnfdVersion) {
+        this.vnfdVersion = vnfdVersion;
+    }
+
+    public String getVnfPkgId() {
+        return vnfPkgId;
+    }
+
+    public void setVnfPkgId(String vnfPkgId) {
+        this.vnfPkgId = vnfPkgId;
+    }
+
+    public Map<String, Object> getVnfConfigurableProperties() {
+        return vnfConfigurableProperties;
+    }
+
+    public void setVnfConfigurableProperties(Map<String, Object> vnfConfigurableProperties) {
+        this.vnfConfigurableProperties = vnfConfigurableProperties;
+    }
+
+    public String getVimId() {
+        return vimId;
+    }
+
+    public void setVimId(String vimId) {
+        this.vimId = vimId;
+    }
+
+    public InstantiatedVnfInfo getInstantiatedVnfInfo() {
+        return instantiatedVnfInfo;
+    }
+
+    public void setInstantiatedVnfInfo(InstantiatedVnfInfo instantiatedVnfInfo) {
+        this.instantiatedVnfInfo = instantiatedVnfInfo;
+    }
+
+    public Map<String, Object> getMetadata() {
+        return metadata;
+    }
+
+    public void setMetadata(Map<String, Object> metadata) {
+        this.metadata = metadata;
+    }
+
+    public Map<String, Object> getExtensions() {
+        return extensions;
+    }
+
+    public void setExtensions(Map<String, Object> extensions) {
+        this.extensions = extensions;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfInstanceData.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfInstanceData.java
new file mode 100644
index 0000000..83345fc
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfInstanceData.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class VnfInstanceData {
+    private String vnfInstanceId;
+    private String vnfProfileId;
+
+    public String getVnfInstanceId() {
+        return vnfInstanceId;
+    }
+
+    public void setVnfInstanceId(String vnfInstanceId) {
+        this.vnfInstanceId = vnfInstanceId;
+    }
+
+    public String getVnfProfileId() {
+        return vnfProfileId;
+    }
+
+    public void setVnfProfileId(String vnfProfileId) {
+        this.vnfProfileId = vnfProfileId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfLinkPortInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfLinkPortInfo.java
new file mode 100644
index 0000000..0b09d06
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfLinkPortInfo.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+
+public class VnfLinkPortInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private ResourceHandle resourceHandle;
+    private String cpInstanceId;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public ResourceHandle getResourceHandle() {
+        return resourceHandle;
+    }
+
+    public void setResourceHandle(ResourceHandle resourceHandle) {
+        this.resourceHandle = resourceHandle;
+    }
+
+    public String getCpInstanceId() {
+        return cpInstanceId;
+    }
+
+    public void setCpInstanceId(String cpInstanceId) {
+        this.cpInstanceId = cpInstanceId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfLocationConstraint.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfLocationConstraint.java
new file mode 100644
index 0000000..5db3060
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfLocationConstraint.java
@@ -0,0 +1,33 @@
+/***
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+public class VnfLocationConstraint {
+    private String vnfProfileId;
+    private LocationConstraint locationConstraints;
+
+    public String getVnfProfileId() {
+        return vnfProfileId;
+    }
+
+    public void setVnfProfileId(String vnfProfileId) {
+        this.vnfProfileId = vnfProfileId;
+    }
+
+    public LocationConstraint getLocationConstraints() {
+        return locationConstraints;
+    }
+
+    public void setLocationConstraints(LocationConstraint locationConstraints) {
+        this.locationConstraints = locationConstraints;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfScaleInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfScaleInfo.java
new file mode 100644
index 0000000..e702edc
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfScaleInfo.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+
+public class VnfScaleInfo {
+    @NotNull
+    private String aspectlId;
+    @NotNull
+    private int scaleLevel;
+
+    public String getAspectlId() {
+        return aspectlId;
+    }
+
+    public void setAspectlId(String aspectlId) {
+        this.aspectlId = aspectlId;
+    }
+
+    public int getScaleLevel() {
+        return scaleLevel;
+    }
+
+    public void setScaleLevel(int scaleLevel) {
+        this.scaleLevel = scaleLevel;
+    }
+
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfVirtualLinkResourceInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfVirtualLinkResourceInfo.java
new file mode 100644
index 0000000..9f41a38
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfVirtualLinkResourceInfo.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+import java.util.Map;
+
+public class VnfVirtualLinkResourceInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String virtualLinkDescId;
+    @NotNull
+    private ResourceHandle networkResource;
+    private String reservationId;
+    private List<VnfLinkPortInfo> vnfLinkPorts;
+    Map<String, Object> metadata;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getVirtualLinkDescId() {
+        return virtualLinkDescId;
+    }
+
+    public void setVirtualLinkDescId(String virtualLinkDescId) {
+        this.virtualLinkDescId = virtualLinkDescId;
+    }
+
+    public ResourceHandle getNetworkResource() {
+        return networkResource;
+    }
+
+    public void setNetworkResource(ResourceHandle networkResource) {
+        this.networkResource = networkResource;
+    }
+
+    public String getReservationId() {
+        return reservationId;
+    }
+
+    public void setReservationId(String reservationId) {
+        this.reservationId = reservationId;
+    }
+
+    public List<VnfLinkPortInfo> getVnfLinkPorts() {
+        return vnfLinkPorts;
+    }
+
+    public void setVnfLinkPorts(List<VnfLinkPortInfo> vnfLinkPorts) {
+        this.vnfLinkPorts = vnfLinkPorts;
+    }
+
+    public Map<String, Object> getMetadata() {
+        return metadata;
+    }
+
+    public void setMetadata(Map<String, Object> metadata) {
+        this.metadata = metadata;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfcCpInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfcCpInfo.java
new file mode 100644
index 0000000..ec629ef
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfcCpInfo.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class VnfcCpInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String cpdId;
+    private String vnfExtCpId;
+    private List<CpProtocolInfo> cpProtocolInfo;
+    private String vnfLinkPortId;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCpdId() {
+        return cpdId;
+    }
+
+    public void setCpdId(String cpdId) {
+        this.cpdId = cpdId;
+    }
+
+    public String getVnfExtCpId() {
+        return vnfExtCpId;
+    }
+
+    public void setVnfExtCpId(String vnfExtCpId) {
+        this.vnfExtCpId = vnfExtCpId;
+    }
+
+    public List<CpProtocolInfo> getCpProtocolInfo() {
+        return cpProtocolInfo;
+    }
+
+    public void setCpProtocolInfo(List<CpProtocolInfo> cpProtocolInfo) {
+        this.cpProtocolInfo = cpProtocolInfo;
+    }
+
+    public String getVnfLinkPortId() {
+        return vnfLinkPortId;
+    }
+
+    public void setVnfLinkPortId(String vnfLinkPortId) {
+        this.vnfLinkPortId = vnfLinkPortId;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfcResourceInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfcResourceInfo.java
new file mode 100644
index 0000000..1f7aa67
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnfcResourceInfo.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+import java.util.Map;
+
+public class VnfcResourceInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String vduId;
+    @NotNull
+    private ResourceHandle computeResource;
+    private List<String> storageResourceIds;
+    private String reservationId;
+    private List<VnfcCpInfo> vnfcCpInfo;
+    private Map<String, Object> metadata;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getVduId() {
+        return vduId;
+    }
+
+    public void setVduId(String vduId) {
+        this.vduId = vduId;
+    }
+
+    public ResourceHandle getComputeResource() {
+        return computeResource;
+    }
+
+    public void setComputeResource(ResourceHandle computeResource) {
+        this.computeResource = computeResource;
+    }
+
+    public List<String> getStorageResourceIds() {
+        return storageResourceIds;
+    }
+
+    public void setStorageResourceIds(List<String> storageResourceIds) {
+        this.storageResourceIds = storageResourceIds;
+    }
+
+    public String getReservationId() {
+        return reservationId;
+    }
+
+    public void setReservationId(String reservationId) {
+        this.reservationId = reservationId;
+    }
+
+    public List<VnfcCpInfo> getVnfcCpInfo() {
+        return vnfcCpInfo;
+    }
+
+    public void setVnfcCpInfo(List<VnfcCpInfo> vnfcCpInfo) {
+        this.vnfcCpInfo = vnfcCpInfo;
+    }
+
+    public Map<String, Object> getMetadata() {
+        return metadata;
+    }
+
+    public void setMetadata(Map<String, Object> metadata) {
+        this.metadata = metadata;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnffgInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnffgInfo.java
new file mode 100644
index 0000000..c02d517
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/VnffgInfo.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+public class VnffgInfo {
+    @NotNull
+    private String id;
+    @NotNull
+    private String vnffgdId;
+    @NotNull
+    private List<String> vnfInstanceId;
+    private String pnfInfoId;
+    @NotNull
+    private List<String> nsVirtualLinkInfoId;
+    @NotNull
+    private List<NsCpHandle> nsCpHandle;
+    @NotNull
+    private List<NfpInfo> nfpInfo;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getVnffgdId() {
+        return vnffgdId;
+    }
+
+    public void setVnffgdId(String vnffgdId) {
+        this.vnffgdId = vnffgdId;
+    }
+
+    public List<String> getVnfInstanceId() {
+        return vnfInstanceId;
+    }
+
+    public void setVnfInstanceId(List<String> vnfInstanceId) {
+        this.vnfInstanceId = vnfInstanceId;
+    }
+
+    public String getPnfInfoId() {
+        return pnfInfoId;
+    }
+
+    public void setPnfInfoId(String pnfInfoId) {
+        this.pnfInfoId = pnfInfoId;
+    }
+
+    public List<String> getNsVirtualLinkInfoId() {
+        return nsVirtualLinkInfoId;
+    }
+
+    public void setNsVirtualLinkInfoId(List<String> nsVirtualLinkInfoId) {
+        this.nsVirtualLinkInfoId = nsVirtualLinkInfoId;
+    }
+
+    public List<NsCpHandle> getNsCpHandle() {
+        return nsCpHandle;
+    }
+
+    public void setNsCpHandle(List<NsCpHandle> nsCpHandle) {
+        this.nsCpHandle = nsCpHandle;
+    }
+
+    public List<NfpInfo> getNfpInfo() {
+        return nfpInfo;
+    }
+
+    public void setNfpInfo(List<NfpInfo> nfpInfo) {
+        this.nfpInfo = nfpInfo;
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java
index bb9ae69..5a89c04 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java
@@ -37,6 +37,8 @@
 import org.onap.so.adapters.vfc.model.RestfulResponse;
 import org.onap.so.adapters.vfc.util.JsonUtil;
 import org.onap.so.adapters.vfc.util.ValidateUtil;
+import org.onap.so.db.request.beans.InstanceNfvoMapping;
+import org.onap.so.db.request.data.repository.InstanceNfvoMappingRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -58,7 +60,12 @@
     private static final String REQUEST_DEBUG_MSG = "body from request is {}";
     private static final String APPLICATION_EXCEPTION = "ApplicationException: ";
     @Autowired
+    private VfcManagerSol005 vfcManagerSol005;
+
+    @Autowired
     private VfcManager driverMgr;
+    @Autowired
+    private InstanceNfvoMappingRepository instanceNfvoMappingRepository;
 
     public VfcAdapterRest() {
 
@@ -80,7 +87,13 @@
             ValidateUtil.assertObjectNotNull(data);
             logger.debug(REQUEST_DEBUG_MSG + data);
             NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
-            RestfulResponse rsp = driverMgr.createNs(nsInput);
+            RestfulResponse rsp;
+            if (nsInput.getNsParameters().getAdditionalParamForNs().containsKey("isSol005Interface")) {
+                rsp = vfcManagerSol005.createNs(nsInput);
+            } else {
+                rsp = driverMgr.createNs(nsInput);
+            }
+
             return buildResponse(rsp);
         } catch (ApplicationException e) {
             logger.debug(APPLICATION_EXCEPTION, e);
@@ -106,7 +119,13 @@
             ValidateUtil.assertObjectNotNull(data);
             logger.debug(REQUEST_DEBUG_MSG + data);
             NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
-            RestfulResponse rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
+            RestfulResponse rsp;
+            InstanceNfvoMapping instanceNfvoMapping = instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId);
+            if (instanceNfvoMapping != null) {
+                rsp = vfcManagerSol005.deleteNs(nsOperationKey, nsInstanceId);
+            } else {
+                rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
+            }
             return buildResponse(rsp);
         } catch (ApplicationException e) {
             logger.debug(APPLICATION_EXCEPTION, e);
@@ -131,7 +150,13 @@
             ValidateUtil.assertObjectNotNull(data);
             logger.debug(REQUEST_DEBUG_MSG + data);
             NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
-            RestfulResponse rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
+            RestfulResponse rsp;
+            InstanceNfvoMapping instanceNfvoMapping = instanceNfvoMappingRepository.findOneByJobId(jobId);
+            if (instanceNfvoMapping != null) {
+                rsp = vfcManagerSol005.getNsProgress(nsOperationKey, jobId);
+            } else {
+                rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
+            }
             return buildResponse(rsp);
         } catch (ApplicationException e) {
             logger.debug(APPLICATION_EXCEPTION, e);
@@ -156,7 +181,12 @@
             ValidateUtil.assertObjectNotNull(data);
             logger.debug(REQUEST_DEBUG_MSG + data);
             NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
-            RestfulResponse rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
+            RestfulResponse rsp;
+            if (nsInput.getNsParameters().getAdditionalParamForNs().containsKey("isSol005Interface")) {
+                rsp = vfcManagerSol005.instantiateNs(nsInstanceId, nsInput);
+            } else {
+                rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
+            }
             return buildResponse(rsp);
         } catch (ApplicationException e) {
             logger.debug(APPLICATION_EXCEPTION, e);
@@ -181,7 +211,14 @@
             ValidateUtil.assertObjectNotNull(data);
             logger.debug(REQUEST_DEBUG_MSG + data);
             NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
-            RestfulResponse rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
+            RestfulResponse rsp;
+            InstanceNfvoMapping instanceNfvoMapping = instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId);
+            if (instanceNfvoMapping != null) {
+                rsp = vfcManagerSol005.terminateNs(nsOperationKey, nsInstanceId);
+            } else {
+                rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
+            }
+
             return buildResponse(rsp);
         } catch (ApplicationException e) {
             logger.debug(APPLICATION_EXCEPTION, e);
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005.java
new file mode 100644
index 0000000..9033bec
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005.java
@@ -0,0 +1,620 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.rest;
+
+import java.time.LocalDateTime;
+import java.util.*;
+import org.onap.so.adapters.vfc.constant.CommonConstant;
+import org.onap.so.adapters.vfc.constant.CommonConstant.Step;
+import org.onap.so.adapters.vfc.constant.DriverExceptionID;
+import org.onap.so.adapters.vfc.constant.HttpCode;
+import org.onap.so.adapters.vfc.exceptions.ApplicationException;
+import org.onap.so.adapters.vfc.model.*;
+import org.onap.so.adapters.vfc.util.JsonUtil;
+import org.onap.so.adapters.vfc.util.RestfulUtil;
+import org.onap.so.adapters.vfc.util.ValidateUtil;
+import org.onap.so.db.request.beans.InstanceNfvoMapping;
+import org.onap.so.db.request.beans.OperationStatus;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.data.repository.InstanceNfvoMappingRepository;
+import org.onap.so.db.request.data.repository.OperationStatusRepository;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.onap.so.requestsdb.RequestsDbConstant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.domain.Example;
+import org.springframework.stereotype.Component;
+
+/**
+ * VF-C Manager <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-08-28
+ */
+@Component
+@Primary
+public class VfcManagerSol005 {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(VfcManagerSol005.class);
+
+    /**
+     * nfvo url map
+     */
+    private Map<String, String> nfvoUrlMap;
+
+    @Autowired
+    private ResourceOperationStatusRepository resourceOperationStatusRepository;
+
+    @Autowired
+    private RestfulUtil restfulUtil;
+
+    @Autowired
+    private OperationStatusRepository operationStatusRepository;
+
+    @Autowired
+    private InstanceNfvoMappingRepository instanceNfvoMappingRepository;
+
+    private InstanceNfvoMapping instanceNfvoMapping = new InstanceNfvoMapping();
+
+    public VfcManagerSol005() {
+        nfvoUrlMap = new HashMap<>();
+        nfvoUrlMap.put(Step.CREATE, CommonConstant.SOL005_NFVO_CREATE_URL);
+        nfvoUrlMap.put(Step.INSTANTIATE, CommonConstant.SOL005_NFVO_INSTANTIATE_URL);
+        nfvoUrlMap.put(Step.TERMINATE, CommonConstant.SOL005_NFVO_TERMINATE_URL);
+        nfvoUrlMap.put(Step.DELETE, CommonConstant.SOL005_NFVO_DELETE_URL);
+        nfvoUrlMap.put(Step.QUERY, CommonConstant.SOL005_NFVO_QUERY_URL);
+        nfvoUrlMap.put(Step.SCALE, CommonConstant.NFVO_SCALE_URL);
+    }
+
+    /**
+     * create network service <br>
+     *
+     * @param segInput input parameters for current node from http request
+     * @return
+     * @since ONAP Dubilin Release
+     */
+    public RestfulResponse createNs(NSResourceInputParameter segInput) throws ApplicationException {
+
+        Map<String, String> nfvoDetails;
+        // Step1: get service template by node type
+        String nsdId = segInput.getNsServiceModelUUID();
+        // nsdId for NFVO is "id" in the response, while for SDNO is "servcice template id"
+        LOGGER.info("serviceTemplateId is {}, id is {}", nsdId, nsdId);
+
+
+        LOGGER.info("SOL005 create ns -> begin");
+        // Step2: Prepare url and method type
+        String url = getUrl(null, CommonConstant.Step.CREATE);
+        String methodType = CommonConstant.MethodType.POST;
+
+        // Step3: Prepare restful parameters and options
+        CreateNsRequest createNsRequest = new CreateNsRequest();
+        createNsRequest.setNsDescription(segInput.getNsServiceDescription());
+        createNsRequest.setNsdId(segInput.getNsServiceModelUUID());
+        createNsRequest.setNsName(segInput.getNsServiceName());
+
+        String createReq = JsonUtil.marshal(createNsRequest);
+        RestfulResponse aaiRestfulResponse = null;
+        NsParameters nsParameters = segInput.getNsParameters();
+        if (nsParameters.getAdditionalParamForNs().containsKey("orchestrator")) {
+            if (nsParameters.getAdditionalParamForNs().get("orchestrator") != null) {
+                String nfvo = nsParameters.getAdditionalParamForNs().get("nfvo").toString();
+                aaiRestfulResponse = restfulUtil.getNfvoFromAAI(nfvo);
+                nfvoDetails = JsonUtil.unMarshal(aaiRestfulResponse.getResponseContent(), Map.class);
+                url = nfvoDetails.get("url") + nfvoDetails.get("api-root") + url;
+
+            }
+        } else {
+            LOGGER.error("Nfvo not present in AAI");
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_CREATE_NS);
+        }
+
+
+        // Prepare request header for createNs request.
+        Map<String, String> requestHeader = new HashMap<>();
+        requestHeader.put("GLOBALCUSTOMERID", segInput.getNsOperationKey().getGlobalSubscriberId());
+        requestHeader.put("SERVICETYPE", segInput.getNsOperationKey().getServiceType());
+
+        // Step4: Call NFVO or SDNO lcm to create ns
+        LOGGER.info("Request Payload for CreateNs: " + createReq);
+
+        RestfulResponse createRsp = restfulUtil.send(url, methodType, createReq, requestHeader);
+        ValidateUtil.assertObjectNotNull(createRsp);
+        LOGGER.info("create ns response status is : {}", createRsp.getStatus());
+        LOGGER.info("create ns response content is : {}", createRsp.getResponseContent());
+
+        // Step 5: save resource operation information
+        ResourceOperationStatus status = new ResourceOperationStatus(segInput.getNsOperationKey().getServiceId(),
+                segInput.getNsOperationKey().getOperationId(), segInput.getNsOperationKey().getNodeTemplateUUID());
+        status.setStatus(RequestsDbConstant.Status.PROCESSING);
+        status = resourceOperationStatusRepository.save(status);
+        if (!HttpCode.isSucess(createRsp.getStatus())) {
+            LOGGER.error("update segment operation status : fail to create ns");
+            status.setProgress("40");
+            status.setStatusDescription("NS not created");
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setErrorCode(String.valueOf(createRsp.getStatus()));
+            resourceOperationStatusRepository.save(status);
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_CREATE_NS);
+        }
+        // TODO: Capture all the content of the response. Currently fetching ID value alone.
+        // Should be converted into the NsInstance.class
+        @SuppressWarnings("unchecked")
+        Map<String, String> rsp = JsonUtil.unMarshal(createRsp.getResponseContent(), Map.class);
+        String nsInstanceId = rsp.get(CommonConstant.SOL005_NS_INSTANCE_ID);
+        if (ValidateUtil.isStrEmpty(nsInstanceId)) {
+            LOGGER.error("Invalid instanceId from create operation");
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
+                    DriverExceptionID.INVALID_RESPONSEE_FROM_CREATE_OPERATION);
+        }
+
+        nfvoDetails = JsonUtil.unMarshal(aaiRestfulResponse.getResponseContent(), Map.class);
+        instanceNfvoMapping.setInstanceId(nsInstanceId);
+        instanceNfvoMapping.setPassword(nfvoDetails.get("password"));
+        instanceNfvoMapping.setUsername(nfvoDetails.get("userName"));
+        instanceNfvoMapping.setNfvoName(nfvoDetails.get("nfvoId"));
+        instanceNfvoMapping.setEndpoint(nfvoDetails.get("url"));
+        instanceNfvoMapping.setApiRoot(nfvoDetails.get("api-root"));
+        instanceNfvoMappingRepository.save(instanceNfvoMapping);
+        LOGGER.info("create ns -> end");
+        LOGGER.info("save segment and operaton info -> begin");
+        // Step 6: add relation between service and NS
+        AaiUtil.addRelation(segInput.getNsOperationKey().getGlobalSubscriberId(),
+                segInput.getNsOperationKey().getServiceType(), segInput.getNsOperationKey().getServiceId(),
+                nsInstanceId);
+        LOGGER.info("save segment and operation info -> end");
+        return createRsp;
+    }
+
+    /**
+     * delete network service <br>
+     *
+     * @param nsOperationKey The operation key of the NS resource
+     * @param nsInstanceId The NS instance id
+     * @return
+     * @since ONAP Dublin Release
+     */
+    public RestfulResponse deleteNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException {
+        LOGGER.info("SOL005 delete ns -> begin");
+        // Step1: prepare url and methodType
+        String url = getUrl(nsInstanceId, CommonConstant.Step.DELETE);
+        String methodType = CommonConstant.MethodType.DELETE;
+
+        // Step2: prepare restful parameters and options
+        RestfulResponse deleteRsp = restfulUtil.send(url, methodType, "");
+        ValidateUtil.assertObjectNotNull(deleteRsp);
+        LOGGER.info("delete ns response status is : {}", deleteRsp.getStatus());
+        LOGGER.info("delete ns response content is : {}", deleteRsp.getResponseContent());
+        LOGGER.info("delete ns -> end");
+
+        ResourceOperationStatus status = new ResourceOperationStatus(nsOperationKey.getServiceId(),
+                nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID());
+        if (!HttpCode.isSucess(deleteRsp.getStatus())) {
+            LOGGER.error("fail to delete ns");
+
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setErrorCode(String.valueOf(deleteRsp.getStatus()));
+            status.setStatusDescription(CommonConstant.StatusDesc.TERMINATE_NS_FAILED);
+            resourceOperationStatusRepository.save(status);
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_DELETE_NS);
+        }
+
+        // Step3: remove relation info between service and ns
+        AaiUtil.removeRelation(nsOperationKey.getGlobalSubscriberId(), nsOperationKey.getServiceType(),
+                nsOperationKey.getServiceId(), nsInstanceId);
+        LOGGER.info("delete segment information -> end");
+
+        // Step4: update service segment operation status
+        status.setStatus(RequestsDbConstant.Status.FINISHED);
+        status.setErrorCode(String.valueOf(deleteRsp.getStatus()));
+        status.setProgress("100");
+        status.setStatusDescription("VFC resource deletion finished");
+        resourceOperationStatusRepository.save(status);
+        LOGGER.info("update segment operaton status for delete -> end");
+
+        return deleteRsp;
+
+    }
+
+    /**
+     * instantiate network service <br>
+     *
+     * @param nsInstanceId The NS instance id
+     * @param segInput input parameters for current node from http request
+     * @return
+     * @since ONAP Dublin Release
+     */
+    public RestfulResponse instantiateNs(String nsInstanceId, NSResourceInputParameter segInput)
+            throws ApplicationException {
+        // Call the NFVO or SDNO service to instantiate service
+        LOGGER.info("SOL005 instantiate ns -> begin");
+
+        // Step1: Prepare restful parameters and options
+        InstantiateNsRequest instantiateNsRequest = new InstantiateNsRequest();
+
+        NsInstantiateReq oRequest = new NsInstantiateReq();
+        oRequest.setNsInstanceId(nsInstanceId);
+        NsParameters nsParameters = segInput.getNsParameters();
+
+        ArrayList<VnfLocationConstraint> vnfLocationConstraints = new ArrayList<VnfLocationConstraint>();
+        for (LocationConstraint locationConstraint : nsParameters.getLocationConstraints()) {
+            VnfLocationConstraint vnfLocationConstraint = new VnfLocationConstraint();
+            vnfLocationConstraint.setVnfProfileId(locationConstraint.getVnfProfileId());
+            vnfLocationConstraint.setLocationConstraints(null);
+            vnfLocationConstraints.add(vnfLocationConstraint);
+
+        }
+        instantiateNsRequest.setAditionalParamsForNs(nsParameters.getAdditionalParamForNs());
+        // Setting FlavourID which is a mandatory paramater to default
+        // as UUI is not sending this parameter to so
+        instantiateNsRequest.setNsFlavourId("default");
+        String instReq = JsonUtil.marshal(instantiateNsRequest);
+        LOGGER.info("Request Payload for InstantiateNs: " + instReq);
+        // Step2: prepare url and
+        String url = getUrl(nsInstanceId, CommonConstant.Step.INSTANTIATE);
+        String methodType = CommonConstant.MethodType.POST;
+        instanceNfvoMapping = instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId);
+
+        if (instanceNfvoMapping != null) {
+
+            url = instanceNfvoMapping.getEndpoint() + instanceNfvoMapping.getApiRoot() + url;
+
+        } else {
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+
+        }
+        // Step3: prepare restful parameters and options
+        Map<String, String> reqBody = new HashMap<>();
+        reqBody.put("terminationTime", LocalDateTime.now().toString());
+        RestfulResponse instRsp = restfulUtil.send(url, methodType, instReq);
+        ResourceOperationStatus status = new ResourceOperationStatus(segInput.getNsOperationKey().getServiceId(),
+                segInput.getNsOperationKey().getOperationId(), segInput.getNsOperationKey().getNodeTemplateUUID());
+        ValidateUtil.assertObjectNotNull(instRsp);
+        if (!HttpCode.isSucess(instRsp.getStatus())) {
+            LOGGER.error("update segment operation status : fail to instantiate ns");
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setErrorCode(String.valueOf(instRsp.getStatus()));
+            status.setStatusDescription(CommonConstant.StatusDesc.INSTANTIATE_NS_FAILED);
+            resourceOperationStatusRepository.save(status);
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+        }
+        LOGGER.info("instantiate ns response status is : {}", instRsp.getStatus());
+        LOGGER.info("response payload is {}", instRsp.getResponseContent());
+        String jobId = null;
+        if (instRsp.getStatus() == 202) {
+            String jobUri = instRsp.getRespHeaderStr(CommonConstant.JOB_URI);
+            LOGGER.info("JOB URI" + jobUri);
+            jobId = jobUri.split("/")[4];
+            if (ValidateUtil.isStrEmpty(jobId)) {
+                LOGGER.error("Invalid jobId from instantiate operation");
+                status.setStatus(RequestsDbConstant.Status.ERROR);
+                status.setErrorCode(String.valueOf(instRsp.getStatus()));
+                status.setStatusDescription(CommonConstant.StatusDesc.INSTANTIATE_NS_FAILED);
+                resourceOperationStatusRepository.save(status);
+                throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
+                        DriverExceptionID.INVALID_RESPONSE_FROM_INSTANTIATE_OPERATION);
+            }
+
+        } else if (instRsp.getStatus() > 400 && instRsp.getStatus() < 600) {
+            LOGGER.error("ERROR while executing instantiateNs request");
+            ProblemDetails problemDetails = JsonUtil.unMarshal(instRsp.getResponseContent(), ProblemDetails.class);
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setErrorCode(String.valueOf(instRsp.getStatus()));
+            status.setStatusDescription(CommonConstant.StatusDesc.INSTANTIATE_NS_FAILED + problemDetails.getDetail());
+            resourceOperationStatusRepository.save(status);
+            if (instRsp.getStatus() == 406) {
+                throw new ApplicationException(HttpCode.NOT_ACCEPTABLE, DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+            } else if (instRsp.getStatus() == 400) {
+                throw new ApplicationException(HttpCode.BAD_REQUEST, DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+            } else if (instRsp.getStatus() == 404) {
+                throw new ApplicationException(HttpCode.NOT_FOUND, DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+            } else if (instRsp.getStatus() == 409) {
+                LOGGER.error("The operation cannot be executed currently,\n"
+                        + "due to a conflict with the state of the resource");
+                throw new ApplicationException(HttpCode.RESPOND_CONFLICT, DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+            } else if (instRsp.getStatus() == 500) {
+                throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
+                        DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+            } else {
+                throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
+                        DriverExceptionID.FAIL_TO_INSTANTIATE_NS);
+            }
+
+        }
+        LOGGER.info("Job id is " + jobId);
+        LOGGER.info("Nfvo Details" + instanceNfvoMapping.toString());
+        LOGGER.info("instantiate ns -> end");
+        // Step 3: update segment operation job id
+        LOGGER.info("update resource operation status job id -> begin");
+        status.setJobId(jobId);
+        status.setProgress("100");
+        status.setStatusDescription("NS initiation completed.");
+        resourceOperationStatusRepository.save(status);
+        instanceNfvoMapping.setJobId(jobId);
+        instanceNfvoMappingRepository.save(instanceNfvoMapping);
+        LOGGER.info("update segment operation job id -> end" + instanceNfvoMapping.toString());
+        return instRsp;
+    }
+
+    /**
+     * terminate network service <br>
+     *
+     * @param nsOperationKey The operation key for NS resource
+     * @param nsInstanceId The NS instance id
+     * @return
+     * @since ONAP Dublin Release
+     */
+    public RestfulResponse terminateNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException {
+        // Step1: save segment operation info for delete process
+        LOGGER.info("save segment operation for delete process");
+        ResourceOperationStatus status = new ResourceOperationStatus(nsOperationKey.getServiceId(),
+                nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID());
+        status.setStatus(RequestsDbConstant.Status.PROCESSING);
+        resourceOperationStatusRepository.save(status);
+
+        LOGGER.info("SOL005 terminate ns -> begin");
+        // Step2: prepare url and method type
+        String url = getUrl(nsInstanceId, CommonConstant.Step.TERMINATE);
+        String methodType = CommonConstant.MethodType.POST;
+
+        instanceNfvoMapping = instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId);
+
+        if (instanceNfvoMapping != null) {
+
+            url = instanceNfvoMapping.getEndpoint() + instanceNfvoMapping.getApiRoot() + url;
+
+        } else {
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+        }
+        // Step3: prepare restful parameters and options
+        Map<String, String> reqBody = new HashMap<>();
+        reqBody.put("terminationTime", LocalDateTime.now().toString());
+
+        // Step4: Call the NFVO or SDNO service to terminate service
+        LOGGER.info("request body for terminate NS" + JsonUtil.marshal(reqBody));
+        RestfulResponse terminateRsp = restfulUtil.send(url, methodType, JsonUtil.marshal(reqBody));
+        ValidateUtil.assertObjectNotNull(terminateRsp);
+        LOGGER.info("terminate ns response status is : {}", terminateRsp.getStatus());
+        LOGGER.info("terminate ns response content is : {}", terminateRsp.getResponseContent());
+        // Step 3: update segment operation
+        if (!HttpCode.isSucess(terminateRsp.getStatus())) {
+            LOGGER.error("fail to terminate ns");
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setErrorCode(String.valueOf(terminateRsp.getStatus()));
+            status.setStatusDescription(CommonConstant.StatusDesc.TERMINATE_NS_FAILED);
+            resourceOperationStatusRepository.save(status);
+
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+        }
+        // @SuppressWarnings("unchecked")
+        String jobId = null;
+        Map<String, String> rsp = new HashMap<>();
+        if (terminateRsp.getStatus() == 202) {
+            String jobUri = terminateRsp.getRespHeaderStr(CommonConstant.JOB_URI);
+            jobId = jobUri.split("/")[4];
+            jobId.split("/");
+            if (ValidateUtil.isStrEmpty(jobId)) {
+                LOGGER.error("Invalid jobId from instantiate operation");
+                status.setStatus(RequestsDbConstant.Status.ERROR);
+                status.setErrorCode(String.valueOf(terminateRsp.getStatus()));
+                status.setStatusDescription(CommonConstant.StatusDesc.INSTANTIATE_NS_FAILED);
+                resourceOperationStatusRepository.save(status);
+                throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
+                        DriverExceptionID.INVALID_RESPONSE_FROM_INSTANTIATE_OPERATION);
+            }
+            rsp.put(CommonConstant.JOB_ID, jobId);
+            LOGGER.info("terminate ns -> end");
+            LOGGER.info("update segment job id -> begin");
+            status.setProgress("60");
+            status.setStatusDescription("NS is termination completed");
+            status.setJobId(jobId);
+            resourceOperationStatusRepository.save(status);
+            LOGGER.info("update segment job id -> end");
+        } else if (terminateRsp.getStatus() > 400 && terminateRsp.getStatus() < 600) {
+            LOGGER.error("ERROR while executing instantiateNs request");
+            ProblemDetails problemDetails = JsonUtil.unMarshal(terminateRsp.getResponseContent(), ProblemDetails.class);
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setErrorCode(String.valueOf(terminateRsp.getStatus()));
+            status.setStatusDescription(CommonConstant.StatusDesc.TERMINATE_NS_FAILED + problemDetails.getDetail());
+            resourceOperationStatusRepository.save(status);
+            if (terminateRsp.getStatus() == 406) {
+                throw new ApplicationException(HttpCode.NOT_ACCEPTABLE, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+            } else if (terminateRsp.getStatus() == 400) {
+                throw new ApplicationException(HttpCode.BAD_REQUEST, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+            } else if (terminateRsp.getStatus() == 404) {
+                throw new ApplicationException(HttpCode.NOT_FOUND, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+            } else if (terminateRsp.getStatus() == 409) {
+                LOGGER.error("The operation cannot be executed currently,\n"
+                        + "due to a conflict with the state of the resource");
+                throw new ApplicationException(HttpCode.RESPOND_CONFLICT, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+            } else if (terminateRsp.getStatus() == 500) {
+                throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+            } else {
+                throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_TERMINATE_NS);
+            }
+
+        }
+        instanceNfvoMapping.setJobId(jobId);
+        instanceNfvoMappingRepository.save(instanceNfvoMapping);
+        terminateRsp.setResponseContent(rsp.toString());
+        return terminateRsp;
+    }
+
+    /**
+     * get ns progress by job Id <br>
+     *
+     * @param nsOperationKey The OperationKey for NS resource
+     * @param jobId the job id
+     * @return
+     * @since ONAP Dublin Release
+     */
+    public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId) throws ApplicationException {
+
+        ValidateUtil.assertObjectNotNull(jobId);
+        // Step 1: query the current resource operation status
+        ResourceOperationStatus status = new ResourceOperationStatus(nsOperationKey.getServiceId(),
+                nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID());
+        // status = resourceOperationStatusRepository.findOne(Example.of(status))
+        // .orElseThrow(() -> new ApplicationException(404, "Cannot Find Operation Status"));
+
+        // Get NFVO details
+        instanceNfvoMapping = instanceNfvoMappingRepository.findOneByJobId(jobId);
+
+        // Step 2: start query
+        LOGGER.info("SOL005 query ns status -> begin");
+        String url = getUrl(jobId, CommonConstant.Step.QUERY);
+        String methodType = CommonConstant.MethodType.GET;
+        if (instanceNfvoMapping != null) {
+
+            url = instanceNfvoMapping.getEndpoint() + instanceNfvoMapping.getApiRoot() + url;
+
+        } else {
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_QUERY_JOB_STATUS);
+        }
+
+        // prepare restful parameters and options
+        RestfulResponse rsp = restfulUtil.send(url, methodType, "");
+        ValidateUtil.assertObjectNotNull(rsp);
+        LOGGER.info("query ns progress response status is : {}", rsp.getStatus());
+        LOGGER.info("query ns progress response content is : {}", rsp.getResponseContent());
+        // Step 3:check the response staus
+        if (!HttpCode.isSucess(rsp.getStatus())) {
+            LOGGER.info("fail to query job status");
+            ProblemDetails problemDetails = JsonUtil.unMarshal(rsp.getResponseContent(), ProblemDetails.class);
+            status.setErrorCode(String.valueOf(rsp.getStatus()));
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setStatusDescription(CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED + problemDetails.getDetail());
+            resourceOperationStatusRepository.save(status);
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_QUERY_JOB_STATUS);
+        }
+        // Step 4: Process Network Service Instantiate Response
+        NsLcmOpOcc nsProgress = JsonUtil.unMarshal(rsp.getResponseContent(), NsLcmOpOcc.class);
+        if (CommonConstant.operationState.FAILED.equals(nsProgress.getOperationState())) {
+            LOGGER.info("NS instantiate fails");
+            status.setErrorCode(String.valueOf(rsp.getStatus()));
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setStatusDescription(
+                    CommonConstant.StatusDesc.INSTANTIATE_NS_FAILED + nsProgress.getError().getDetail());
+            resourceOperationStatusRepository.save(status);
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_QUERY_JOB_STATUS);
+        }
+        // Step 5: update segment operation progress
+
+        if (nsProgress.getOperationState().equals(CommonConstant.operationState.PROCESSING)) {
+            status.setProgress("40");
+            status.setStatus(RequestsDbConstant.Status.PROCESSING);
+            status.setStatusDescription("NS operation is in progress");
+            resourceOperationStatusRepository.save(status);
+            updateOperationStatusBasedOnResourceStatus(status);
+        } else if (nsProgress.getOperationState().equals(CommonConstant.operationState.PARTIALLY_COMPLETED)) {
+            status.setProgress("60");
+            status.setStatus(RequestsDbConstant.Status.PROCESSING);
+            status.setStatusDescription("NS operation is partially completed");
+            resourceOperationStatusRepository.save(status);
+        } else if (nsProgress.getOperationState().equals(CommonConstant.operationState.COMPLETED)) {
+            status.setStatus(RequestsDbConstant.Status.FINISHED);
+            status.setProgress("100");
+            status.setStatusDescription("NS operation is Completed");
+            resourceOperationStatusRepository.save(status);
+            updateOperationStatusBasedOnResourceStatus(status);
+
+        } else if (nsProgress.getOperationState().equals(CommonConstant.operationState.FAILED)
+                || nsProgress.getOperationState().equals(CommonConstant.operationState.FAILED_TEMP)) {
+            status.setStatus(RequestsDbConstant.Status.ERROR);
+            status.setProgress("0");
+            status.setStatusDescription("NS operation Failed");
+            resourceOperationStatusRepository.save(status);
+            updateOperationStatusBasedOnResourceStatus(status);
+            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.JOB_STATUS_ERROR);
+        } else {
+            LOGGER.error("unexcepted response status");
+
+        }
+        return rsp;
+    }
+
+    /**
+     * get url for the operation <br>
+     *
+     * @param variable variable should be put in the url
+     * @param step step of the operation (terminate,query,delete)
+     * @return
+     * @since ONAP Dublin Release
+     */
+    private String getUrl(String variable, String step) {
+
+        String url;
+        String originalUrl;
+        originalUrl = nfvoUrlMap.get(step);
+        url = String.format(originalUrl, variable);
+        return url;
+
+    }
+
+    private void updateOperationStatusBasedOnResourceStatus(ResourceOperationStatus operStatus) {
+        String serviceId = operStatus.getServiceId();
+        String operationId = operStatus.getOperationId();
+
+        LOGGER.debug("Request database - update Operation Status Based On Resource Operation Status with service Id: "
+                + "{}, operationId: {}", serviceId, operationId);
+
+        List<ResourceOperationStatus> lstResourceStatus =
+                resourceOperationStatusRepository.findByServiceIdAndOperationId(serviceId, operationId);
+        if (lstResourceStatus == null) {
+            LOGGER.error("Unable to retrieve resourceOperStatus Object by ServiceId: {} operationId: {}", serviceId,
+                    operationId);
+            return;
+        }
+
+        // count the total progress
+        int resourceCount = lstResourceStatus.size();
+        int progress = 0;
+        boolean isFinished = true;
+        for (ResourceOperationStatus lstResourceStatu : lstResourceStatus) {
+            progress = progress + Integer.valueOf(lstResourceStatu.getProgress()) / resourceCount;
+            if (RequestsDbConstant.Status.PROCESSING.equals(lstResourceStatu.getStatus())) {
+                isFinished = false;
+            }
+        }
+
+        OperationStatus serviceOperStatus =
+                operationStatusRepository.findOneByServiceIdAndOperationId(serviceId, operationId);
+        if (serviceOperStatus == null) {
+            String error = "Entity not found. Unable to retrieve OperationStatus Object ServiceId: " + serviceId
+                    + " operationId: " + operationId;
+            LOGGER.error(error);
+
+            serviceOperStatus = new OperationStatus();
+            serviceOperStatus.setOperationId(operationId);
+            serviceOperStatus.setServiceId(serviceId);
+        }
+
+        progress = progress > 100 ? 100 : progress;
+        serviceOperStatus.setProgress(String.valueOf(progress));
+        serviceOperStatus.setOperationContent(operStatus.getStatusDescription());
+        // if current resource failed. service failed.
+        if (RequestsDbConstant.Status.ERROR.equals(operStatus.getStatus())) {
+            serviceOperStatus.setResult(RequestsDbConstant.Status.ERROR);
+            serviceOperStatus.setReason(operStatus.getStatusDescription());
+        } else if (isFinished) {
+            // if finished
+            serviceOperStatus.setResult(RequestsDbConstant.Status.FINISHED);
+            serviceOperStatus.setProgress(RequestsDbConstant.Progress.ONE_HUNDRED);
+        }
+
+        operationStatusRepository.save(serviceOperStatus);
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java
index 647fcaf..984cdb8 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java
@@ -26,8 +26,13 @@
 
 import java.net.HttpURLConnection;
 import java.net.SocketTimeoutException;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import javax.ws.rs.core.UriBuilder;
 import org.onap.so.logger.LoggingAnchor;
+import org.apache.http.Header;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.RequestConfig;
@@ -102,9 +107,10 @@
 
     }
 
-    public RestfulResponse send(String url, String methodType, String content) {
-        String msbUrl = getMsbHost() + url;
-        logger.debug("Begin to sent message {}: {}", methodType, msbUrl);
+
+    public RestfulResponse send(String msbUrl, String methodType, String content, Map<String, String> requestHeader) {
+        // String msbUrl = getMsbHost() + url;
+        logger.debug("Begin to sent message " + methodType + ": " + msbUrl);
 
         HttpRequestBase method = null;
         HttpResponse httpResponse = null;
@@ -115,9 +121,14 @@
             RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
                     .setConnectionRequestTimeout(timeout).build();
 
+            HttpClient client = HttpClientBuilder.create().build();
+
             if ("POST".equalsIgnoreCase(methodType)) {
                 HttpPost httpPost = new HttpPost(msbUrl);
                 httpPost.setConfig(requestConfig);
+                for (String key : requestHeader.keySet()) {
+                    httpPost.setHeader(key, requestHeader.get(key));
+                }
                 httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
                 method = httpPost;
             } else if ("PUT".equalsIgnoreCase(methodType)) {
@@ -135,11 +146,24 @@
                 method = httpDelete;
             }
 
-            httpResponse = client.execute(method);
+            // now VFC have no auth
+            // String userCredentials =
+            // SDNCAdapterProperties.getEncryptedProperty(Constants.SDNC_AUTH_PROP,
+            // Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
+            // String authorization = "Basic " +
+            // DatatypeConverter.printBase64Binary(userCredentials.getBytes());
+            // method.setHeader("Authorization", authorization);
 
+            httpResponse = client.execute(method);
+            Map<String, String> responseHeader = new HashMap<>();
             String responseContent = null;
             if (httpResponse.getEntity() != null) {
                 responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
+                Header[] httpResponseAllHeaders = httpResponse.getAllHeaders();
+                for (Header header : httpResponseAllHeaders) {
+                    responseHeader.put(header.getName(), header.getValue());
+
+                }
             }
 
             int statusCode = httpResponse.getStatusLine().getStatusCode();
@@ -163,7 +187,7 @@
             }
 
             method = null;
-            return createResponse(statusCode, responseContent);
+            return createResponse(statusCode, responseContent, responseHeader);
 
         } catch (SocketTimeoutException | ConnectTimeoutException e) {
             String errMsg = "Request to VFC timed out";
@@ -194,6 +218,154 @@
         }
     }
 
+    public RestfulResponse send(String msbUrl, String methodType, String content) {
+        if (!msbUrl.contains("http")) {
+            msbUrl = getMsbHost() + msbUrl;
+        }
+        // String msbUrl = getMsbHost() + url;
+        logger.debug("Begin to sent message " + methodType + ": " + msbUrl);
+
+        HttpRequestBase method = null;
+        HttpResponse httpResponse = null;
+
+        try {
+            int timeout = DEFAULT_TIME_OUT;
+
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
+                    .setConnectionRequestTimeout(timeout).build();
+
+            if ("POST".equalsIgnoreCase(methodType)) {
+                HttpPost httpPost = new HttpPost(msbUrl);
+                httpPost.setConfig(requestConfig);
+                httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
+                method = httpPost;
+            } else if ("PUT".equalsIgnoreCase(methodType)) {
+                HttpPut httpPut = new HttpPut(msbUrl);
+                httpPut.setConfig(requestConfig);
+                httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
+                method = httpPut;
+            } else if ("GET".equalsIgnoreCase(methodType)) {
+                HttpGet httpGet = new HttpGet(msbUrl);
+                httpGet.setConfig(requestConfig);
+                method = httpGet;
+            } else if ("DELETE".equalsIgnoreCase(methodType)) {
+                HttpDelete httpDelete = new HttpDelete(msbUrl);
+                httpDelete.setConfig(requestConfig);
+                method = httpDelete;
+            }
+
+            // now VFC have no auth
+            // String userCredentials =
+            // SDNCAdapterProperties.getEncryptedProperty(Constants.SDNC_AUTH_PROP,
+            // Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
+            // String authorization = "Basic " +
+            // DatatypeConverter.printBase64Binary(userCredentials.getBytes());
+            // method.setHeader("Authorization", authorization);
+
+            httpResponse = client.execute(method);
+            Map<String, String> responseHeader = new HashMap<>();
+            String responseContent = null;
+            if (httpResponse.getEntity() != null) {
+                responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
+                Header[] httpResponseAllHeaders = httpResponse.getAllHeaders();
+                for (Header header : httpResponseAllHeaders) {
+                    responseHeader.put(header.getName(), header.getValue());
+
+                }
+            }
+
+            int statusCode = httpResponse.getStatusLine().getStatusCode();
+            String statusMessage = httpResponse.getStatusLine().getReasonPhrase();
+
+            logger.debug("VFC Response: " + statusCode + " " + statusMessage
+                    + (responseContent == null ? "" : System.lineSeparator() + responseContent));
+
+            if (httpResponse.getStatusLine().getStatusCode() >= 300) {
+                String errMsg = "VFC returned " + statusCode + " " + statusMessage;
+                logError(errMsg);
+                return createResponse(statusCode, errMsg);
+            }
+
+            httpResponse = null;
+
+            if (null != method) {
+                method.reset();
+            } else {
+                logger.debug("method is NULL:");
+            }
+
+            method = null;
+            return createResponse(statusCode, responseContent, responseHeader);
+
+        } catch (SocketTimeoutException | ConnectTimeoutException e) {
+            String errMsg = "Request to VFC timed out";
+            logError(errMsg, e);
+            return createResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg);
+
+        } catch (Exception e) {
+            String errMsg = "Error processing request to VFC";
+            logError(errMsg, e);
+            return createResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, errMsg);
+
+        } finally {
+            if (httpResponse != null) {
+                try {
+                    EntityUtils.consume(httpResponse.getEntity());
+                } catch (Exception e) {
+                    logger.debug("Exception :", e);
+                }
+            }
+
+            if (method != null) {
+                try {
+                    method.reset();
+                } catch (Exception e) {
+                    logger.debug("Exception :", e);
+                }
+            }
+        }
+    }
+
+    public RestfulResponse getNfvoFromAAI(String nfvo) {
+        HttpRequestBase method = null;
+        HttpResponse httpResponse = null;
+        String endPoint = getMsbHost() + "/api/aai-esr-server/v1/nfvos/" + nfvo;
+        logger.info("Endpoint URL" + endPoint);
+        RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(DEFAULT_TIME_OUT)
+                .setConnectTimeout(DEFAULT_TIME_OUT).setConnectionRequestTimeout(DEFAULT_TIME_OUT).build();
+        HttpClient client = HttpClientBuilder.create().build();
+        HttpGet httpGet = new HttpGet(endPoint);
+        httpGet.setConfig(requestConfig);
+        String encoding = Base64.getEncoder().encodeToString(("AAI:AAI").getBytes());
+        httpGet.setHeader("Authorization", "Basic " + encoding);
+        method = httpGet;
+        String responseContent = null;
+        Map<String, String> responseHeader = null;
+        try {
+            httpResponse = client.execute(method);
+            if (httpResponse.getEntity() != null) {
+                responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
+            }
+
+            int statusCode = httpResponse.getStatusLine().getStatusCode();
+            String statusMessage = httpResponse.getStatusLine().getReasonPhrase();
+
+            logger.debug("AAI Response: " + statusCode + " " + statusMessage
+                    + (responseContent == null ? "" : System.lineSeparator() + responseContent));
+
+            if (httpResponse.getStatusLine().getStatusCode() >= 300) {
+                String errMsg = "AAI returned " + statusCode + " " + statusMessage;
+                logError(errMsg);
+                return createResponse(statusCode, errMsg);
+            }
+        } catch (Exception e) {
+            String errMsg = "Error processing request to AAI";
+            logError(errMsg, e);
+            return createResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, errMsg);
+        }
+        return createResponse(200, responseContent);
+    }
+
     private static void logError(String errMsg, Throwable t) {
         logger.error(LoggingAnchor.FOUR, MessageEnum.RA_NS_EXC.toString(), VFC_ADAPTER,
                 ErrorCode.AvailabilityError.getValue(), errMsg, t);
@@ -211,4 +383,12 @@
         return rsp;
     }
 
+    private static RestfulResponse createResponse(int statusCode, String content, Map<String, String> responseHeader) {
+        RestfulResponse rsp = new RestfulResponse();
+        rsp.setStatus(statusCode);
+        rsp.setRespHeaderMap(responseHeader);
+        rsp.setResponseContent(content);
+        return rsp;
+    }
+
 }
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddPnfDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddPnfDataTest.java
new file mode 100644
index 0000000..1fedac9
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddPnfDataTest.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class AddPnfDataTest {
+    AddPnfData pnfData = new AddPnfData();
+
+    @Test
+    public void getPnfId() {
+        pnfData.getPnfId();
+    }
+
+
+    @Test
+    public void setPnfId() {
+        pnfData.setPnfId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getPnfName() {
+        pnfData.getPnfName();
+    }
+
+    @Test
+    public void setPnfName() {
+        pnfData.setPnfName("Router");
+    }
+
+    @Test
+    public void getPnfdId() {
+        pnfData.getPnfdId();
+    }
+
+    @Test
+    public void setPnfdId() {
+        pnfData.setPnfdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getPnfProfileId() {
+        pnfData.getPnfProfileId();
+    }
+
+    @Test
+    public void setPnfProfileId() {
+        pnfData.setPnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getCpData() {
+        pnfData.getCpData();
+    }
+
+    @Test
+    public void setCpData() {
+        pnfData.setCpData(new List<PnfExtCpData>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<PnfExtCpData> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(PnfExtCpData pnfExtCpData) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends PnfExtCpData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends PnfExtCpData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public PnfExtCpData get(int index) {
+                return null;
+            }
+
+            @Override
+            public PnfExtCpData set(int index, PnfExtCpData element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, PnfExtCpData element) {
+
+            }
+
+            @Override
+            public PnfExtCpData remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<PnfExtCpData> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<PnfExtCpData> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<PnfExtCpData> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddressRangeTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddressRangeTest.java
new file mode 100644
index 0000000..9444efd
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddressRangeTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class AddressRangeTest {
+    AddressRange addressRange = new AddressRange();
+
+    @Test
+    public void getMinAddress() {
+        addressRange.getMinAddress();
+    }
+
+    @Test
+    public void setMinAddress() {
+        addressRange.setMinAddress("192.168.10.10");
+    }
+
+    @Test
+    public void getMaxAddress() {
+        addressRange.getMaxAddress();
+    }
+
+    @Test
+    public void setMaxAddress() {
+        addressRange.setMaxAddress("192.168.10.10");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedNsTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedNsTest.java
new file mode 100644
index 0000000..06c52e2
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedNsTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class AffectedNsTest {
+
+    AffectedNs affectedNs = new AffectedNs();
+
+    @Test
+    public void getNsInstanceId() {
+        affectedNs.getNsInstanceId();
+    }
+
+    @Test
+    public void setNsInstanceId() {
+        affectedNs.setNsInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getNsdId() {
+        affectedNs.getNsdId();
+    }
+
+    @Test
+    public void setNsdId() {
+        affectedNs.setNsdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedPnfTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedPnfTest.java
new file mode 100644
index 0000000..beecbe0
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedPnfTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class AffectedPnfTest {
+    AffectedPnf affectedPnf = new AffectedPnf();
+
+    @Test
+    public void getPnfid() {
+        affectedPnf.getPnfid();
+    }
+
+    @Test
+    public void setPnfid() {
+        affectedPnf.setPnfid("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getPnfdid() {
+        affectedPnf.getPnfdid();
+    }
+
+    @Test
+    public void setPnfdid() {
+        affectedPnf.setPnfdid("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getPnfProfileId() {
+        affectedPnf.getPnfProfileId();
+    }
+
+    @Test
+    public void setPnfProfileId() {
+        affectedPnf.setPnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getPnfName() {
+        affectedPnf.getPnfName();
+    }
+
+    @Test
+    public void setPnfName() {
+        affectedPnf.setPnfName("Router");
+    }
+
+    @Test
+    public void getCpInstanceId() {
+        affectedPnf.getCpInstanceId();
+    }
+
+    @Test
+    public void setCpInstanceId() {
+        affectedPnf.setCpInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedSapTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedSapTest.java
new file mode 100644
index 0000000..b96fe32
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedSapTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class AffectedSapTest {
+    AffectedSap affectedSap = new AffectedSap();
+
+    @Test
+    public void getSapInstanceId() {
+        affectedSap.getSapInstanceId();
+    }
+
+    @Test
+    public void setSapInstanceId() {
+        affectedSap.setSapInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getSapdId() {
+        affectedSap.getSapdId();
+    }
+
+    @Test
+    public void setSapdId() {
+        affectedSap.setSapdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getSapName() {
+        affectedSap.getSapName();
+    }
+
+    @Test
+    public void setSapName() {
+        affectedSap.setSapName("Dummy SAP");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVirtualLinkTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVirtualLinkTest.java
new file mode 100644
index 0000000..dbc6d08
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVirtualLinkTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class AffectedVirtualLinkTest {
+    AffectedVirtualLink affectedVirtualLink = new AffectedVirtualLink();
+
+    @Test
+    public void getNsVirtualLinkInstanceId() {
+        affectedVirtualLink.getNsVirtualLinkInstanceId();
+    }
+
+    @Test
+    public void setNsVirtualLinkInstanceId() {
+        affectedVirtualLink.setNsVirtualLinkInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getNsVirtualLinkDescId() {
+        affectedVirtualLink.getNsVirtualLinkDescId();
+    }
+
+    @Test
+    public void setNsVirtualLinkDescId() {
+        affectedVirtualLink.setNsVirtualLinkDescId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVlProfileId() {
+        affectedVirtualLink.getVlProfileId();
+    }
+
+    @Test
+    public void setVlProfileId() {
+        affectedVirtualLink.setVlProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnfTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnfTest.java
new file mode 100644
index 0000000..810f32d
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnfTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class AffectedVnfTest {
+    AffectedVnf affectedVnf = new AffectedVnf();
+
+    @Test
+    public void getVnfInstanceId() {
+        affectedVnf.getVnfInstanceId();
+    }
+
+    @Test
+    public void setVnfInstanceId() {
+        affectedVnf.setVnfInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnfdId() {
+        affectedVnf.getVnfdId();
+    }
+
+    @Test
+    public void setVnfdId() {
+        affectedVnf.setVnfdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnfProfileId() {
+        affectedVnf.getVnfProfileId();
+    }
+
+    @Test
+    public void setVnfProfileId() {
+        affectedVnf.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnfName() {
+        affectedVnf.getVnfName();
+    }
+
+    @Test
+    public void setVnfName() {
+        affectedVnf.setVnfName("Dummy Vnf Name");
+    }
+
+    @Test
+    public void getChangedInfo() {
+        affectedVnf.getChangedInfo();
+    }
+
+    @Test
+    public void setChangedInfo() {
+        affectedVnf.setChangedInfo(new ChangedInfo());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnffgTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnffgTest.java
new file mode 100644
index 0000000..0d56701
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnffgTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class AffectedVnffgTest {
+    AffectedVnffg affectedVnffg = new AffectedVnffg();
+
+    @Test
+    public void getVnffgInstanceId() {
+        affectedVnffg.getVnffgInstanceId();
+    }
+
+    @Test
+    public void setVnffgInstanceId() {
+        affectedVnffg.setVnffgInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnffgdId() {
+        affectedVnffg.getVnffgdId();
+    }
+
+    @Test
+    public void setVnffgdId() {
+        affectedVnffg.setVnffgdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRuleTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRuleTest.java
new file mode 100644
index 0000000..99a40e4
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRuleTest.java
@@ -0,0 +1,283 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class AffinityOrAntiAffinityRuleTest {
+    AffinityOrAntiAffinityRule affinityOrAntiAffinityRule = new AffinityOrAntiAffinityRule();
+
+    @Test
+    public void getVnfdId() {
+        affinityOrAntiAffinityRule.getVnfdId();
+    }
+
+    @Test
+    public void setVnfdId() {
+        affinityOrAntiAffinityRule.setVnfdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnfProfileId() {
+        affinityOrAntiAffinityRule.getVnfProfileId();
+    }
+
+    @Test
+    public void setVnfProfileId() {
+        affinityOrAntiAffinityRule.setVnfProfileId(new List<String>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<String> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(String s) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends String> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends String> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public String get(int index) {
+                return null;
+            }
+
+            @Override
+            public String set(int index, String element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, String element) {
+
+            }
+
+            @Override
+            public String remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<String> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<String> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<String> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getVnfInstanceId() {
+        affinityOrAntiAffinityRule.getVnfInstanceId();
+    }
+
+    @Test
+    public void setVnfInstanceId() {
+        affinityOrAntiAffinityRule.setVnfInstanceId(new List<String>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<String> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(String s) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends String> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends String> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public String get(int index) {
+                return null;
+            }
+
+            @Override
+            public String set(int index, String element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, String element) {
+
+            }
+
+            @Override
+            public String remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<String> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<String> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<String> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ChangedInfoTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ChangedInfoTest.java
new file mode 100644
index 0000000..41077fb
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ChangedInfoTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class ChangedInfoTest {
+    ChangedInfo changedInfo = new ChangedInfo();
+
+    @Test
+    public void getChangedVnfInfo() {
+        changedInfo.getChangedVnfInfo();
+    }
+
+    @Test
+    public void setChangedVnfInfo() {
+        changedInfo.setChangedVnfInfo(new ModifyVnfInfoData());
+    }
+
+    @Test
+    public void getChangedExtConnectivity() {
+        changedInfo.getChangedExtConnectivity();
+    }
+
+    @Test
+    public void setChangedExtConnectivity() {
+        changedInfo.setChangedExtConnectivity(new ExtVirtualLinkInfo());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CivicAddressElementTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CivicAddressElementTest.java
new file mode 100644
index 0000000..e9c011b
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CivicAddressElementTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class CivicAddressElementTest {
+    CivicAddressElement civicAddressElement = new CivicAddressElement();
+
+    @Test
+    public void getCaType() {
+        civicAddressElement.getCaType();
+    }
+
+    @Test
+    public void setCaType() {
+        civicAddressElement.setCaType(12);
+    }
+
+    @Test
+    public void getCaValue() {
+        civicAddressElement.getCaValue();
+    }
+
+    @Test
+    public void setCaValue() {
+        civicAddressElement.setCaValue("Dummy Ca value");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CpProtocolDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CpProtocolDataTest.java
new file mode 100644
index 0000000..e47d02c
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CpProtocolDataTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class CpProtocolDataTest {
+    CpProtocolData cpProtocolData = new CpProtocolData();
+
+    @Test
+    public void getLayerProtocol() {
+        cpProtocolData.getLayerProtocol();
+    }
+
+    @Test
+    public void setLayerProtocol() {
+        cpProtocolData.setLayerProtocol("BGP");
+    }
+
+    @Test
+    public void getIpOverEthernet() {
+        cpProtocolData.getIpOverEthernet();
+    }
+
+    @Test
+    public void setIpOverEthernet() {
+        cpProtocolData.setIpOverEthernet(new IpOverEthernetAddressData());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CreateNsRequestTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CreateNsRequestTest.java
new file mode 100644
index 0000000..a2a6ae4
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CreateNsRequestTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class CreateNsRequestTest {
+    CreateNsRequest createNsRequest = new CreateNsRequest();
+
+    @Test
+    public void getNsdId() {
+        createNsRequest.getNsdId();
+    }
+
+    @Test
+    public void setNsdId() {
+        createNsRequest.setNsdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getNsDescription() {
+        createNsRequest.getNsDescription();
+    }
+
+    @Test
+    public void setNsDescription() {
+        createNsRequest.setNsDescription("Dummy description");
+    }
+
+    @Test
+    public void getNsName() {
+        createNsRequest.getNsName();
+    }
+
+    @Test
+    public void setNsName() {
+        createNsRequest.setNsName("Dummy Name");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfoTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfoTest.java
new file mode 100644
index 0000000..92cec88
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfoTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class ExtLinkPortInfoTest {
+
+    ExtLinkPortInfo extLinkPortInfo = new ExtLinkPortInfo();
+
+    @Test
+    public void getId() {
+        extLinkPortInfo.getId();
+    }
+
+    @Test
+    public void setId() {
+        extLinkPortInfo.setId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getResourceHandle() {
+        extLinkPortInfo.getResourceHandle();
+    }
+
+    @Test
+    public void setResourceHandle() {
+        extLinkPortInfo.setResourceHandle(new ResourceHandle());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfoTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfoTest.java
new file mode 100644
index 0000000..c455b36
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfoTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class ExtVirtualLinkInfoTest {
+    ExtVirtualLinkInfo extVirtualLinkInfo = new ExtVirtualLinkInfo();
+
+    @Test
+    public void getId() {
+        extVirtualLinkInfo.getId();
+    }
+
+    @Test
+    public void setId() {
+        extVirtualLinkInfo.setId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getResourceHandle() {
+        extVirtualLinkInfo.getResourceHandle();
+    }
+
+    @Test
+    public void setResourceHandle() {
+        extVirtualLinkInfo.setResourceHandle(new ResourceHandle());
+    }
+
+    @Test
+    public void getExtLinkPorts() {
+        extVirtualLinkInfo.getExtLinkPorts();
+    }
+
+    @Test
+    public void setExtLinkPorts() {
+        extVirtualLinkInfo.setExtLinkPorts(new ExtLinkPortInfo());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/InstantiateNsRequestTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/InstantiateNsRequestTest.java
new file mode 100644
index 0000000..f27b041
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/InstantiateNsRequestTest.java
@@ -0,0 +1,413 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class InstantiateNsRequestTest {
+    InstantiateNsRequest instantiateNsRequest = new InstantiateNsRequest();
+
+    @Test
+    public void getNsFlavourId() {
+        instantiateNsRequest.getNsFlavourId();
+    }
+
+    @Test
+    public void setNsFlavourId() {
+        instantiateNsRequest.setNsFlavourId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getSapData() {
+        instantiateNsRequest.getSapData();
+    }
+
+    @Test
+    public void setSapData() {
+        instantiateNsRequest.setSapData(new List<SapData>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<SapData> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(SapData sapData) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends SapData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends SapData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public SapData get(int index) {
+                return null;
+            }
+
+            @Override
+            public SapData set(int index, SapData element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, SapData element) {
+
+            }
+
+            @Override
+            public SapData remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<SapData> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<SapData> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<SapData> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getAddpnfData() {
+        instantiateNsRequest.getAddpnfData();
+    }
+
+    @Test
+    public void setAddpnfData() {
+        instantiateNsRequest.setAddpnfData(new List<AddPnfData>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<AddPnfData> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(AddPnfData addPnfData) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends AddPnfData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends AddPnfData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public AddPnfData get(int index) {
+                return null;
+            }
+
+            @Override
+            public AddPnfData set(int index, AddPnfData element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, AddPnfData element) {
+
+            }
+
+            @Override
+            public AddPnfData remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<AddPnfData> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<AddPnfData> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<AddPnfData> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getVnfInstanceData() {
+        instantiateNsRequest.getVnfInstanceData();
+    }
+
+    @Test
+    public void setVnfInstanceData() {
+        instantiateNsRequest.setVnfInstanceData(new List<VnfInstanceData>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<VnfInstanceData> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(VnfInstanceData vnfInstanceData) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends VnfInstanceData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends VnfInstanceData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public VnfInstanceData get(int index) {
+                return null;
+            }
+
+            @Override
+            public VnfInstanceData set(int index, VnfInstanceData element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, VnfInstanceData element) {
+
+            }
+
+            @Override
+            public VnfInstanceData remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<VnfInstanceData> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<VnfInstanceData> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<VnfInstanceData> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getNestedNsInstanceId() {
+        instantiateNsRequest.getNestedNsInstanceId();
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpAddressesTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpAddressesTest.java
new file mode 100644
index 0000000..edf6346
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpAddressesTest.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class IpAddressesTest {
+    IpAddresses ipAddresses = new IpAddresses();
+
+    @Test
+    public void getType() {
+        ipAddresses.getType();
+    }
+
+    @Test
+    public void setType() {
+        ipAddresses.setType("Dummy Type");
+    }
+
+    @Test
+    public void getFixedAddresses() {
+        ipAddresses.getFixedAddresses();
+    }
+
+    @Test
+    public void setFixedAddresses() {
+        ipAddresses.setFixedAddresses(new List<String>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<String> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(String s) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends String> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends String> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public String get(int index) {
+                return null;
+            }
+
+            @Override
+            public String set(int index, String element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, String element) {
+
+            }
+
+            @Override
+            public String remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<String> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<String> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<String> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getNumDynamicAddresses() {
+        ipAddresses.getNumDynamicAddresses();
+    }
+
+    @Test
+    public void setNumDynamicAddresses() {
+        ipAddresses.setNumDynamicAddresses(5);
+    }
+
+    @Test
+    public void getAddressRange() {
+        ipAddresses.getAddressRange();
+    }
+
+    @Test
+    public void setAddressRange() {
+        ipAddresses.setAddressRange(new AddressRange());
+    }
+
+    @Test
+    public void getSubnetId() {
+        ipAddresses.getSubnetId();
+    }
+
+    @Test
+    public void setSubnetId() {
+        ipAddresses.setSubnetId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressDataTest.java
new file mode 100644
index 0000000..0088cdc
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressDataTest.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class IpOverEthernetAddressDataTest {
+    IpOverEthernetAddressData ipOverEthernetAddressData = new IpOverEthernetAddressData();
+
+    @Test
+    public void getMacAddress() {
+        ipOverEthernetAddressData.getMacAddress();
+    }
+
+    @Test
+    public void setMacAddress() {
+        ipOverEthernetAddressData.setMacAddress("4e:86:9f:62:c1:bf");
+    }
+
+    @Test
+    public void getIpAddresses() {
+        ipOverEthernetAddressData.getIpAddresses();
+    }
+
+    @Test
+    public void setIpAddresses() {
+        ipOverEthernetAddressData.setIpAddresses(new List<IpAddresses>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<IpAddresses> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(IpAddresses ipAddresses) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends IpAddresses> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends IpAddresses> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public IpAddresses get(int index) {
+                return null;
+            }
+
+            @Override
+            public IpAddresses set(int index, IpAddresses element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, IpAddresses element) {
+
+            }
+
+            @Override
+            public IpAddresses remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<IpAddresses> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<IpAddresses> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<IpAddresses> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinkTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinkTest.java
new file mode 100644
index 0000000..e447c85
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinkTest.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class LinkTest {
+    Link link = new Link();
+
+    @Test
+    public void getHref() {
+        link.getHref();
+    }
+
+    @Test
+    public void setHref() {
+        link.setHref("dummy href");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinksTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinksTest.java
new file mode 100644
index 0000000..aef87c4
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinksTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class LinksTest {
+    Links links = new Links();
+
+    @Test
+    public void getSelf() {
+        links.getSelf();
+    }
+
+    @Test
+    public void setSelf() {
+        links.setSelf(new Link());
+    }
+
+    @Test
+    public void getNsInstance() {
+        links.getNsInstance();
+    }
+
+    @Test
+    public void setNsInstance() {
+        links.setNsInstance(new Link());
+    }
+
+    @Test
+    public void getCancel() {
+        links.getCancel();
+    }
+
+    @Test
+    public void setCancel() {
+        links.setCancel(new Link());
+    }
+
+    @Test
+    public void getRetry() {
+        links.getRetry();
+    }
+
+    @Test
+    public void setRetry() {
+        links.setRetry(new Link());
+    }
+
+    @Test
+    public void getRollback() {
+        links.getRollback();
+    }
+
+    @Test
+    public void setRollback() {
+        links.setRollback(new Link());
+    }
+
+    @Test
+    public void getContinues() {
+        links.getContinues();
+    }
+
+    @Test
+    public void setContinues() {
+        links.setContinues(new Link());
+    }
+
+    @Test
+    public void getFail() {
+        links.getFail();
+    }
+
+    @Test
+    public void setFail() {
+        links.setFail(new Link());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LocationConstraintsTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LocationConstraintsTest.java
new file mode 100644
index 0000000..e68b12a
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LocationConstraintsTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class LocationConstraintsTest {
+    LocationConstraints locationConstraints = new LocationConstraints();
+
+    @Test
+    public void getCountryCode() {
+        locationConstraints.getCountryCode();
+    }
+
+    @Test
+    public void setCountryCode() {
+        locationConstraints.setCountryCode("IND");
+
+    }
+
+    @Test
+    public void getCivicAddressElement() {
+        locationConstraints.getCivicAddressElement();
+    }
+
+    @Test
+    public void setCivicAddressElement() {
+        locationConstraints.setCivicAddressElement(new CivicAddressElement());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoDataTest.java
new file mode 100644
index 0000000..c300923
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoDataTest.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.HashMap;
+import static org.junit.Assert.*;
+
+public class ModifyVnfInfoDataTest {
+    ModifyVnfInfoData modifyVnfInfoData = new ModifyVnfInfoData();
+
+    @Test
+    public void getVnfInstanceId() {
+        modifyVnfInfoData.getVnfInstanceId();
+    }
+
+    @Test
+    public void setVnfInstanceId() {
+        modifyVnfInfoData.setVnfInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnfInstanceName() {
+        modifyVnfInfoData.getVnfInstanceName();
+    }
+
+    @Test
+    public void setVnfInstanceName() {
+        modifyVnfInfoData.setVnfInstanceName("Dummy vnfInstanceName");
+    }
+
+    @Test
+    public void getVnfInstanceDescription() {
+        modifyVnfInfoData.getVnfInstanceDescription();
+    }
+
+    @Test
+    public void setVnfInstanceDescription() {
+        modifyVnfInfoData.setVnfInstanceDescription("Dummy vnfInstanceDescription");
+    }
+
+    @Test
+    public void getVnfPkgId() {
+        modifyVnfInfoData.getVnfPkgId();
+    }
+
+    @Test
+    public void setVnfPkgId() {
+        modifyVnfInfoData.setVnfPkgId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnfConfigurableProperties() {
+        modifyVnfInfoData.getVnfConfigurableProperties();
+    }
+
+    @Test
+    public void setVnfConfigurableProperties() {
+        modifyVnfInfoData.setVnfConfigurableProperties(new HashMap<>());
+    }
+
+    @Test
+    public void getMetadata() {
+        modifyVnfInfoData.getMetadata();
+    }
+
+    @Test
+    public void setMetadata() {
+        modifyVnfInfoData.setMetadata(new HashMap<>());
+    }
+
+    @Test
+    public void getExtensions() {
+        modifyVnfInfoData.getExtensions();
+    }
+
+    @Test
+    public void setExtensions() {
+        modifyVnfInfoData.setExtensions(new HashMap<>());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/NsLcmOpOccTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/NsLcmOpOccTest.java
new file mode 100644
index 0000000..f5d485a
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/NsLcmOpOccTest.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import org.onap.so.adapters.vfc.constant.CommonConstant;
+import java.time.LocalDateTime;
+import java.util.Date;
+import static org.junit.Assert.*;
+
+public class NsLcmOpOccTest {
+    NsLcmOpOcc nsLcmOpOcc = new NsLcmOpOcc();
+
+    @Test
+    public void getLcmOperationType() {
+        nsLcmOpOcc.getLcmOperationType();
+    }
+
+    @Test
+    public void setLcmOperationType() {
+        nsLcmOpOcc.setLcmOperationType(CommonConstant.lcmOperationType.INSTANTIATE);
+    }
+
+    @Test
+    public void getCancelMode() {
+        nsLcmOpOcc.getCancelMode();
+    }
+
+    @Test
+    public void setCancelMode() {
+        nsLcmOpOcc.setCancelMode(CommonConstant.cancelMode.GRACEFUL);
+    }
+
+    @Test
+    public void getOperationState() {
+        nsLcmOpOcc.getOperationState();
+    }
+
+    @Test
+    public void setOperationState() {
+        nsLcmOpOcc.setOperationState(CommonConstant.operationState.COMPLETED);
+    }
+
+    @Test
+    public void getId() {
+        nsLcmOpOcc.getId();
+    }
+
+    @Test
+    public void setId() {
+        nsLcmOpOcc.setId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getStatusEnteredTime() {
+        nsLcmOpOcc.getStatusEnteredTime();
+    }
+
+    @Test
+    public void setStatusEnteredTime() {
+        nsLcmOpOcc.setStatusEnteredTime(LocalDateTime.now().toString());
+    }
+
+    @Test
+    public void getNsInstanceId() {
+        nsLcmOpOcc.getNsInstanceId();
+    }
+
+    @Test
+    public void setNsInstanceId() {
+        nsLcmOpOcc.setNsInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getStartTime() {
+        nsLcmOpOcc.getStartTime();
+    }
+
+    @Test
+    public void setStartTime() {
+        nsLcmOpOcc.setStartTime(LocalDateTime.now().toString());
+    }
+
+    @Test
+    public void getAutomaticInvocation() {
+        nsLcmOpOcc.getAutomaticInvocation();
+    }
+
+    @Test
+    public void setAutomaticInvocation() {
+        nsLcmOpOcc.setAutomaticInvocation(true);
+    }
+
+    @Test
+    public void getOperationParams() {
+        nsLcmOpOcc.getOperationParams();
+    }
+
+    @Test
+    public void setOperationParams() {
+        nsLcmOpOcc.setOperationParams("Dummy operationParams");
+    }
+
+    @Test
+    public void getCancelPending() {
+        nsLcmOpOcc.getCancelPending();
+    }
+
+    @Test
+    public void setCancelPending() {
+        nsLcmOpOcc.setCancelPending(true);
+    }
+
+    @Test
+    public void getError() {
+        nsLcmOpOcc.getError();
+    }
+
+    @Test
+    public void setError() {
+        nsLcmOpOcc.setError(new ProblemDetails());
+    }
+
+    @Test
+    public void getLinks() {
+        nsLcmOpOcc.getLinks();
+    }
+
+    @Test
+    public void setLinks() {
+        nsLcmOpOcc.setLinks(new Links());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ParamsForVnfTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ParamsForVnfTest.java
new file mode 100644
index 0000000..e0455b0
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ParamsForVnfTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.HashMap;
+import static org.junit.Assert.*;
+
+public class ParamsForVnfTest {
+
+    ParamsForVnf paramsForVnf = new ParamsForVnf();
+
+    @Test
+    public void getVnfProfileId() {
+        paramsForVnf.getVnfProfileId();
+    }
+
+    @Test
+    public void setVnfProfileId() {
+        paramsForVnf.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getAdditionalParams() {
+        paramsForVnf.getAdditionalParams();
+    }
+
+    @Test
+    public void setAdditionalParams() {
+        paramsForVnf.setAdditionalParams(new HashMap<>());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/PnfExtCpDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/PnfExtCpDataTest.java
new file mode 100644
index 0000000..c586c7e
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/PnfExtCpDataTest.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class PnfExtCpDataTest {
+    PnfExtCpData pnfExtCpData = new PnfExtCpData();
+
+    @Test
+    public void getCpInstanceI16() {
+        pnfExtCpData.getCpInstanceI16();
+    }
+
+    @Test
+    public void setCpInstanceI16() {
+        pnfExtCpData.setCpInstanceI16("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getCpdId() {
+        pnfExtCpData.getCpdId();
+    }
+
+    @Test
+    public void setCpdId() {
+        pnfExtCpData.setCpdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getCpProtocolData() {
+        pnfExtCpData.getCpProtocolData();
+    }
+
+    @Test
+    public void setCpProtocolData() {
+        pnfExtCpData.setCpProtocolData(new List<CpProtocolData>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<CpProtocolData> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(CpProtocolData cpProtocolData) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends CpProtocolData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends CpProtocolData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public CpProtocolData get(int index) {
+                return null;
+            }
+
+            @Override
+            public CpProtocolData set(int index, CpProtocolData element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, CpProtocolData element) {
+
+            }
+
+            @Override
+            public CpProtocolData remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<CpProtocolData> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<CpProtocolData> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<CpProtocolData> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ProblemDetailsTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ProblemDetailsTest.java
new file mode 100644
index 0000000..ddea6cc
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ProblemDetailsTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class ProblemDetailsTest {
+    ProblemDetails problemDetails = new ProblemDetails();
+
+    @Test
+    public void getType() {
+        problemDetails.getType();
+    }
+
+    @Test
+    public void setType() {
+        problemDetails.setType("Dummy Type");
+    }
+
+    @Test
+    public void getTitle() {
+        problemDetails.getTitle();
+    }
+
+    @Test
+    public void setTitle() {
+        problemDetails.setTitle("Dummy Title");
+    }
+
+    @Test
+    public void getStatus() {
+        problemDetails.getStatus();
+    }
+
+    @Test
+    public void setStatus() {
+        problemDetails.setStatus(200);
+    }
+
+    @Test
+    public void getDetail() {
+        problemDetails.getDetail();
+    }
+
+    @Test
+    public void setDetail() {
+        problemDetails.setTitle("Dummy Title");
+    }
+
+    @Test
+    public void getInstance() {
+        problemDetails.getInstance();
+    }
+
+    @Test
+    public void setInstance() {
+        problemDetails.setInstance("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceChangesTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceChangesTest.java
new file mode 100644
index 0000000..9c4a029
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceChangesTest.java
@@ -0,0 +1,773 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class ResourceChangesTest {
+    ResourceChanges resourceChanges = new ResourceChanges();
+
+    @Test
+    public void getAffectedVnfs() {
+        resourceChanges.getAffectedVnfs();
+    }
+
+    @Test
+    public void setAffectedVnfs() {
+        resourceChanges.setAffectedVnfs(new List<AffectedVnf>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<AffectedVnf> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(AffectedVnf affectedVnf) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends AffectedVnf> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends AffectedVnf> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public AffectedVnf get(int index) {
+                return null;
+            }
+
+            @Override
+            public AffectedVnf set(int index, AffectedVnf element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, AffectedVnf element) {
+
+            }
+
+            @Override
+            public AffectedVnf remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<AffectedVnf> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<AffectedVnf> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<AffectedVnf> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getAffectedPnfs() {
+        resourceChanges.getAffectedPnfs();
+    }
+
+    @Test
+    public void setAffectedPnfs() {
+        resourceChanges.setAffectedPnfs(new List<AffectedPnf>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<AffectedPnf> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(AffectedPnf affectedPnf) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends AffectedPnf> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends AffectedPnf> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public AffectedPnf get(int index) {
+                return null;
+            }
+
+            @Override
+            public AffectedPnf set(int index, AffectedPnf element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, AffectedPnf element) {
+
+            }
+
+            @Override
+            public AffectedPnf remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<AffectedPnf> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<AffectedPnf> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<AffectedPnf> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getAffectedVls() {
+        resourceChanges.getAffectedVls();
+    }
+
+    @Test
+    public void setAffectedVls() {
+        resourceChanges.setAffectedVls(new List<AffectedVirtualLink>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<AffectedVirtualLink> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(AffectedVirtualLink affectedVirtualLink) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends AffectedVirtualLink> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends AffectedVirtualLink> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public AffectedVirtualLink get(int index) {
+                return null;
+            }
+
+            @Override
+            public AffectedVirtualLink set(int index, AffectedVirtualLink element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, AffectedVirtualLink element) {
+
+            }
+
+            @Override
+            public AffectedVirtualLink remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<AffectedVirtualLink> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<AffectedVirtualLink> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<AffectedVirtualLink> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getAffectedVnffgs() {
+        resourceChanges.getAffectedVnffgs();
+    }
+
+    @Test
+    public void setAffectedVnffgs() {
+        resourceChanges.setAffectedVnffgs(new List<AffectedVnffg>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<AffectedVnffg> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(AffectedVnffg affectedVnffg) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends AffectedVnffg> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends AffectedVnffg> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public AffectedVnffg get(int index) {
+                return null;
+            }
+
+            @Override
+            public AffectedVnffg set(int index, AffectedVnffg element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, AffectedVnffg element) {
+
+            }
+
+            @Override
+            public AffectedVnffg remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<AffectedVnffg> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<AffectedVnffg> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<AffectedVnffg> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getAffectedNss() {
+        resourceChanges.getAffectedNss();
+    }
+
+    @Test
+    public void setAffectedNss() {
+        resourceChanges.setAffectedNss(new List<AffectedNs>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<AffectedNs> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(AffectedNs affectedNs) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends AffectedNs> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends AffectedNs> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public AffectedNs get(int index) {
+                return null;
+            }
+
+            @Override
+            public AffectedNs set(int index, AffectedNs element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, AffectedNs element) {
+
+            }
+
+            @Override
+            public AffectedNs remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<AffectedNs> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<AffectedNs> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<AffectedNs> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void getAffectedSaps() {
+        resourceChanges.getAffectedSaps();
+    }
+
+    @Test
+    public void setAffectedSaps() {
+        resourceChanges.setAffectedSaps(new List<AffectedSap>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<AffectedSap> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(AffectedSap affectedSap) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends AffectedSap> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends AffectedSap> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public AffectedSap get(int index) {
+                return null;
+            }
+
+            @Override
+            public AffectedSap set(int index, AffectedSap element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, AffectedSap element) {
+
+            }
+
+            @Override
+            public AffectedSap remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<AffectedSap> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<AffectedSap> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<AffectedSap> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceHandleTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceHandleTest.java
new file mode 100644
index 0000000..6390c5a
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceHandleTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class ResourceHandleTest {
+    ResourceHandle resourceHandle = new ResourceHandle();
+
+    @Test
+    public void getVimId() {
+        resourceHandle.getVimId();
+    }
+
+    @Test
+    public void setVimId() {
+        resourceHandle.setVimId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getResourceProviderId() {
+        resourceHandle.getResourceProviderId();
+    }
+
+    @Test
+    public void setResourceProviderId() {
+        resourceHandle.setResourceProviderId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getResourceId() {
+        resourceHandle.getResourceId();
+    }
+
+    @Test
+    public void setResourceId() {
+        resourceHandle.setResourceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVimLevelResourceType() {
+        resourceHandle.getVimLevelResourceType();
+    }
+
+    @Test
+    public void setVimLevelResourceType() {
+        resourceHandle.setVimLevelResourceType("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/SapDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/SapDataTest.java
new file mode 100644
index 0000000..2a45599
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/SapDataTest.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import static org.junit.Assert.*;
+
+public class SapDataTest {
+
+    SapData sapData = new SapData();
+
+    @Test
+    public void getSapdId() {
+        sapData.getSapdId();
+    }
+
+    @Test
+    public void setSapdId() {
+        sapData.setSapdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getSapName() {
+        sapData.getSapName();
+    }
+
+    @Test
+    public void setSapName() {
+        sapData.setSapName("Dummy SapName");
+    }
+
+    @Test
+    public void getDescription() {
+        sapData.getDescription();
+    }
+
+    @Test
+    public void setDescription() {
+        sapData.setDescription("Dummy Description");
+    }
+
+    @Test
+    public void getSapProtocolData() {
+        sapData.getSapProtocolData();
+    }
+
+    @Test
+    public void setSapProtocolData() {
+        sapData.setSapProtocolData(new List<CpProtocolData>() {
+            @Override
+            public int size() {
+                return 0;
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return false;
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return false;
+            }
+
+            @Override
+            public Iterator<CpProtocolData> iterator() {
+                return null;
+            }
+
+            @Override
+            public Object[] toArray() {
+                return new Object[0];
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                return null;
+            }
+
+            @Override
+            public boolean add(CpProtocolData cpProtocolData) {
+                return false;
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return false;
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends CpProtocolData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean addAll(int index, Collection<? extends CpProtocolData> c) {
+                return false;
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return false;
+            }
+
+            @Override
+            public void clear() {
+
+            }
+
+            @Override
+            public CpProtocolData get(int index) {
+                return null;
+            }
+
+            @Override
+            public CpProtocolData set(int index, CpProtocolData element) {
+                return null;
+            }
+
+            @Override
+            public void add(int index, CpProtocolData element) {
+
+            }
+
+            @Override
+            public CpProtocolData remove(int index) {
+                return null;
+            }
+
+            @Override
+            public int indexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public int lastIndexOf(Object o) {
+                return 0;
+            }
+
+            @Override
+            public ListIterator<CpProtocolData> listIterator() {
+                return null;
+            }
+
+            @Override
+            public ListIterator<CpProtocolData> listIterator(int index) {
+                return null;
+            }
+
+            @Override
+            public List<CpProtocolData> subList(int fromIndex, int toIndex) {
+                return null;
+            }
+        });
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfInstanceDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfInstanceDataTest.java
new file mode 100644
index 0000000..b9bdfe3
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfInstanceDataTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class VnfInstanceDataTest {
+    VnfInstanceData vnfInstanceData = new VnfInstanceData();
+
+    @Test
+    public void getVnfInstanceId() {
+        vnfInstanceData.getVnfInstanceId();
+    }
+
+    @Test
+    public void setVnfInstanceId() {
+        vnfInstanceData.setVnfInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getVnfProfileId() {
+        vnfInstanceData.getVnfProfileId();
+    }
+
+    @Test
+    public void setVnfProfileId() {
+        vnfInstanceData.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfLocationConstraintTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfLocationConstraintTest.java
new file mode 100644
index 0000000..b8f9b8e
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfLocationConstraintTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.model;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class VnfLocationConstraintTest {
+    VnfLocationConstraint vnfLocationConstraint = new VnfLocationConstraint();
+
+    @Test
+    public void getVnfProfileId() {
+        vnfLocationConstraint.getVnfProfileId();
+    }
+
+    @Test
+    public void setVnfProfileId() {
+        vnfLocationConstraint.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d");
+    }
+
+    @Test
+    public void getLocationConstraints() {
+        vnfLocationConstraint.getLocationConstraints();
+    }
+
+    @Test
+    public void setLocationConstraints() {
+        vnfLocationConstraint.setLocationConstraints(new LocationConstraint());
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005Test.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005Test.java
new file mode 100644
index 0000000..799283d
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005Test.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2019 Verizon. 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.
+ */
+
+package org.onap.so.adapters.vfc.rest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.so.adapters.vfc.exceptions.ApplicationException;
+import org.onap.so.adapters.vfc.model.NSResourceInputParameter;
+import org.onap.so.adapters.vfc.model.RestfulResponse;
+import org.onap.so.adapters.vfc.util.JsonUtil;
+import org.onap.so.adapters.vfc.util.RestfulUtil;
+import org.onap.so.db.request.beans.InstanceNfvoMapping;
+import org.onap.so.db.request.beans.OperationStatus;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.data.repository.InstanceNfvoMappingRepository;
+import org.onap.so.db.request.data.repository.OperationStatusRepository;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.springframework.test.context.junit4.SpringRunner;
+import java.io.File;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import static org.mockito.Mockito.when;
+
+@RunWith(SpringRunner.class)
+public class VfcManagerSol005Test {
+    @InjectMocks
+    VfcManagerSol005 vfcManagerSol005;
+
+    @Mock
+    InstanceNfvoMappingRepository instanceNfvoMappingRepository;
+
+    @Mock
+    ResourceOperationStatusRepository resourceOperationStatusRepository;
+
+    @Mock
+    OperationStatusRepository operationStatusRepository;
+
+    @Mock
+    RestfulUtil restfulUtil;
+
+    OperationStatus operationStatus = new OperationStatus();
+
+    InstanceNfvoMapping instanceNfvoMapping = new InstanceNfvoMapping();
+    RestfulResponse restfulResponse = new RestfulResponse();
+    RestfulResponse vfcrestfulResponse = new RestfulResponse();
+    NSResourceInputParameter nsResourceInputParameter = new NSResourceInputParameter();
+    ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();
+
+    @Test
+    public void createNs() throws ApplicationException, Exception {
+        restfulResponse.setStatus(200);
+        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+
+        File file = new File(classLoader.getResource("json/createNsReq.json").getFile());
+        String content = new String(Files.readAllBytes(file.toPath())).replace("\n", "");
+        nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class);
+        file = new File(classLoader.getResource("json/aainfvoResponse.json").getFile());
+        content = new String(Files.readAllBytes(file.toPath())).replace("\n", "");
+        restfulResponse.setResponseContent(content);
+        // restfulResponse.setResponseContent("{\"nfvoId\":\"6ee79fe2-9579-475a-9bb9-20cf4358a19e\",\"name\":\"external_nfvo\",\"api-root\":\"xyz\",\"vendor\":\"vz\",\"version\":\"v1.0\",\"url\":\"http://sample.com/\",\"userName\":\"admin\",\"password\":\"sacjnasnc\"}");
+        file = new File(classLoader.getResource("json/createNsSol005Response.json").getFile());
+        content = new String(Files.readAllBytes(file.toPath())).replace("\n", "");
+        vfcrestfulResponse.setStatus(202);
+        vfcrestfulResponse.setResponseContent(content);
+        // vfcrestfulResponse.setResponseContent("{\"_links\": {\"heal\": {\"href\": \"\"}, \"instantiate\": {\"href\":
+        // \"\"}, \"nestedNsInstances\": {\"href\": \"\"}, \"scale\": {\"href\": \"\"}, \"self\": {\"href\": \"\"},
+        // \"terminate\": {\"href\": \"\"}, \"update\": {\"href\": \"\"}}, \"additionalAffinityOrAntiAffiniityRule\":
+        // [{\"Scope\": \"\", \"affinityOrAntiAffiinty\": \"\", \"vnfInstanceId\": [], \"vnfProfileId\": [], \"vnfdId\":
+        // []}], \"flavourId\": \"\", \"id\": \"c9f0a95e-dea0-4698-96e5-5a79bc5a233d\", \"nestedNsInstanceId\": [],
+        // \"nsInstanceDescription\": \"\", \"nsInstanceName\": \"\", \"nsScaleStatus\": [{\"nsScaleLevelId\": \"\",
+        // \"nsScalingAspectId\": \"\"}], \"nsState\": \"\", \"nsdId\": \"\", \"nsdInfoId\": \"\", \"pnfInfo\":
+        // [{\"cpInfo\": [{\"cpInstanceId\": \"\", \"cpProtocolData\": {\"ipOverEthernet\": {\"ipAddresses\":
+        // {\"addressRange\": {\"maxAddress\": \"\", \"minAddress\": \"\"}, \"fixedAddresses\": \"\",
+        // \"numDynamicAddresses\": 1, \"subnetId\": \"\", \"type\": \"\"}, \"macAddress\": {}}, \"layerProtocol\":
+        // \"IP_OVER_ETHERNET\"}, \"cpdId\": \"\"}], \"pnfId\": \"\", \"pnfName\": \"\", \"pnfProfileId\": \"\",
+        // \"pnfdId\": \"\", \"pnfdInfoId\": \"\"}], \"sapInfo\": [{\"description\": \"\", \"id\": \"\", \"sapName\":
+        // \"\", \"sapProtocolInfo\": {\"ipOverEthernet\": {\"ipAddresses\": {\"addressRange\": {\"maxAddress\": \"\",
+        // \"minAddress\": \"\"}, \"fixedAddresses\": \"\", \"numDynamicAddresses\": 1, \"subnetId\": \"\", \"type\":
+        // \"\"}, \"macAddress\": \"\"}, \"layerProtocol\": \"IP_OVER_ETHERNET\"}, \"sapdId\": \"\"}],
+        // \"virtualLinkInfo\": [{\"id\": \"\", \"linkPort\": [{\"id\": \"\", \"resourceHandle\": {\"resourceId\": \"\",
+        // \"resourceProviderId\": \"\", \"vimId\": \"\", \"vimLevelResourceType\": \"\"}}], \"nsVirtualLinkDescId\":
+        // \"\", \"resourceHandle\": [{\"resourceId\": \"\", \"resourceProviderId\": \"\", \"vimId\": \"\",
+        // \"vimLevelResourceType\": \"\"}]}], \"vnfInstance\": [{\"vnfInstanceId\": \"\", \"vnfProfileId\": \"\"}],
+        // \"vnffgInfo\": [{\"id\": \"\", \"nfpInfo\": [{\"description\": \"\", \"id\": \"\", \"nfpName\": \"\",
+        // \"nfpRule\": {\"destinationIpAddressPrefix\": \"\", \"destinationPortRange\": \"\", \"dscp\": \"\",
+        // \"etherDestinationAddress\": \"\", \"etherSourceAddress\": \"\", \"etherType\": \"\", \"extendedCriteria\":
+        // [{\"length\": 1, \"startingPoint\": 1, \"value\": \"\"}], \"protocol\": \"\", \"sourceIpAddressPrefix\":
+        // \"\", \"sourcePortRange\": \"\", \"vlanTag\": []}, \"nfpState\": \"\", \"nfpdId\": \"\", \"nscpHandle\":
+        // [{\"nsInstanceId\": \"\", \"nsSapInstanceId\": \"\", \"pnfExtCpInstanceId\": \"\", \"pnfInfoId\": \"\",
+        // \"vnfExtCpInstanceId\": \"\", \"vnfInstanceId\": \"\"}], \"totalCp\": 1}], \"nsCpHandle\":
+        // [{\"nsInstanceId\": \"\", \"nsSapInstanceId\": \"\", \"pnfExtCpInstanceId\": \"\", \"pnfInfoId\": \"\",
+        // \"vnfExtCpInstanceId\": \"\", \"vnfInstanceId\": \"\"}], \"nsVirtualLinkInfoId\": [], \"pnfInfoId\": [],
+        // \"vnfInstanceId\": [], \"vnffgdId\": \"\"}]}");
+
+        resourceOperationStatus.setStatus("processing");
+        resourceOperationStatus.setOperationId(nsResourceInputParameter.getNsOperationKey().getOperationId());
+        resourceOperationStatus.setServiceId(nsResourceInputParameter.getNsOperationKey().getServiceId());
+        resourceOperationStatus
+                .setResourceTemplateUUID(nsResourceInputParameter.getNsOperationKey().getNodeTemplateUUID());
+        when(instanceNfvoMappingRepository.save(instanceNfvoMapping)).thenReturn(instanceNfvoMapping);
+        when(restfulUtil.getNfvoFromAAI("b1bb0ce7-2222-4fa7-95ed-4840d70a1101")).thenReturn(restfulResponse);
+        when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyMap()))
+                .thenReturn(vfcrestfulResponse);
+        when(resourceOperationStatusRepository.save(resourceOperationStatus)).thenReturn(resourceOperationStatus);
+        vfcManagerSol005.createNs(nsResourceInputParameter);
+
+    }
+
+    @Test
+    public void terminateNs() throws Exception {
+        instanceNfvoMapping.setInstanceId("b1bb0ce7-2222-4fa7-95ed-4840d70a1101");
+        instanceNfvoMapping.setPassword("sacjnasnc");
+        instanceNfvoMapping.setUsername("admin");
+        instanceNfvoMapping.setNfvoName("external_nfvo");
+        instanceNfvoMapping.setEndpoint("http://sample.com/");
+        instanceNfvoMapping.setApiRoot("xyz");
+        String nsInstanceId = "c9f0a95e-dea0-4698-96e5-5a79bc5a233d";
+        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+        File file = new File(classLoader.getResource("json/createNsReq.json").getFile());
+        String content = new String(Files.readAllBytes(file.toPath())).replace("\n", "");
+        nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class);
+        Map<String, String> header = new HashMap<>();
+        header.put("Location", "http://192.168.10.57:5000/ns_lcm_op_ops/12204a12-7da2-4ddf-8c2f-992a1a1acebf");
+        vfcrestfulResponse.setStatus(202);
+        vfcrestfulResponse.setResponseContent(null);
+        vfcrestfulResponse.setRespHeaderMap(header);
+        when(instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId)).thenReturn(instanceNfvoMapping);
+        when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString()))
+                .thenReturn(vfcrestfulResponse);
+        vfcManagerSol005.terminateNs(nsResourceInputParameter.getNsOperationKey(), nsInstanceId);
+    }
+
+    @Test
+    public void getNsProgress() throws Exception {
+        String jobId = "12204a12-7da2-4ddf-8c2f-992a1a1acebf";
+        instanceNfvoMapping.setInstanceId("b1bb0ce7-2222-4fa7-95ed-4840d70a1101");
+        instanceNfvoMapping.setPassword("sacjnasnc");
+        instanceNfvoMapping.setUsername("admin");
+        instanceNfvoMapping.setNfvoName("external_nfvo");
+        instanceNfvoMapping.setEndpoint("http://sample.com/");
+        instanceNfvoMapping.setApiRoot("xyz");
+        instanceNfvoMapping.setJobId(jobId);
+        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+        File file = new File(classLoader.getResource("json/createNsReq.json").getFile());
+        String content = new String(Files.readAllBytes(file.toPath())).replace("\n", "");
+        nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class);
+        operationStatus.setProgress("40");
+        operationStatus.setServiceId(nsResourceInputParameter.getNsOperationKey().getServiceId());
+        operationStatus.setOperationId(nsResourceInputParameter.getNsOperationKey().getOperationId());
+        ResourceOperationStatus resourceOperationStatus =
+                new ResourceOperationStatus(nsResourceInputParameter.getNsOperationKey().getServiceId(),
+                        nsResourceInputParameter.getNsOperationKey().getOperationId(),
+                        nsResourceInputParameter.getNsOperationKey().getNodeTemplateUUID());
+        file = new File(classLoader.getResource("json/lcmOperRsp.json").getFile());
+        content = new String(Files.readAllBytes(file.toPath())).replace("\n", "");
+        vfcrestfulResponse.setStatus(202);
+        vfcrestfulResponse.setResponseContent(content);
+        List<ResourceOperationStatus> resourceOperationStatuses = new ArrayList<>();
+        resourceOperationStatuses.add(resourceOperationStatus);
+        when(instanceNfvoMappingRepository.findOneByJobId(jobId)).thenReturn(instanceNfvoMapping);
+        when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString()))
+                .thenReturn(vfcrestfulResponse);
+        when(operationStatusRepository.findOneByServiceIdAndOperationId(
+                nsResourceInputParameter.getNsOperationKey().getServiceId(),
+                nsResourceInputParameter.getNsOperationKey().getOperationId())).thenReturn(operationStatus);
+        when(resourceOperationStatusRepository.findByServiceIdAndOperationId(
+                nsResourceInputParameter.getNsOperationKey().getServiceId(),
+                nsResourceInputParameter.getNsOperationKey().getOperationId())).thenReturn(resourceOperationStatuses);
+        when(operationStatusRepository.save(operationStatus)).thenReturn(operationStatus);
+        vfcManagerSol005.getNsProgress(nsResourceInputParameter.getNsOperationKey(), jobId);
+
+    }
+
+    @Test
+    public void instantiateNs() throws Exception {
+        String nsInstanceId = "c9f0a95e-dea0-4698-96e5-5a79bc5a233d";
+        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+        File file = new File(classLoader.getResource("json/createNsReq.json").getFile());
+        String content = new String(Files.readAllBytes(file.toPath())).replace("\n", "");
+        nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class);
+        instanceNfvoMapping.setInstanceId("b1bb0ce7-2222-4fa7-95ed-4840d70a1101");
+        instanceNfvoMapping.setPassword("sacjnasnc");
+        instanceNfvoMapping.setUsername("admin");
+        instanceNfvoMapping.setNfvoName("external_nfvo");
+        instanceNfvoMapping.setEndpoint("http://sample.com/");
+        instanceNfvoMapping.setApiRoot("xyz");
+        resourceOperationStatus.setStatus("processing");
+        resourceOperationStatus.setOperationId(nsResourceInputParameter.getNsOperationKey().getOperationId());
+        resourceOperationStatus.setServiceId(nsResourceInputParameter.getNsOperationKey().getServiceId());
+        resourceOperationStatus
+                .setResourceTemplateUUID(nsResourceInputParameter.getNsOperationKey().getNodeTemplateUUID());
+        Map<String, String> header = new HashMap<>();
+        header.put("Location", "http://192.168.10.57:5000/ns_lcm_op_ops/12204a12-7da2-4ddf-8c2f-992a1a1acebf");
+        vfcrestfulResponse.setStatus(202);
+        vfcrestfulResponse.setResponseContent(null);
+        vfcrestfulResponse.setRespHeaderMap(header);
+        when(instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId)).thenReturn(instanceNfvoMapping);
+        when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString()))
+                .thenReturn(vfcrestfulResponse);
+        when(resourceOperationStatusRepository.save(resourceOperationStatus)).thenReturn(resourceOperationStatus);
+        when(instanceNfvoMappingRepository.save(instanceNfvoMapping)).thenReturn(instanceNfvoMapping);
+        vfcManagerSol005.instantiateNs(nsInstanceId, nsResourceInputParameter);
+
+    }
+}
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java
index c388016..4b6baa5 100644
--- a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java
@@ -22,6 +22,8 @@
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
+import org.apache.http.Header;
+import org.apache.http.message.BasicHeader;
 import org.apache.http.StatusLine;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpDelete;
@@ -59,21 +61,27 @@
     private HttpEntity httpEntity;
     private HttpResponse httpResponse;
     private StatusLine statusLine;
+    private Header httpResponseHeader;
 
     @Before
     public void setUp() {
         httpEntity = mock(HttpEntity.class);
         httpResponse = mock(HttpResponse.class);
         statusLine = mock(StatusLine.class);
+        httpResponseHeader = mock(Header.class);
     }
 
     private void sendInit() throws IOException {
 
+        Header[] headerList = new BasicHeader[2];
+        headerList[0] = new BasicHeader("Content-Type", "application/json");
+        headerList[1] = new BasicHeader("cache-control", "no-cache");
         doReturn("https://testHost/").when(restfulUtil).getMsbHost();
 
         when(statusLine.getStatusCode()).thenReturn(HttpStatus.OK.value());
         when(httpResponse.getStatusLine()).thenReturn(statusLine);
         when(httpResponse.getEntity()).thenReturn(httpEntity);
+        when(httpResponse.getAllHeaders()).thenReturn(headerList);
     }
 
     @Test
diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/aainfvoResponse.json b/adapters/mso-vfc-adapter/src/test/resources/json/aainfvoResponse.json
new file mode 100644
index 0000000..35047a9
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/resources/json/aainfvoResponse.json
@@ -0,0 +1,10 @@
+{
+  "nfvoId":"6ee79fe2-9579-475a-9bb9-20cf4358a19e",
+  "name":"external_nfvo",
+  "api-root":"xyz",
+  "vendor":"vz",
+  "version":"v1.0",
+  "url":"http://sample.com/",
+  "userName":"admin",
+  "password":"sacjnasnc"
+}
\ No newline at end of file
diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json b/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json
index 047c810..aec8ae8 100644
--- a/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json
+++ b/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json
@@ -1,32 +1,56 @@
 {
-    "nsServiceName":"vIMS",
-    "nsServiceDescription":"vIMS NS",
+    "nsServiceName":"vcpe_e2e_vnf_test2",
+    "nsServiceDescription":"null",
+    "nsServiceModelUUID":"c9f0a95e-dea0-4698-96e5-5a79bc5a233d",
     "nsOperationKey":{
-        "globalSubscriberId":"9b9f02c0-298b-458a-bc9c-be3692e4f350",
-        "serviceType":"service",
-        "serviceId":"9b9f02c0-298b-458a-bc9c-be3692e4f351",
-        "operationId":"9b9f02c0-298b-458a-bc9c-be3692e4f352",
-        "nodeTemplateUUID":"9b9f02c0-298b-458a-bc9c-be3692e4f353"
+        "globalSubscriberId":"Demonstration",
+        "serviceType":"vCPE",
+        "serviceId":"996fadbb-e806-4a19-b0e5-3454ad6ac29e",
+        "operationId":"1f1dd6b2-b027-4008-a9df-3b6c8274fb24",
+        "nodeTemplateUUID":"4d3a835c-29c8-4a63-83a4-50de5f7ffe16"
     },
     "nsParameters":{
         "locationConstraints":[
             {
-                "vnfProfileId":"zte-CSCF-1.0",
                 "locationConstraints":{
-                    "vimId":"1"
-                }
+                    "vimId":"CloudOwner_regionOne"
+                },
+                "vnfProfileId":"b1bb0ce7-2222-4fa7-95ed-4840d70a1101"
+            },
+            {
+                "locationConstraints":{
+                    "vimId":"CloudOwner_regionOne"
+                },
+                "vnfProfileId":"0408f076-e6c0-4c82-9940-272fddbb82de"
+            },
+            {
+                "locationConstraints":{
+                    "vimId":"CloudOwner_regionOne"
+                },
+                "vnfProfileId":"b1bb0ce7-2222-4fa7-95ed-4840d70a1100"
+            },
+            {
+                "locationConstraints":{
+                    "vimId":"CloudOwner_regionOne"
+                },
+                "vnfProfileId":"b1bb0ce7-2222-4fa7-95ed-4840d70a1102"
+            },
+            {
+                "locationConstraints":{
+                    "vimId":"CloudOwner_regionOne"
+                },
+                "vnfProfileId":"3fca3543-07f5-492f-812c-ed462e4f94f4"
             }
         ],
         "additionalParamForNs":{
-            "externalDataNetworkName":"Flow_out_net",
-            "m6000_mng_ip":"192.168.20.2",
-            "externalCompanyFtpDataNetworkName":"Flow_out_net",
-            "externalPluginManageNetworkName":"plugin_net_2014",
-            "externalManageNetworkName":"mng_net_2017",
-            "sfc_data_network":"sfc_data_net_2016",
-            "NatIpRange":"210.1.1.10-210.1.1.20",
-            "location":"4050083f-465f-4838-af1e-47a545222ad0",
-            "sdncontroller":"9b9f02c0-298b-458a-bc9c-be3692e4f35e"
+            "orchestrator":"",
+            "nfvo":"b1bb0ce7-2222-4fa7-95ed-4840d70a1101",
+            "nf_naming":"true",
+            "multi_stage_design":"false",
+            "availability_zone_max_count":"1",
+            "xyz":"123",
+            "nsd0_providing_service_invariant_uuid":"12204a12-7da2-4ddf-8c2f-992a1a1acebf",
+            "nsd0_providing_service_uuid":"5791dbeb-19d4-43e8-bf44-5b327ccf6bca"
         }
     }
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/createNsSol005Response.json b/adapters/mso-vfc-adapter/src/test/resources/json/createNsSol005Response.json
new file mode 100644
index 0000000..938969a
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/resources/json/createNsSol005Response.json
@@ -0,0 +1,210 @@
+{
+  "_links":{
+    "heal":{
+      "href":""
+    },
+    "instantiate":{
+      "href":""
+    },
+    "nestedNsInstances":{
+      "href":""
+    },
+    "scale":{
+      "href":""
+    },
+    "self":{
+      "href":""
+    },
+    "terminate":{
+      "href":""
+    },
+    "update":{
+      "href":""
+    }
+  },
+  "additionalAffinityOrAntiAffiniityRule":[
+    {
+      "Scope":"",
+      "affinityOrAntiAffiinty":"",
+      "vnfInstanceId":[
+
+      ],
+      "vnfProfileId":[
+
+      ],
+      "vnfdId":[
+
+      ]
+    }
+  ],
+  "flavourId":"",
+  "id":"c9f0a95e-dea0-4698-96e5-5a79bc5a233d",
+  "nestedNsInstanceId":[
+
+  ],
+  "nsInstanceDescription":"",
+  "nsInstanceName":"",
+  "nsScaleStatus":[
+    {
+      "nsScaleLevelId":"",
+      "nsScalingAspectId":""
+    }
+  ],
+  "nsState":"",
+  "nsdId":"",
+  "nsdInfoId":"",
+  "pnfInfo":[
+    {
+      "cpInfo":[
+        {
+          "cpInstanceId":"",
+          "cpProtocolData":{
+            "ipOverEthernet":{
+              "ipAddresses":{
+                "addressRange":{
+                  "maxAddress":"",
+                  "minAddress":""
+                },
+                "fixedAddresses":"",
+                "numDynamicAddresses":1,
+                "subnetId":"",
+                "type":""
+              },
+              "macAddress":{
+
+              }
+            },
+            "layerProtocol":"IP_OVER_ETHERNET"
+          },
+          "cpdId":""
+        }
+      ],
+      "pnfId":"",
+      "pnfName":"",
+      "pnfProfileId":"",
+      "pnfdId":"",
+      "pnfdInfoId":""
+    }
+  ],
+  "sapInfo":[
+    {
+      "description":"",
+      "id":"",
+      "sapName":"",
+      "sapProtocolInfo":{
+        "ipOverEthernet":{
+          "ipAddresses":{
+            "addressRange":{
+              "maxAddress":"",
+              "minAddress":""
+            },
+            "fixedAddresses":"",
+            "numDynamicAddresses":1,
+            "subnetId":"",
+            "type":""
+          },
+          "macAddress":""
+        },
+        "layerProtocol":"IP_OVER_ETHERNET"
+      },
+      "sapdId":""
+    }
+  ],
+  "virtualLinkInfo":[
+    {
+      "id":"",
+      "linkPort":[
+        {
+          "id":"",
+          "resourceHandle":{
+            "resourceId":"",
+            "resourceProviderId":"",
+            "vimId":"",
+            "vimLevelResourceType":""
+          }
+        }
+      ],
+      "nsVirtualLinkDescId":"",
+      "resourceHandle":[
+        {
+          "resourceId":"",
+          "resourceProviderId":"",
+          "vimId":"",
+          "vimLevelResourceType":""
+        }
+      ]
+    }
+  ],
+  "vnfInstance":[
+    {
+      "vnfInstanceId":"",
+      "vnfProfileId":""
+    }
+  ],
+  "vnffgInfo":[
+    {
+      "id":"",
+      "nfpInfo":[
+        {
+          "description":"",
+          "id":"",
+          "nfpName":"",
+          "nfpRule":{
+            "destinationIpAddressPrefix":"",
+            "destinationPortRange":"",
+            "dscp":"",
+            "etherDestinationAddress":"",
+            "etherSourceAddress":"",
+            "etherType":"",
+            "extendedCriteria":[
+              {
+                "length":1,
+                "startingPoint":1,
+                "value":""
+              }
+            ],
+            "protocol":"",
+            "sourceIpAddressPrefix":"",
+            "sourcePortRange":"",
+            "vlanTag":[
+
+            ]
+          },
+          "nfpState":"",
+          "nfpdId":"",
+          "nscpHandle":[
+            {
+              "nsInstanceId":"",
+              "nsSapInstanceId":"",
+              "pnfExtCpInstanceId":"",
+              "pnfInfoId":"",
+              "vnfExtCpInstanceId":"",
+              "vnfInstanceId":""
+            }
+          ],
+          "totalCp":1
+        }
+      ],
+      "nsCpHandle":[
+        {
+          "nsInstanceId":"",
+          "nsSapInstanceId":"",
+          "pnfExtCpInstanceId":"",
+          "pnfInfoId":"",
+          "vnfExtCpInstanceId":"",
+          "vnfInstanceId":""
+        }
+      ],
+      "nsVirtualLinkInfoId":[
+
+      ],
+      "pnfInfoId":[
+
+      ],
+      "vnfInstanceId":[
+
+      ],
+      "vnffgdId":""
+    }
+  ]
+}
\ No newline at end of file
diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/lcmOperRsp.json b/adapters/mso-vfc-adapter/src/test/resources/json/lcmOperRsp.json
new file mode 100644
index 0000000..111afc1
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/test/resources/json/lcmOperRsp.json
@@ -0,0 +1,7 @@
+{
+  "id":"12204a12-7da2-4ddf-8c2f-992a1a1acebf",
+  "lcmOperationType":"INSTANTIATE",
+  "nsInstanceId":"c9f0a95e-dea0-4698-96e5-5a79bc5a233d",
+  "operationState":"PROCESSING",
+  "statusEnteredTime":"Time"
+}
\ No newline at end of file
