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
