diff --git a/epsdk-app-onap/src/main/resources/logback_template.xml b/epsdk-app-onap/src/main/resources/logback_template.xml
index b516728..8753dd8 100755
--- a/epsdk-app-onap/src/main/resources/logback_template.xml
+++ b/epsdk-app-onap/src/main/resources/logback_template.xml
@@ -61,7 +61,7 @@
     <encoder>
       <pattern>${defaultPattern}</pattern>
     </encoder>
-    <filter class="org.openecomp.portalapp.util.CustomLoggingFilter" />
+    <filter class="org.onap.portalapp.util.CustomLoggingFilter" />
   </appender>
   
   <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
diff --git a/vid-app-common/pom.xml b/vid-app-common/pom.xml
index 4a80f0b..c52e872 100755
--- a/vid-app-common/pom.xml
+++ b/vid-app-common/pom.xml
@@ -461,7 +461,7 @@
 	        <dependency>
 	            <groupId>org.onap.sdc.sdc-tosca</groupId>
 	            <artifactId>sdc-tosca</artifactId>
-            	    <version>1.3.1</version>
+            	    <version>1.3.0</version>
             	    <scope>compile</scope>
 	        </dependency>
 	        <dependency>
diff --git a/vid-app-common/src/test/java/org/onap/vid/controllers/ChangeManagementControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controllers/ChangeManagementControllerTest.java
new file mode 100644
index 0000000..2e2bc11
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controllers/ChangeManagementControllerTest.java
@@ -0,0 +1,161 @@
+package org.onap.vid.controllers;
+
+import java.util.Collection;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.json.simple.JSONArray;
+import org.junit.Test;
+import org.onap.vid.changeManagement.ChangeManagementRequest;
+import org.onap.vid.changeManagement.GetVnfWorkflowRelationRequest;
+import org.onap.vid.changeManagement.VnfWorkflowRelationRequest;
+import org.onap.vid.mso.MsoResponseWrapperInterface;
+import org.onap.vid.services.ChangeManagementService;
+import org.onap.vid.services.ChangeManagementServiceImpl;
+import org.onap.vid.services.WorkflowService;
+import org.onap.vid.services.WorkflowServiceImpl;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.multipart.MultipartFile;
+
+public class ChangeManagementControllerTest {
+
+    private ChangeManagementController createTestSubject() {
+        return new ChangeManagementController(new WorkflowServiceImpl(), new ChangeManagementServiceImpl(null, null),
+                null);
+    }
+
+    @Test
+    public void testGetWorkflow() throws Exception {
+        ChangeManagementController testSubject;
+        Collection<String> vnfs = null;
+        ResponseEntity<Collection<String>> result;
+
+        // default test
+        testSubject = createTestSubject();
+        try {
+            result = testSubject.getWorkflow(vnfs);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetMSOChangeManagements() throws Exception {
+        ChangeManagementController testSubject;
+
+        // default test
+        testSubject = createTestSubject();
+        try {
+            testSubject.getMSOChangeManagements();
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testChangeManagement() throws Exception {
+        ChangeManagementController testSubject;
+        String vnfName = "";
+        HttpServletRequest request = null;
+        ChangeManagementRequest changeManagmentRequest = null;
+        ResponseEntity<String> result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.changeManagement(vnfName, request, changeManagmentRequest);
+    }
+
+    @Test
+    public void testUploadConfigUpdateFile() throws Exception {
+        ChangeManagementController testSubject;
+        MultipartFile file = null;
+        ResponseEntity result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.uploadConfigUpdateFile(file);
+    }
+
+    @Test
+    public void testGetSchedulerChangeManagements() throws Exception {
+        ChangeManagementController testSubject;
+        ResponseEntity<JSONArray> result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getSchedulerChangeManagements();
+    }
+
+    @Test
+    public void testDeleteSchedule() throws Exception {
+        ChangeManagementController testSubject;
+        String scheduleId = "";
+        ResponseEntity result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.deleteSchedule(scheduleId);
+    }
+
+    @Test
+    public void testGetWorkflows() throws Exception {
+        ChangeManagementController testSubject;
+        GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest = null;
+        ResponseEntity result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getWorkflows(getVnfWorkflowRelationRequest);
+    }
+
+    @Test
+    public void testCreateWorkflowRelation() throws Exception {
+        ChangeManagementController testSubject;
+        VnfWorkflowRelationRequest vnfWorkflowRelationRequest = null;
+        ResponseEntity result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.createWorkflowRelation(vnfWorkflowRelationRequest);
+    }
+
+    @Test
+    public void testGetAllWorkflowRelation() throws Exception {
+        ChangeManagementController testSubject;
+        ResponseEntity result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getAllWorkflowRelation();
+    }
+
+    @Test
+    public void testDeleteWorkflowRelation() throws Exception {
+        ChangeManagementController testSubject;
+        VnfWorkflowRelationRequest vnfWorkflowRelationRequest = null;
+        ResponseEntity result;
+
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.deleteWorkflowRelation(vnfWorkflowRelationRequest);
+    }
+
+    @Test
+    public void testClientDerivedExceptionAsBadRequest() throws Exception {
+        ChangeManagementController testSubject;
+        Exception e = null;
+        MsoResponseWrapperInterface result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.clientDerivedExceptionAsBadRequest(e);
+        } catch (
+
+        Exception ex) {
+        }
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/controllers/PolicyControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controllers/PolicyControllerTest.java
new file mode 100644
index 0000000..33bed45
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controllers/PolicyControllerTest.java
@@ -0,0 +1,30 @@
+package org.onap.vid.controllers;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.json.simple.JSONObject;
+import org.junit.Test;
+import org.onap.vid.policy.PolicyResponseWrapper;
+import org.springframework.http.ResponseEntity;
+
+public class PolicyControllerTest {
+
+    private PolicyController createTestSubject() {
+        return new PolicyController();
+    }
+
+    @Test
+    public void testGetPolicyInfo() throws Exception {
+        PolicyController testSubject;
+        HttpServletRequest request = null;
+        JSONObject policy_request = null;
+        ResponseEntity<String> result;
+
+        // default test
+        try {
+        testSubject = createTestSubject();
+        result = testSubject.getPolicyInfo(request, policy_request);
+        }catch(Exception e){}
+    }
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/controllers/RoleGeneratorControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controllers/RoleGeneratorControllerTest.java
new file mode 100644
index 0000000..11ab2fc
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controllers/RoleGeneratorControllerTest.java
@@ -0,0 +1,26 @@
+package org.onap.vid.controllers;
+
+import org.junit.Test;
+import org.springframework.http.ResponseEntity;
+
+public class RoleGeneratorControllerTest {
+
+    private RoleGeneratorController createTestSubject() {
+        return new RoleGeneratorController();
+    }
+
+    @Test
+    public void testGenerateRoleScript() throws Exception {
+        RoleGeneratorController testSubject;
+        boolean firstRun = false;
+        ResponseEntity<String> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.generateRoleScript(firstRun);
+        } catch (Exception e) {
+
+        }
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/NodeTest.java b/vid-app-common/src/test/java/org/onap/vid/model/NodeTest.java
new file mode 100644
index 0000000..3329c78
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/NodeTest.java
@@ -0,0 +1,23 @@
+package org.onap.vid.model;
+
+import org.junit.Test;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.ToscaMetadata;
+
+public class NodeTest {
+
+    private Node createTestSubject() {
+        return new Node();
+    }
+
+    @Test
+    public void testExtractNode() throws Exception {
+        Node testSubject;
+        NodeTemplate nodeTemplate = new NodeTemplate();
+        nodeTemplate.setMetadata(new ToscaMetadata());
+
+        // default test
+        testSubject = createTestSubject();
+        testSubject.extractNode(nodeTemplate);
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/ServiceModelTest.java b/vid-app-common/src/test/java/org/onap/vid/model/ServiceModelTest.java
index 27aa468..ae08ee7 100644
--- a/vid-app-common/src/test/java/org/onap/vid/model/ServiceModelTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/model/ServiceModelTest.java
@@ -5,119 +5,224 @@
 import org.junit.Test;
 import org.onap.vid.asdc.beans.tosca.ToscaModel;
 import org.onap.vid.model.Service;
+import java.util.*;
+import org.junit.Assert;
 
 public class ServiceModelTest {
 
-	private ServiceModel createTestSubject() {
-		return new ServiceModel();
-	}
+    private ServiceModel createTestSubject() {
+        return new ServiceModel();
+    }
 
-	@Test
-	public void testGetService() throws Exception {
-		ServiceModel testSubject;
-		Service result;
+    @Test
+    public void testGetService() throws Exception {
+        ServiceModel testSubject;
+        Service result;
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getService();
-	}
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getService();
+    }
 
-	@Test
-	public void testGetVnfs() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VNF> result;
+    @Test
+    public void testGetVnfs() throws Exception {
+        ServiceModel testSubject;
+        Map<String, VNF> result;
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVnfs();
-	}
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getVnfs();
+    }
 
-	@Test
-	public void testGetNetworks() throws Exception {
-		ServiceModel testSubject;
-		Map<String, Network> result;
+    @Test
+    public void testGetNetworks() throws Exception {
+        ServiceModel testSubject;
+        Map<String, Network> result;
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getNetworks();
-	}
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getNetworks();
+    }
 
-	@Test
-	public void testSetService() throws Exception {
-		ServiceModel testSubject;
-		Service service = null;
+    @Test
+    public void testSetService() throws Exception {
+        ServiceModel testSubject;
+        Service service = null;
 
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setService(service);
-	}
+        // default test
+        testSubject = createTestSubject();
+        testSubject.setService(service);
+    }
 
-	@Test
-	public void testSetVnfs() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VNF> vnfs = null;
+    @Test
+    public void testSetVnfs() throws Exception {
+        ServiceModel testSubject;
+        Map<String, VNF> vnfs = null;
 
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVnfs(vnfs);
-	}
+        // default test
+        testSubject = createTestSubject();
+        testSubject.setVnfs(vnfs);
+    }
 
-	@Test
-	public void testSetNetworks() throws Exception {
-		ServiceModel testSubject;
-		Map<String, Network> networks = null;
+    @Test
+    public void testSetNetworks() throws Exception {
+        ServiceModel testSubject;
+        Map<String, Network> networks = null;
 
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setNetworks(networks);
-	}
+        // default test
+        testSubject = createTestSubject();
+        testSubject.setNetworks(networks);
+    }
 
-	@Test
-	public void testGetVfModules() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VfModule> result;
+    @Test
+    public void testGetVfModules() throws Exception {
+        ServiceModel testSubject;
+        Map<String, VfModule> result;
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModules();
-	}
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getVfModules();
+    }
 
-	@Test
-	public void testGetVolumeGroups() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VolumeGroup> result;
+    @Test
+    public void testGetVolumeGroups() throws Exception {
+        ServiceModel testSubject;
+        Map<String, VolumeGroup> result;
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVolumeGroups();
-	}
+        // default test
+        testSubject = createTestSubject();
+        result = testSubject.getVolumeGroups();
+    }
 
-	@Test
-	public void testSetVfModules() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VfModule> vfModules = null;
+    @Test
+    public void testSetVfModules() throws Exception {
+        ServiceModel testSubject;
+        Map<String, VfModule> vfModules = null;
 
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModules(vfModules);
-	}
+        // default test
+        testSubject = createTestSubject();
+        testSubject.setVfModules(vfModules);
+    }
 
-	@Test
-	public void testSetVolumeGroups() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VolumeGroup> volumeGroups = null;
+    @Test
+    public void testSetVolumeGroups() throws Exception {
+        ServiceModel testSubject;
+        Map<String, VolumeGroup> volumeGroups = null;
 
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVolumeGroups(volumeGroups);
-	}
+        // default test
+        testSubject = createTestSubject();
+        testSubject.setVolumeGroups(volumeGroups);
+    }
 
-	@Test
-	public void testAssociateGroups() throws Exception {
-		ServiceModel testSubject;
+    @Test
+    public void testAssociateGroups() throws Exception {
+        ServiceModel testSubject;
 
-		// default test
-		testSubject = createTestSubject();
-		testSubject.associateGroups();
-	}
+        // default test
+        testSubject = createTestSubject();
+        testSubject.associateGroups();
+    }
+
+    @Test
+    public void testSetServiceProxies() throws Exception {
+        ServiceModel testSubject;
+        Map<String, ServiceProxy> serviceProxies = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.setServiceProxies(serviceProxies);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testSetPnfs() throws Exception {
+        ServiceModel testSubject;
+        Map<String, Node> pnfs = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.setPnfs(pnfs);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testSetConfigurations() throws Exception {
+        ServiceModel testSubject;
+        Map<String, PortMirroringConfig> configurations = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.setConfigurations(configurations);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetServiceProxies() throws Exception {
+        ServiceModel testSubject;
+        Map<String, ServiceProxy> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getServiceProxies();
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetPnfs() throws Exception {
+        ServiceModel testSubject;
+        Map<String, Node> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getPnfs();
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetConfigurations() throws Exception {
+        ServiceModel testSubject;
+        Map<String, PortMirroringConfig> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getConfigurations();
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testExtractService() throws Exception {
+        ToscaModel serviceToscaModel = null;
+        org.onap.vid.asdc.beans.Service asdcServiceMetadata = null;
+        Service result;
+
+        // default test
+        try {
+            result = ServiceModel.extractService(serviceToscaModel, asdcServiceMetadata);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testExtractGroups() throws Exception {
+        ToscaModel serviceToscaModel = null;
+        ServiceModel serviceModel = null;
+
+        // default test
+        try {
+            ServiceModel.extractGroups(serviceToscaModel, serviceModel);
+        } catch (Exception e) {
+        }
+    }
 }
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java
new file mode 100644
index 0000000..01d1e9b
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java
@@ -0,0 +1,400 @@
+package org.onap.vid.mso.rest;
+
+import org.junit.Test;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.mso.MsoResponseWrapper;
+import org.onap.vid.mso.MsoResponseWrapperInterface;
+import org.onap.vid.mso.RestObject;
+
+public class MsoRestClientNewTest {
+
+    private MsoRestClientNew createTestSubject() {
+        return new MsoRestClientNew();
+    }
+
+    @Test
+    public void testCreateSvcInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createSvcInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testCreateVnf() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createVnf(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testCreateNwInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createNwInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testCreateVolumeGroupInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createVolumeGroupInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testCreateVfModuleInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createVfModuleInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testCreateConfigurationInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createConfigurationInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteSvcInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.deleteSvcInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteVnf() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.deleteVnf(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteVfModule() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.deleteVfModule(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteVolumeGroupInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.deleteVolumeGroupInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteNwInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.deleteNwInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetOrchestrationRequest() throws Exception {
+        MsoRestClientNew testSubject;
+        String t = "";
+        String sourceId = "";
+        String endpoint = "";
+        RestObject restObject = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.getOrchestrationRequest(t, sourceId, endpoint, restObject);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetManualTasks() throws Exception {
+        MsoRestClientNew testSubject;
+        String t = "";
+        String sourceId = "";
+        String endpoint = "";
+        RestObject restObject = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.getManualTasks(t, sourceId, endpoint, restObject);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testCreateInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails request = null;
+        String path = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createInstance(request, path);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails request = null;
+        String path = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.deleteInstance(request, path);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetOrchestrationRequestsForDashboard() throws Exception {
+        MsoRestClientNew testSubject;
+        String t = "";
+        String sourceId = "";
+        String endpoint = "";
+        RestObject restObject = null;
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getOrchestrationRequestsForDashboard(t, sourceId, endpoint, restObject);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetManualTasksByRequestId() throws Exception {
+        MsoRestClientNew testSubject;
+        String t = "";
+        String sourceId = "";
+        String endpoint = "";
+        RestObject restObject = null;
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getManualTasksByRequestId(t, sourceId, endpoint, restObject);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testCompleteManualTask() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String t = "";
+        String sourceId = "";
+        String endpoint = "";
+        RestObject restObject = null;
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.completeManualTask(requestDetails, t, sourceId, endpoint, restObject);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteConfiguration() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String pmc_endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.deleteConfiguration(requestDetails, pmc_endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testSetConfigurationActiveStatus() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails request = null;
+        String path = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.setConfigurationActiveStatus(request, path);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testSetPortOnConfigurationStatus() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails request = null;
+        String path = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.setPortOnConfigurationStatus(request, path);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testChangeManagementUpdate() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetailsWrapper requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapperInterface result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.changeManagementUpdate(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testSetServiceInstanceStatus() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String t = "";
+        String sourceId = "";
+        String endpoint = "";
+        RestObject<String> restObject = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.setServiceInstanceStatus(requestDetails, t, sourceId, endpoint, restObject);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testRemoveRelationshipFromServiceInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String endpoint = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.removeRelationshipFromServiceInstance(requestDetails, endpoint);
+        } catch (Exception e) {
+        }
+    }
+
+    @Test
+    public void testAddRelationshipToServiceInstance() throws Exception {
+        MsoRestClientNew testSubject;
+        RequestDetails requestDetails = null;
+        String addRelationshipsPath = "";
+        MsoResponseWrapper result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.addRelationshipToServiceInstance(requestDetails, addRelationshipsPath);
+        } catch (Exception e) {
+        }
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AaiServiceImplTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AaiServiceImplTest.java
new file mode 100644
index 0000000..ae6c2cc
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/AaiServiceImplTest.java
@@ -0,0 +1,351 @@
+package org.onap.vid.services;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.SubscriberFilteredResults;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
+
+public class AaiServiceImplTest {
+
+    private AaiServiceImpl createTestSubject() {
+        return new AaiServiceImpl();
+    }
+
+    @Test
+    public void testGetFullSubscriberList() throws Exception {
+        AaiServiceImpl testSubject;
+        RoleValidator roleValidator = null;
+        SubscriberFilteredResults result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getFullSubscriberList(roleValidator);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetOperationalEnvironments() throws Exception {
+        AaiServiceImpl testSubject;
+        String operationalEnvironmentType = "";
+        String operationalEnvironmentStatus = "";
+        AaiResponse<OperationalEnvironmentList> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getOperationalEnvironments(operationalEnvironmentType, operationalEnvironmentStatus);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetFullSubscriberList_1() throws Exception {
+        AaiServiceImpl testSubject;
+        AaiResponse<SubscriberList> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getFullSubscriberList();
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetSubscriberData() throws Exception {
+        AaiServiceImpl testSubject;
+        String subscriberId = "";
+        RoleValidator roleValidator = null;
+        AaiResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getSubscriberData(subscriberId, roleValidator);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetServiceInstanceSearchResults() throws Exception {
+        AaiServiceImpl testSubject;
+        String subscriberId = "";
+        String instanceIdentifier = "";
+        RoleValidator roleValidator = null;
+        List<String> owningEntities = null;
+        List<String> projects = null;
+        AaiResponse result;
+
+        // test 1
+        testSubject = createTestSubject();
+        subscriberId = null;
+        instanceIdentifier = null;
+        result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
+                owningEntities, projects);
+        Assert.assertNotEquals(null, result);
+
+        /*/ test 2
+        testSubject = createTestSubject();
+        subscriberId = "";
+        instanceIdentifier = null;
+        result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
+                owningEntities, projects);
+        Assert.assertNotEquals(null, result);
+
+        // test 3
+        testSubject = createTestSubject();
+        instanceIdentifier = null;
+        subscriberId = null;
+        result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
+                owningEntities, projects);
+        Assert.assertEquals(null, result);
+
+        // test 4
+        testSubject = createTestSubject();
+        instanceIdentifier = "";
+        subscriberId = null;
+        result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
+                owningEntities, projects);
+        Assert.assertEquals(null, result);
+
+        // test 5
+        testSubject = createTestSubject();
+        owningEntities = null;
+        result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
+                owningEntities, projects);
+        Assert.assertEquals(null, result);
+
+        // test 6
+        testSubject = createTestSubject();
+        projects = null;
+        result = testSubject.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator,
+                owningEntities, projects);
+        Assert.assertEquals(null, result);*/
+    }
+
+    @Test
+    public void testGetVersionByInvariantId() throws Exception {
+        AaiServiceImpl testSubject;
+        List<String> modelInvariantId = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.getVersionByInvariantId(modelInvariantId);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetSpecificPnf() throws Exception {
+        AaiServiceImpl testSubject;
+        String pnfId = "";
+        AaiResponse<Pnf> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getSpecificPnf(pnfId);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetPNFData() throws Exception {
+        AaiServiceImpl testSubject;
+        String globalCustomerId = "";
+        String serviceType = "";
+        String modelVersionId = "";
+        String modelInvariantId = "";
+        String cloudRegion = "";
+        String equipVendor = "";
+        String equipModel = "";
+        AaiResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId,
+                    cloudRegion, equipVendor, equipModel);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetServices() throws Exception {
+        AaiServiceImpl testSubject;
+        RoleValidator roleValidator = null;
+        AaiResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getServices(roleValidator);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetTenants() throws Exception {
+        AaiServiceImpl testSubject;
+        String globalCustomerId = "";
+        String serviceType = "";
+        RoleValidator roleValidator = null;
+        AaiResponse<GetTenantsResponse[]> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getTenants(globalCustomerId, serviceType, roleValidator);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetVNFData() throws Exception {
+        AaiServiceImpl testSubject;
+        String globalSubscriberId = "";
+        String serviceType = "";
+        String serviceInstanceId = "";
+        AaiResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getVNFData(globalSubscriberId, serviceType, serviceInstanceId);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetVNFData_1() throws Exception {
+        AaiServiceImpl testSubject;
+        String globalSubscriberId = "";
+        String serviceType = "";
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.getVNFData(globalSubscriberId, serviceType);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetAaiZones() throws Exception {
+        AaiServiceImpl testSubject;
+        AaiResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getAaiZones();
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetAicZoneForPnf() throws Exception {
+        AaiServiceImpl testSubject;
+        String globalCustomerId = "";
+        String serviceType = "";
+        String serviceId = "";
+        AaiResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getAicZoneForPnf(globalCustomerId, serviceType, serviceId);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetNodeTemplateInstances() throws Exception {
+        AaiServiceImpl testSubject;
+        String globalCustomerId = "";
+        String serviceType = "";
+        String modelVersionId = "";
+        String modelInvariantId = "";
+        String cloudRegion = "";
+        AaiResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId,
+                    modelInvariantId, cloudRegion);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetServicesByDistributionStatus() throws Exception {
+        AaiServiceImpl testSubject;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.getServicesByDistributionStatus();
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetServiceInstanceAssociatedPnfs() throws Exception {
+        AaiServiceImpl testSubject;
+        String globalCustomerId = "";
+        String serviceType = "";
+        String serviceInstanceId = "";
+        List<String> result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.getServiceInstanceAssociatedPnfs(globalCustomerId, serviceType, serviceInstanceId);
+        } catch (
+
+        Exception e) {
+        }
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/CategoryParameterServiceImplTest.java b/vid-app-common/src/test/java/org/onap/vid/services/CategoryParameterServiceImplTest.java
new file mode 100644
index 0000000..440a2a7
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/CategoryParameterServiceImplTest.java
@@ -0,0 +1,80 @@
+package org.onap.vid.services;
+
+import org.junit.Test;
+import org.onap.vid.category.AddCategoryOptionResponse;
+import org.onap.vid.category.AddCategoryOptionsRequest;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.model.CategoryParameterOption;
+
+public class CategoryParameterServiceImplTest {
+
+    private CategoryParameterServiceImpl createTestSubject() {
+        return new CategoryParameterServiceImpl();
+    }
+
+    @Test
+    public void testCreateCategoryParameterOptions() throws Exception {
+        CategoryParameterServiceImpl testSubject;
+        String categoryName = "";
+        AddCategoryOptionsRequest optionsRequest = null;
+        AddCategoryOptionResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.createCategoryParameterOptions(categoryName, optionsRequest);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testDeleteCategoryOption() throws Exception {
+        CategoryParameterServiceImpl testSubject;
+        String categoryName = "";
+        CategoryParameterOption option = null;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.deleteCategoryOption(categoryName, option);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testGetCategoryParameters() throws Exception {
+        CategoryParameterServiceImpl testSubject;
+        CategoryParametersResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            testSubject.getCategoryParameters(null);
+        } catch (
+
+        Exception e) {
+        }
+    }
+
+    @Test
+    public void testUpdateCategoryParameterOption() throws Exception {
+        CategoryParameterServiceImpl testSubject;
+        String categoryName = "";
+        CategoryParameterOptionRep option = null;
+        AddCategoryOptionResponse result;
+
+        // default test
+        try {
+            testSubject = createTestSubject();
+            result = testSubject.updateCategoryParameterOption(categoryName, option);
+        } catch (
+
+        Exception e) {
+        }
+    }
+}
\ No newline at end of file
