diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java
index fd5a296..7f0e939 100644
--- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java
+++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java
@@ -887,13 +887,15 @@
              try {
             	int rowCount = 0;
             	CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + keyName + " = " + keyValue + ";", null, "");
-            	while(data.next()) {
+            	if (data != null) {
+            		while(data.next()) {
      				rowCount ++;
-            	}
-            	if (rowCount != 0) {
-                    LOG.debug("cleanUpExistingToscaData from: " + tableName + " for " + keyValue);
-               		jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null);
-            	}
+            		}
+            		if (rowCount != 0) {
+                    	LOG.debug("cleanUpExistingToscaData from: " + tableName + " for " + keyValue);
+               			jdbcDataSource.writeData("DELETE from " + tableName + " where " + keyName + " = " + keyValue + ";", null, null);
+            		}
+		}
 
 			} catch (SQLException e) {
 				LOG.error("Could not clean up existing " + tableName  + " for " + keyValue, e);
@@ -907,13 +909,15 @@
             try {
            	int rowCount = 0;
            	CachedRowSet data = jdbcDataSource.getData("SELECT * from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, "");
-           	while(data.next()) {
+           	if (data != null) {
+           		while(data.next()) {
     				rowCount ++;
-           	}
-           	if (rowCount != 0) {
-                   LOG.debug("cleanUpExistingToscaData from : " + tableName + " for " + key1Value + " and " + key2Value);
-              		jdbcDataSource.writeData("DELETE from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, null);
-           	}
+           		}
+           		if (rowCount != 0) {
+                   	LOG.debug("cleanUpExistingToscaData from : " + tableName + " for " + key1Value + " and " + key2Value);
+              			jdbcDataSource.writeData("DELETE from " + tableName + " where " + key1Name + " = " + key1Value + " AND " + key2Name + " = " + key2Value + ";", null, null);
+           		}
+		}
 
 			} catch (SQLException e) {
 				LOG.error("Could not clean up existing " + tableName  + " for " + key1Value  + " and " + key2Value, e);
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java
index 35639b3..5977e28 100644
--- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java
+++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java
@@ -260,20 +260,6 @@
 		return subnetRoleFound;
 	}
 	
-	private Map<String, String> getIpPropMapWithMatchingSubnetRole (ArrayList<Map<String, String>> ipPropParamsList, String subnetRole) {
-		
-		Map<String, String> ipPropMapMatch = new HashMap<String, String>();
-		
-		if (subnetRole != null) { 
-			for (Map<String, String> ipPropMap :  ipPropParamsList) {
-				if (nullCheck(ipPropMap.get("subnet_role")) == subnetRole) {
-					return ipPropMap;
-				}
-			}
-		}
-		return ipPropMapMatch;
-	}
-	
 	private void addRequiredParameters (Map<String, String> mappingParams) {
 		
 		// Add parameters which can not be null if they have not already been added - network_role, ipv4_count, ipv6_count
diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java
index 360c36c..ea6499c 100644
--- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java
+++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java
@@ -2,22 +2,43 @@
  
  import static org.junit.Assert.*;
  import static org.mockito.Mockito.*;
- 
- import org.junit.Test;
+
+import java.io.IOException;
+
+import org.junit.Before;
+import org.junit.Test;
  import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
  import org.onap.sdc.toscaparser.api.NodeTemplate;
  import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
  
  public class SdncARModelTest {
  
- 	@Test
- 	public void testSdncARModelConstructor() {
+	 SdncARModel testSdncARModel = null;
+	 
+	 @Before
+	 public void setUp() throws Exception {
  		ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class);
  		NodeTemplate nodeTemplate = mock(NodeTemplate.class);
  		DBResourceManager mockDBResourceManager = mock(DBResourceManager.class);
- 		SdncARModel testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate,mockDBResourceManager);
+ 		testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate,mockDBResourceManager);
  		assertNotNull(testSdncARModel);
  	}
  
+	@Test 
+	public void testSetGetSubcategory() { 
+		String subcategory = "test-subcategory";
+		testSdncARModel.setSubcategory(subcategory);
+		String result = testSdncARModel.getSubcategory(); 
+		assertEquals(subcategory, result); 
+	}
+	
+	@Test 
+	public void testInsertAllottedResourceModelData() { 
+		try {
+			testSdncARModel.insertAllottedResourceModelData();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} 
+	}
  }
- 
diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java
new file mode 100644
index 0000000..0c6030b
--- /dev/null
+++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncGroupModelTest.java
@@ -0,0 +1,34 @@
+package org.onap.ccsdk.sli.northbound.uebclient;
+ 
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.Group;
+import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
+ 
+ public class SdncGroupModelTest {
+ 
+ 	@Test
+ 	public void testSdncGroupModelConstructor() {
+ 		ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class);
+ 		NodeTemplate nodeTemplate = mock(NodeTemplate.class);
+ 		Group group = mock(Group.class);
+		DBResourceManager mockDBResourceManager = mock(DBResourceManager.class);
+		SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class);
+ 		SdncGroupModel testSdncGroupModel = null;
+		try {
+			testSdncGroupModel = new SdncGroupModel(mockCsarHelper,group,nodeTemplate,mockSdncUebConfiguration,mockDBResourceManager);
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+ 		assertNotNull(testSdncGroupModel);
+ 	}
+ 
+ }
+ 
diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java
index d50c47a..a77c5ad 100644
--- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java
+++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java
@@ -2,12 +2,15 @@
  
 import static org.junit.Assert.*; 
  
-import static org.mockito.Mockito.*; 
- 
+import static org.mockito.Mockito.*;
+
+import java.io.IOException;
+
 import org.junit.Before; 
 import org.junit.Test; 
 import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; 
-import org.onap.sdc.toscaparser.api.NodeTemplate; 
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
 import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
  
 public class SdncNodeModelTest { 
@@ -18,7 +21,13 @@
 	public void setUp() throws Exception { 
 		ISdcCsarHelper isdcCsarHelper = mock(ISdcCsarHelper.class); 
 		NodeTemplate nodeTemplate = mock(NodeTemplate.class); 
+		Metadata mockMetadata = mock(Metadata.class);
 		DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); 
+		
+		when(nodeTemplate.getMetaData()).thenReturn(mockMetadata);
+		when(isdcCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd");
+		when(isdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "network_type")).thenReturn("test-network-type");
+		
 		sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate, mockDBResourceManager); 
 		sdncNodeModel.setServiceUUID("0e8d757f-1c80-40af-85de-31d64f1f5af8"); 
 		sdncNodeModel.setEcompGeneratedNaming("hello-world"); 
@@ -39,7 +48,7 @@
 	@Test 
 	public void testGetSqlString() { 
 		String result = sdncNodeModel.getSql("TEST-HELLO"); 
-		String test = "INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, ecomp_generated_naming) values (0e8d757f-1c80-40af-85de-31d64f1f5af8, \"\", \"TEST-HELLO\", \"hello-world\");"; 
+		String test = "INSERT into NETWORK_MODEL (service_uuid, customization_uuid, model_yaml, ecomp_generated_naming, network_type) values (0e8d757f-1c80-40af-85de-31d64f1f5af8, \"aaaa-bbbb-cccc-dddd\", \"TEST-HELLO\", \"hello-world\", \"test-network-type\");"; 
 		assertEquals(test, result); 
 	} 
  
@@ -48,4 +57,15 @@
 		String result = sdncNodeModel.getVpnBindingsSql(); 
 		assertNotNull(result); 
 	} 
+	
+	@Test 
+	public void testInsertNetworkModelData() { 
+		try {
+			sdncNodeModel.insertNetworkModelData();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} 
+	} 
+
 }
diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java
new file mode 100644
index 0000000..95f5a75
--- /dev/null
+++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncServiceModelTest.java
@@ -0,0 +1,77 @@
+package org.onap.ccsdk.sli.northbound.uebclient;
+ 
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+import java.io.IOException;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
+ 
+ public class SdncServiceModelTest {
+ 
+	SdncServiceModel testSdncServiceModel = null;
+	 
+	@Before
+ 	public void setUp() throws Exception {
+		ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class);
+		Metadata mockMetadata = mock(Metadata.class);
+		
+		when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "UUID")).thenReturn("aaaa-bbbb-cccc-dddd");
+		when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "invariantUUID")).thenReturn("bbbb-cccc-dddd-eeee");
+		when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "namingPolicy")).thenReturn("test-naming-policy");
+		
+		testSdncServiceModel = new SdncServiceModel(mockCsarHelper,mockMetadata);
+
+ 		assertNotNull(testSdncServiceModel);
+ 	}
+ 	
+	@Test 
+	public void testSetGetServiceUUID() { 
+		String newServiceUuid = "cccc-dddd-eeee-ffff";
+		testSdncServiceModel.setServiceUUID(newServiceUuid);
+		String result = testSdncServiceModel.getServiceUUID(); 
+		assertEquals("\"" + newServiceUuid + "\"", result); 
+	} 
+ 
+	@Test 
+	public void testSetGetServiceInvariantUUID() { 
+		String result = testSdncServiceModel.getServiceInvariantUUID(); 
+		assertEquals(result, "\"bbbb-cccc-dddd-eeee\""); 
+	} 
+ 
+	@Test 
+	public void testSetGeServiceInstanceNamePrefix() { 
+		String serviceInstanceNamePrefix = "test-service-instance-name-prefix";
+		testSdncServiceModel.setServiceInstanceNamePrefix(serviceInstanceNamePrefix);
+		String result = testSdncServiceModel.getServiceInstanceNamePrefix(); 
+		assertEquals(serviceInstanceNamePrefix, result); 
+	} 
+ 
+	@Test 
+	public void testSetGetResourceVendor() { 
+		String resourceVendor = "Fortinet";
+		testSdncServiceModel.setResourceVendor(resourceVendor);
+		String result = testSdncServiceModel.getResourceVendor(); 
+		assertEquals(resourceVendor, result); 
+	} 
+ 
+	@Test 
+	public void testSetGetResourceVendorRelease() { 
+		String resourceVendorRelease = "1.0.0";
+		testSdncServiceModel.setResourceVendorRelease(resourceVendorRelease);
+		String result = testSdncServiceModel.getResourceVendorRelease(); 
+		assertEquals(resourceVendorRelease, result); 
+	} 
+
+	@Test 
+	public void testGetSqlString() { 
+		String result = testSdncServiceModel.getSql("TEST-HELLO"); 
+		String test = "INSERT into SERVICE_MODEL (service_uuid, model_yaml, filename, naming_policy, invariant_uuid) values (\"aaaa-bbbb-cccc-dddd\", \"TEST-HELLO\", \"null\", \"test-naming-policy\", \"bbbb-cccc-dddd-eeee\");"; 
+		assertEquals(test, result); 
+	} 
+ 
+
+ }
diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java
index a09c5a2..4693123 100644
--- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java
+++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java
@@ -1,24 +1,55 @@
 package org.onap.ccsdk.sli.northbound.uebclient; 
  
 import static org.junit.Assert.*; 
-import static org.mockito.Mockito.*; 
- 
- 
+import static org.mockito.Mockito.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
+
 import org.junit.Before; 
 import org.junit.Test; 
 import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; 
-import org.onap.sdc.toscaparser.api.NodeTemplate; 
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
 import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
  
 public class SdncVFCModelTest { 
  
 	SdncVFCModel testSdncVFCModel; 
+	NodeTemplate mockVFCNodeTemplate = null;
  
 	@Before 
 	public void setup() { 
 		ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); 
 		NodeTemplate mockNodeTemplate = mock(NodeTemplate.class); 
+		mockVFCNodeTemplate = mock(NodeTemplate.class); 
+ 		Metadata mockMetadata = mock(Metadata.class);
 		DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); 
+		
+		when(mockNodeTemplate.getMetaData()).thenReturn(mockMetadata);
+		when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd");
+		when(mockCsarHelper.getNodeTemplatePropertyLeafValue(mockNodeTemplate, "nfc_naming_code")).thenReturn("test-nfc-naming-code");
+		
+		Map<String,Map<String,Object>> cpPropertiesMap = new HashMap<String,Map<String,Object>>();
+		Map<String,Object> propertiesMap = new HashMap<String,Object>();
+		propertiesMap.put("network-role", "test-network-role");
+		propertiesMap.put("network-role-tag", "test-network-role-tag");
+		
+		ArrayList<Map<String, Object>> ipRequirementsList = new ArrayList<Map<String, Object>>();
+		Map<String,Object> ip4Prop = new HashMap<String,Object>();
+		ip4Prop.put("ip_version", "4");
+		ipRequirementsList.add(ip4Prop);
+		Map<String,Object> ip6Prop = new HashMap<String,Object>();
+		ip4Prop.put("ip_version", "6");
+		ipRequirementsList.add(ip4Prop);
+
+		propertiesMap.put("ip_requirements", ipRequirementsList);
+		cpPropertiesMap.put("cp-node-1", propertiesMap);
+		when(mockCsarHelper.getCpPropertiesFromVfcAsObject(mockVFCNodeTemplate)).thenReturn(cpPropertiesMap);
+		
 		testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate, mockDBResourceManager); 
 		testSdncVFCModel.setVmType("Test-type"); 
 		testSdncVFCModel.setVmCount("5"); 
@@ -26,13 +57,43 @@
 	} 
  
 	@Test 
-	public void testSdncVFCModelGetVmType() { 
-		assertEquals(testSdncVFCModel.getVmType(), "Test-type"); 
+	public void testSdncVFCModelSetGetVmType() { 
+		String newVMtype = "new-vm-type";
+		testSdncVFCModel.setVmType(newVMtype);
+		assertEquals(testSdncVFCModel.getVmType(), "new-vm-type"); 
 	} 
  
 	@Test 
-	public void testSdncVFCModelGetVmCount() { 
-		assertEquals(testSdncVFCModel.getVmCount(), "5"); 
+	public void testSdncVFCModelSetGetVmCount() { 
+		String newVMcount = "4";
+		testSdncVFCModel.setVmCount(newVMcount);
+		assertEquals(testSdncVFCModel.getVmCount(), "4"); 
 	} 
- 
+	
+	@Test 
+	public void testInsertVFCModelData() { 
+		try {
+			testSdncVFCModel.insertVFCModelData();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} 
+	} 
+
+	@Test 
+	public void testInsertVFCtoNetworkRoleMappingData() { 
+		try {
+			testSdncVFCModel.insertVFCtoNetworkRoleMappingData(mockVFCNodeTemplate);
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} 
+	} 
+
+	@Test 
+	public void testIpPropParamsMapContainsSubnetRole() { 
+		ArrayList<Map<String, String>>  testList = new ArrayList<Map<String, String>>(); 
+		testSdncVFCModel.ipPropParamsMapContainsSubnetRole(testList, "test-subnet-role");
+	} 
+
 }
diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java
new file mode 100644
index 0000000..3f795a3
--- /dev/null
+++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModelTest.java
@@ -0,0 +1,95 @@
+package org.onap.ccsdk.sli.northbound.uebclient;
+ 
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+import java.io.IOException;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
+ 
+ public class SdncVFModelTest {
+ 
+	SdncVFModel testSdncVFModel = null;
+	 
+	@Before 
+ 	public void setUp() throws Exception {
+ 		ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class);
+ 		NodeTemplate nodeTemplate = mock(NodeTemplate.class);
+ 		Metadata mockMetadata = mock(Metadata.class);
+		DBResourceManager mockDBResourceManager = mock(DBResourceManager.class);
+		SdncUebConfiguration mockSdncUebConfiguration = mock(SdncUebConfiguration.class);
+		
+		when(nodeTemplate.getMetaData()).thenReturn(mockMetadata);
+		when(mockCsarHelper.getMetadataPropertyValue(mockMetadata, "customizationUUID")).thenReturn("aaaa-bbbb-cccc-dddd");
+		when(mockCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "nf_naming_code")).thenReturn("test-nf-naming-code");
+		
+		try {
+			testSdncVFModel = new SdncVFModel(mockCsarHelper,nodeTemplate,mockDBResourceManager,mockSdncUebConfiguration);
+			testSdncVFModel.setServiceUUID("bbbb-cccc-dddd-eeee"); 
+			testSdncVFModel.setServiceInvariantUUID("cccc-dddd-eeee-ffff"); 
+			testSdncVFModel.setVendor("Cisco"); 
+			testSdncVFModel.setVendorModelDescription("Cisco Equipment Model"); 
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+ 		assertNotNull(testSdncVFModel);
+ 	}
+ 
+	@Test 
+	public void testSetGetVendor() {
+		String newVendorModel = "new-vendor-model";
+		testSdncVFModel.setVendor(newVendorModel); 
+		String result = testSdncVFModel.getVendor(); 
+		assertEquals(result, newVendorModel); 
+	} 
+	
+	@Test 
+	public void testSetGetVendorModelDescription() { 
+		String newVendorModelDescription = "new-vendor-model-description";
+		testSdncVFModel.setVendorModelDescription(newVendorModelDescription); 
+		String result = testSdncVFModel.getVendorModelDescription(); 
+		assertEquals(result, newVendorModelDescription); 
+	}
+	
+	@Test 
+	public void testSetGetNfNamingCode() { 
+		String newNfNamingCode = "new-nf-naming-code";
+		testSdncVFModel.setNfNamingCode(newNfNamingCode); 
+		String result = testSdncVFModel.getNfNamingCode(); 
+		assertEquals(result, newNfNamingCode); 
+	}
+	
+	@Test 
+	public void testSetGetServiceUUID() { 
+		String newServiceUuid = "cccc-dddd-eeee-ffff";
+		testSdncVFModel.setServiceUUID(newServiceUuid);
+		String result = testSdncVFModel.getServiceUUID(); 
+		assertEquals(newServiceUuid, result); 
+	} 
+ 
+	@Test 
+	public void testSetGetServiceInvariantUUID() { 
+		String newServiceInvariantUuid = "dddd-eeee-ffff-eeee";
+		testSdncVFModel.setServiceInvariantUUID(newServiceInvariantUuid);
+		String result = testSdncVFModel.getServiceInvariantUUID(); 
+		assertEquals(result, newServiceInvariantUuid); 
+	} 
+
+	@Test 
+	public void testInsertData() { 
+		try {
+			testSdncVFModel.insertData();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} 
+	}
+	
+ }
