diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
index 9310da0..a14aa49 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
@@ -107,6 +107,8 @@
 element_map_file_path = app/fusionapp/files/
 element_map_icon_path = app/fusionapp/icons/
 
+role_management_activated = false
+
 #aai related properties
 #aai.server.url.base=https://aai.api.openecomp.org:8443/aai/
 #aai.server.url=https://aai.api.openecomp.org:8443/aai/v8/
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
index f5955a5..b7b8f93 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
@@ -64,6 +64,8 @@
 element_map_file_path = /tmp
 element_map_icon_path = app/vid/icons/
 
+role_management_activated = false
+
 #aai related properties
 aai.server.url.base=${VID_AAI_URL}/aai/
 aai.server.url=${VID_AAI_URL}/aai/v13/
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
index 3938b16..a620760 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
@@ -48,6 +48,14 @@
         this.additionalProperties.put(name, value);
     }
 
+    public List<VnfResult> getResults() {
+        return results;
+    }
+
+    public void setResults(List<VnfResult> results) {
+        this.results = results;
+    }
+
     @Override
     public String toString() {
         return MoreObjects.toStringHelper(this)
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
index 6059eec..d03362b 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
@@ -34,7 +34,7 @@
 
     public SubscriberListWithFilterData(SubscriberList subscriberList, RoleValidator roleValidator){
         List<Subscriber> subscribers = subscriberList != null ? subscriberList.customer : new ArrayList<>();
-        List<SubscriberWithFilter> subscribersWithFilter = new ArrayList<>();
+        customer = new ArrayList<>();
         for (Subscriber subscriber :subscribers){
             SubscriberWithFilter subscriberWithFilter = new SubscriberWithFilter();
             subscriberWithFilter.setIsPermitted(roleValidator.isSubscriberPermitted(subscriber.globalCustomerId));
@@ -42,10 +42,9 @@
             subscriberWithFilter.resourceVersion = subscriber.resourceVersion;
             subscriberWithFilter.subscriberName = subscriber.subscriberName;
             subscriberWithFilter.globalCustomerId = subscriber.globalCustomerId;
-            subscribersWithFilter.add(subscriberWithFilter);
+            customer.add(subscriberWithFilter);
         }
-        this.customer = subscribersWithFilter;
-     }
+    }
 
     public List<SubscriberWithFilter> customer;
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
index c30570d..d6eb052 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
@@ -27,20 +27,17 @@
 
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class RelationshipList {
-	
+
+	public List<Relationship> relationship;
+
 	@JsonProperty("relationship")
 	public List<Relationship> getRelationship() {
 		return relationship;
 	}
-	
+
 	@JsonProperty("relationship")
 	public void setRelationship(List<Relationship> relationship) {
 		this.relationship = relationship;
 	}
 
-	public List<Relationship> relationship;
-	
-	
-	
-
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
index 677602b..6cbd8cd 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
@@ -25,6 +25,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
@@ -83,4 +84,22 @@
     public void setJsonAdditionalProperty(String name, Object value) {
         this.additionalProperties.put(name, value);
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        VnfResult vnfResult = (VnfResult) o;
+        return Objects.equals(id, vnfResult.id) &&
+                Objects.equals(nodeType, vnfResult.nodeType) &&
+                Objects.equals(url, vnfResult.url) &&
+                Objects.equals(properties, vnfResult.properties) &&
+                Objects.equals(relatedTo, vnfResult.relatedTo) &&
+                Objects.equals(additionalProperties, vnfResult.additionalProperties);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, nodeType, url, properties, relatedTo, additionalProperties);
+    }
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
index 8f53fcd..92d8de7 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
@@ -133,7 +133,7 @@
 	 *
 	 * @param baseURL the base URL
 	 */
-	public void SetRestSrvrBaseURL(String baseURL)
+	public void setRestSrvrBaseURL(String baseURL)
 	{
 		if (baseURL == null) {
 			logger.info(EELFLoggerDelegate.errorLogger, "REST Server base URL cannot be null.");
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
index e2a9140..3aff7fe 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
@@ -3,6 +3,7 @@
  * VID
  * ================================================================================
  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nokia.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +21,19 @@
 
 package org.onap.vid.controller;
 
+import static org.onap.vid.utils.Logging.getMethodName;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.onap.portalsdk.core.controller.RestrictedBaseController;
@@ -47,25 +60,15 @@
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.HandlerMapping;
 import org.springframework.web.servlet.ModelAndView;
 
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.stream.Collectors;
-
-import static org.onap.vid.utils.Logging.getMethodName;
-
 /**
  * Controller to handle a&ai requests.
  */
@@ -73,35 +76,26 @@
 @RestController
 public class AaiController extends RestrictedBaseController {
 
-    /**
-     * The from app id.
-     */
-    private String fromAppId = "VidAaiController";
-    /**
-     * The logger.
-     */
     private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(AaiController.class);
-    /**
-     * The model.
-     */
-    private Map<String, Object> model = new HashMap<>();
-    /**
-     * The servlet context.
-     */
-    @Autowired
-    private ServletContext servletContext;
-    /**
-     * aai service
-     */
-    @Autowired
+    private static final String FROM_APP_ID = "VidAaiController";
+
     private AaiService aaiService;
-    @Autowired
-    private RoleProvider roleProvider;
-    @Autowired
     private AAIRestInterface aaiRestInterface;
-    @Autowired
+    private RoleProvider roleProvider;
     private SystemPropertiesWrapper systemPropertiesWrapper;
 
+    @Autowired
+    public AaiController(AaiService aaiService,
+        AAIRestInterface aaiRestInterface,
+        RoleProvider roleProvider,
+        SystemPropertiesWrapper systemPropertiesWrapper) {
+
+        this.aaiService = aaiService;
+        this.aaiRestInterface = aaiRestInterface;
+        this.roleProvider = roleProvider;
+        this.systemPropertiesWrapper = systemPropertiesWrapper;
+    }
+
     /**
      * Welcome method.
      *
@@ -155,7 +149,7 @@
      */
     @RequestMapping(value = "/aai_get_services", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity<String> doGetServices(HttpServletRequest request) throws IOException {
-        RoleValidator roleValidator = new RoleValidator(roleProvider.getUserRoles(request));
+        RoleValidator roleValidator = RoleValidator.by(roleProvider.getUserRoles(request));
 
         AaiResponse subscriberList = aaiService.getServices(roleValidator);
         return aaiResponseToResponseEntity(subscriberList);
@@ -279,7 +273,7 @@
     public ResponseEntity<String> getFullSubscriberList(HttpServletRequest request) throws IOException {
         ObjectMapper objectMapper = new ObjectMapper();
         ResponseEntity<String> responseEntity;
-        RoleValidator roleValidator = new RoleValidator(roleProvider.getUserRoles(request));
+        RoleValidator roleValidator = RoleValidator.by(roleProvider.getUserRoles(request));
         SubscriberFilteredResults subscriberList = aaiService.getFullSubscriberList(roleValidator);
         if (subscriberList.getHttpCode() == 200) {
             responseEntity = new ResponseEntity<>(objectMapper.writeValueAsString(subscriberList.getSubscriberList()), HttpStatus.OK);
@@ -342,7 +336,7 @@
         ObjectMapper objectMapper = new ObjectMapper();
         ResponseEntity responseEntity;
         List<Role> roles = roleProvider.getUserRoles(request);
-        RoleValidator roleValidator = new RoleValidator(roles);
+        RoleValidator roleValidator = RoleValidator.by(roles);
         AaiResponse subscriberData = aaiService.getSubscriberData(subscriberId, roleValidator);
         String httpMessage = subscriberData.getT() != null ?
                 objectMapper.writeValueAsString(subscriberData.getT()) :
@@ -371,7 +365,7 @@
         ResponseEntity responseEntity;
 
         List<Role> roles = roleProvider.getUserRoles(request);
-        RoleValidator roleValidator = new RoleValidator(roles);
+        RoleValidator roleValidator = RoleValidator.by(roles);
 
         AaiResponse<ServiceInstancesSearchResults> searchResult = aaiService.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator, owningEntities, projects);
 
@@ -533,7 +527,7 @@
         try {
             ObjectMapper objectMapper = new ObjectMapper();
             List<Role> roles = roleProvider.getUserRoles(request);
-            RoleValidator roleValidator = new RoleValidator(roles);
+            RoleValidator roleValidator = RoleValidator.by(roles);
             AaiResponse<GetTenantsResponse[]> response = aaiService.getTenants(globalCustomerId, serviceType, roleValidator);
             if (response.getHttpCode() == 200) {
                 responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(response.getT()), HttpStatus.OK);
@@ -620,7 +614,7 @@
         try {
 
 
-            resp = aaiRestInterface.RestGet(fromAppId, transId, Unchecked.toURI(uri), xml).getResponse();
+            resp = aaiRestInterface.RestGet(FROM_APP_ID, transId, Unchecked.toURI(uri), xml).getResponse();
 
         } catch (WebApplicationException e) {
             final String message = e.getResponse().readEntity(String.class);
@@ -649,7 +643,7 @@
         Response resp = null;
         try {
 
-            resp = aaiRestInterface.RestPost(fromAppId, uri, payload, xml);
+            resp = aaiRestInterface.RestPost(FROM_APP_ID, uri, payload, xml);
 
         } catch (Exception e) {
             LOGGER.info(EELFLoggerDelegate.errorLogger, "<== " + "." + methodName + e.toString());
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/AlwaysValidRoleValidator.java b/vid-app-common/src/main/java/org/onap/vid/roles/AlwaysValidRoleValidator.java
new file mode 100644
index 0000000..4e5340f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/AlwaysValidRoleValidator.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.roles;
+
+public class AlwaysValidRoleValidator implements RoleValidator {
+
+    AlwaysValidRoleValidator() {
+        // package visibility, only for RoleValidator's factory
+    }
+
+    @Override
+    public boolean isSubscriberPermitted(String subscriberName) {
+        return true;
+    }
+
+    @Override
+    public boolean isServicePermitted(String subscriberName, String serviceType) {
+        return true;
+    }
+
+    @Override
+    public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) {
+        return true;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
index d3d2b80..6c0fd3f 100644
--- a/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
@@ -24,6 +24,14 @@
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import io.joshworks.restclient.http.HttpResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletRequest;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.web.support.UserUtils;
 import org.onap.vid.aai.exceptions.RoleParsingException;
@@ -34,11 +42,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.http.HttpServletRequest;
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
 
 /**
  * Created by Oren on 7/1/17.
@@ -159,7 +162,7 @@
     }
 
     public RoleValidator getUserRolesValidator(HttpServletRequest request) {
-        return new RoleValidator(getUserRoles(request));
+        return RoleValidator.by(getUserRoles(request));
     }
 }
 
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
index 315e22d..d374776 100644
--- a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
@@ -3,13 +3,14 @@
  * VID
  * ================================================================================
  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018 - 2019 Nokia. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,70 +21,24 @@
 
 package org.onap.vid.roles;
 
-import org.onap.vid.mso.rest.RequestDetails;
-
 import java.util.List;
-import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.onap.portalsdk.core.util.SystemProperties;
 
-/**
- * Created by Oren on 7/12/17.
- */
-public class RoleValidator {
+public interface RoleValidator {
 
-    private boolean disableRoles = true;
-    private List<Role> userRoles;
+    static RoleValidator by(List<Role> roles) {
+        boolean disableRoles =
+            StringUtils.equals(SystemProperties.getProperty("role_management_activated"), "false");
 
-    public RoleValidator(List<Role> roles) {
-        this.userRoles = roles;
+        return disableRoles
+            ? new AlwaysValidRoleValidator()
+            : new RoleValidatorByRoles(roles);
     }
 
-    public boolean isSubscriberPermitted(String subscriberName) {
-        if (this.disableRoles) return true;
+    boolean isSubscriberPermitted(String subscriberName);
 
-        for (Role role : userRoles) {
-            if (role.getSubscribeName().equals(subscriberName))
-                return true;
-        }
-        return false;
-    }
+    boolean isServicePermitted(String subscriberName, String serviceType);
 
-    public boolean isServicePermitted(String subscriberName, String serviceType) {
-        if (this.disableRoles) return true;
-
-        for (Role role : userRoles) {
-            if (role.getSubscribeName().equals(subscriberName) && role.getServiceType().equals(serviceType))
-                return true;
-        }
-        return false;
-    }
-
-    public boolean isMsoRequestValid(RequestDetails mso_request) {
-        if (this.disableRoles) return true;
-
-        try {
-            String globalSubscriberIdRequested = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("subscriberInfo")).get("globalSubscriberId");
-            String serviceType = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("requestParameters")).get("subscriptionServiceType");
-            return isServicePermitted(globalSubscriberIdRequested, serviceType);
-        } catch (Exception e) {
-            //Until we'll get the exact information regarding the tenants and the global customer id, we'll return true on unknown requests to mso
-            return true;
-        }
-    }
-
-    public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) {
-        if (this.disableRoles) return true;
-
-        for (Role role : userRoles) {
-            if (role.getSubscribeName().equals(globalCustomerId)
-                    && role.getServiceType().equals(serviceType)
-                    && (role.getTenant() == null || role.getTenant().equalsIgnoreCase(tenantName))) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    void enableRoles() {
-        this.disableRoles = false;
-    }
+    boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName);
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorByRoles.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorByRoles.java
new file mode 100644
index 0000000..ad5b519
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorByRoles.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.roles;
+
+import java.util.List;
+import java.util.Map;
+import org.onap.vid.mso.rest.RequestDetails;
+
+public class RoleValidatorByRoles implements RoleValidator {
+
+    private final List<Role> userRoles;
+
+    RoleValidatorByRoles(List<Role> roles) {
+        this.userRoles = roles;
+    }
+
+    @Override
+    public boolean isSubscriberPermitted(String subscriberName) {
+        for (Role role : userRoles) {
+            if (role.getSubscribeName().equals(subscriberName)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isServicePermitted(String subscriberName, String serviceType) {
+        for (Role role : userRoles) {
+            if (role.getSubscribeName().equals(subscriberName) && role.getServiceType().equals(serviceType)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) {
+        for (Role role : userRoles) {
+            if (role.getSubscribeName().equals(globalCustomerId)
+                && role.getServiceType().equals(serviceType)
+                && (role.getTenant() == null || role.getTenant().equalsIgnoreCase(tenantName))) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    boolean isMsoRequestValid(RequestDetails msoRequest) {
+        try {
+            String globalSubscriberIdRequested = (String) ((Map) ((Map) msoRequest.getAdditionalProperties()
+                .get("requestDetails")).get("subscriberInfo")).get("globalSubscriberId");
+            String serviceType = (String) ((Map) ((Map) msoRequest.getAdditionalProperties().get("requestDetails"))
+                .get("requestParameters")).get("subscriptionServiceType");
+            return isServicePermitted(globalSubscriberIdRequested, serviceType);
+        } catch (Exception e) {
+            //Until we'll get the exact information regarding the tenants and the global customer id, we'll return true on unknown requests to mso
+            return true;
+        }
+    }
+
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.js
index c4f8f14..38096a5 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.js
@@ -22,9 +22,9 @@
     'use strict';
 
     appDS2.controller("changeManagementManualTasksController", ["$uibModalInstance", "jobInfo", "MsoService", "COMPONENT",
-        "$log", changeManagementManualTasksController]);
+        "$log", "moment", changeManagementManualTasksController]);
 
-    function changeManagementManualTasksController($uibModalInstance, jobInfo, MsoService, COMPONENT, $log) {
+    function changeManagementManualTasksController($uibModalInstance, jobInfo, MsoService, COMPONENT, $log, moment) {
         var vm = this;
 
         vm.manualTasks = [];
@@ -75,6 +75,33 @@
             return vm.manualTasks.includes(task);
         };
 
+        vm.timeoutHumanized = function() {
+            // moment.duration() can parse ISO 8601 time-intervals,
+            // e.g. "P1Y2M10DT2H30M"
+            // https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
+            let duration = moment.duration(vm.timeout);
+
+            return isDurationValid()
+                ? durationAsHoursAndMinutes() + ' hours (' + vm.timeout + ')'
+                : vm.timeout;
+
+
+            function isDurationValid() {
+                return duration.isValid() && duration.toISOString() !== 'P0D';
+            }
+
+            function durationAsHoursAndMinutes() {
+                return ''
+                    + Math.floor(duration.asHours())
+                    + ':'
+                    + withLeadingZero(duration.minutes());
+            }
+
+            function withLeadingZero(x) {
+                return ("00" + Math.round(x)).slice(-2);
+            }
+        };
+
         vm.__test_only__ = {
             loadAvailableTasks: loadAvailableTasks,
         };
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.test.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.test.js
index 93bc1c2..deefca7 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.test.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.test.js
@@ -20,6 +20,7 @@
 
 require('./change-management-manual-tasks.controller');
 const jestMock = require('jest-mock');
+const moment = require('moment');
 
 describe('changeManagementManualTasksController testing', () => {
     let $controller;
@@ -41,6 +42,7 @@
             "MsoService": $MsoService,
             "$uibModalInstance": $uibModalInstance,
             "$log": $log,
+            "moment": moment,
             "jobInfo": {
                 requestState: job.requestStatus.requestState,
                 details: job.requestStatus.statusMessage,
@@ -141,6 +143,26 @@
         });
     });
 
+    test('should humanize timeout if proper ISO-8601', () => {
+        $controller.timeout = 'PT3350S';
+        expect($controller.timeoutHumanized()).toEqual('0:55 hours (PT3350S)');
+    });
+
+    test('should humanize timeout if proper ISO-8601', () => {
+        $controller.timeout = 'P3DT1H1M';
+        expect($controller.timeoutHumanized()).toEqual('73:01 hours (P3DT1H1M)');
+    });
+
+    test('should drive-through timeout if not proper ISO-8601', () => {
+        $controller.timeout = '56 minutes';
+        expect($controller.timeoutHumanized()).toEqual('56 minutes');
+    });
+
+    test('should drive-through timeout if undefined', () => {
+        $controller.timeout = undefined;
+        expect($controller.timeoutHumanized()).toEqual(undefined);
+    });
+
     test('should find manual task using isTaskAvailable', () => {
         expect($controller.isTaskAvailable('abort')).toBeTruthy();
         expect($controller.isTaskAvailable('resume')).toBeTruthy();
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html
index 099a6ad..031146e 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html
@@ -20,7 +20,7 @@
 
 <div class="modal-body">
     <span id="in-progress-modal-description" ng-if="vm.description">{{vm.description}}</span>
-    <span id="in-progress-modal-timeout" ng-if="vm.timeout">({{vm.timeout}})</span>
+  <span id="in-progress-modal-timeout" ng-if="vm.timeout" class="text-danger"><strong>(task will time out in {{vm.timeoutHumanized()}})</strong></span>
 </div>
 
 <div class="modal-footer">
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/AaiGetVnfResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/AaiGetVnfResponseTest.java
index 5eb47a1..9d8734b 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/AaiGetVnfResponseTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/AaiGetVnfResponseTest.java
@@ -20,34 +20,88 @@
 
 package org.onap.vid.aai;
 
-import java.util.Map;
+import java.io.IOException;
+import java.util.*;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.junit.Before;
 import org.junit.Test;
+import org.onap.vid.aai.model.VnfResult;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
 
 public class AaiGetVnfResponseTest {
 
-	private AaiGetVnfResponse createTestSubject() {
-		return new AaiGetVnfResponse();
+	private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+	private static final String VNF_RESULT =
+			"{\n" +
+					"	\"id\": \"1\",\n" +
+					"   \"nodetype\": \"testNodeType\",\n" +
+					"   \"url\": \"test/url\",\n" +
+					"   \"serviceProperties\": {},\n" +
+					"   \"relatedTo\": []\n" +
+					"}\n";
+
+	private static final String AAI_GET_VNF_RESPONSE_TEST = "{ \n" +
+			"  \"results\": \n" +
+			"  [\n" +
+					VNF_RESULT +
+			"  ]\n" +
+			"}";
+
+
+	private AaiGetVnfResponse aaiGetVnfResponse;
+	private VnfResult expectedVnfResult;
+	private List<VnfResult> expectedList;
+
+	@Before
+	public void setUp() throws IOException {
+		expectedVnfResult = OBJECT_MAPPER.readValue(VNF_RESULT, VnfResult.class);
+		expectedList = Collections.singletonList(expectedVnfResult);
+
 	}
 
 	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		AaiGetVnfResponse testSubject;
-		Map<String, Object> result;
+	public void shouldHaveProperSetters() {
+		aaiGetVnfResponse = new AaiGetVnfResponse();
+		aaiGetVnfResponse.setAdditionalProperty("key","value");
+		aaiGetVnfResponse.setResults(expectedList);
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
+		assertEquals(aaiGetVnfResponse.getAdditionalProperties().size(), 1);
+		assertTrue(aaiGetVnfResponse.getAdditionalProperties().containsKey("key"));
+		assertTrue(aaiGetVnfResponse.getAdditionalProperties().containsValue("value"));
+		assertEquals(aaiGetVnfResponse.getResults().size(), 1);
+		assertEquals(aaiGetVnfResponse.getResults().get(0), expectedVnfResult);
 	}
 
 	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		AaiGetVnfResponse testSubject;
-		String name = "";
-		Object value = null;
+	public void shouldProperlyConvertJsonToAiiGetVnfResponse() throws IOException {
+		aaiGetVnfResponse = OBJECT_MAPPER.readValue(AAI_GET_VNF_RESPONSE_TEST, AaiGetVnfResponse.class);
+		assertThat(aaiGetVnfResponse.getResults(), is(expectedList));
+	}
 
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
+	@Test
+	public void shouldReturnProperToString(){
+		aaiGetVnfResponse = new AaiGetVnfResponse();
+		aaiGetVnfResponse.setAdditionalProperty("testKey","testValue");
+		aaiGetVnfResponse.setResults(expectedList);
+		Map<String,Object> expectedMap = new HashMap<>();
+		expectedMap.put("testKey", "testValue");
+
+		String expectedOutput = "AaiGetVnfResponse{" +
+				"results=" + expectedList +
+				", additionalProperties="+expectedMap+"}";
+
+		assertEquals(aaiGetVnfResponse.toString(), expectedOutput);
+	}
+
+	@Test
+	public void shouldAddAdditionalProperty(){
+		aaiGetVnfResponse = new AaiGetVnfResponse();
+		aaiGetVnfResponse.setAdditionalProperty("key", "value");
+		assertTrue(aaiGetVnfResponse.getAdditionalProperties().containsKey("key"));
 	}
 }
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/OperationalEnvironmentTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/OperationalEnvironmentTest.java
index 7f5e362..c331b32 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/OperationalEnvironmentTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/OperationalEnvironmentTest.java
@@ -23,10 +23,14 @@
 
 
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Assert;
+import org.onap.vid.aai.model.RelationshipList;
 import org.testng.annotations.Test;
 
 import java.io.IOException;
+import java.util.ArrayList;
 
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
 import static org.assertj.core.api.Assertions.assertThat;
 
 
@@ -48,8 +52,29 @@
             "}";
 
     @Test
+    public void shouldCreateProperOperationalEnvironmentWithConstructor(){
+        RelationshipList relationshipList = new RelationshipList();
+        relationshipList.relationship = new ArrayList<>();
+
+        OperationalEnvironment operationalEnvironment = new OperationalEnvironment("testId",
+                "testEnvName", "testEnvType",
+                "testEnvStatus", "testTenant", "testWorkload",
+                "testResource", relationshipList);
+
+        assertThat(operationalEnvironment.getOperationalEnvironmentId()).isEqualTo("testId");
+        assertThat(operationalEnvironment.getWorkloadContext()).isEqualTo("testWorkload");
+        assertThat(operationalEnvironment.getRelationshipList().getRelationship()).hasSize(0);
+        assertThat(operationalEnvironment.getResourceVersion()).isEqualTo("testResource");
+        assertThat(operationalEnvironment.getTenantContext()).isEqualTo("testTenant");
+        assertThat(operationalEnvironment.getOperationalEnvironmentType()).isEqualTo("testEnvType");
+        assertThat(operationalEnvironment.getOperationalEnvironmentStatus()).isEqualTo("testEnvStatus");
+        assertThat(operationalEnvironment.getOperationalEnvironmentName()).isEqualTo("testEnvName");
+    }
+
+    @Test
     public void shouldProperlyConvertJsonToOperationalEnvironment() throws IOException {
-        OperationalEnvironment operationalEnvironment = OBJECT_MAPPER.readValue(OPERATIONAL_ENVIRONMENT_TEST, OperationalEnvironment.class);
+        OperationalEnvironment operationalEnvironment =
+                OBJECT_MAPPER.readValue(OPERATIONAL_ENVIRONMENT_TEST, OperationalEnvironment.class);
 
         assertThat(operationalEnvironment.getOperationalEnvironmentId()).isEqualTo("environmentId");
         assertThat(operationalEnvironment.getWorkloadContext()).isEqualTo("workloadContext");
@@ -60,4 +85,5 @@
         assertThat(operationalEnvironment.getOperationalEnvironmentStatus()).isEqualTo("environmentStatus");
         assertThat(operationalEnvironment.getOperationalEnvironmentName()).isEqualTo("environmentName");
     }
+
 }
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberAaiResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberAaiResponseTest.java
index ef2220c..b8dd2cf 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberAaiResponseTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberAaiResponseTest.java
@@ -20,23 +20,39 @@
 
 package org.onap.vid.aai;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.junit.Test;
+import org.onap.vid.model.Subscriber;
 import org.onap.vid.model.SubscriberList;
 
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
 public class SubscriberAaiResponseTest {
 
-	private SubscriberAaiResponse createTestSubject() {
-		return new SubscriberAaiResponse(new SubscriberList(), "", 0);
-	}
+	private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
 
-	
+	private static final String SUBSCRIBER_JSON_EXAMPLE = "{\n" +
+			"  \"global-customer-id\": \"id\",\n" +
+			"  \"subscriber-name\": \"name\",\n" +
+			"  \"subscriber-type\": \"type\",\n" +
+			"  \"resource-version\": \"version\"\n" +
+			"}";
+
 	@Test
-	public void testGetSubscriberList() throws Exception {
-		SubscriberAaiResponse testSubject;
-		SubscriberList result;
+	public void shouldGetSubscriberList() throws IOException {
+		Subscriber sampleSubscriber =
+				OBJECT_MAPPER.readValue(SUBSCRIBER_JSON_EXAMPLE, Subscriber.class);
+		List<Subscriber> expectedListOfSubscribers = Arrays.asList(sampleSubscriber);
+		SubscriberList expectedSubscriberList = new SubscriberList(expectedListOfSubscribers);
+		SubscriberAaiResponse subscriberAaiResponse = new SubscriberAaiResponse(expectedSubscriberList, "msg", 200);
 
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getSubscriberList();
+		assertEquals(subscriberAaiResponse.getSubscriberList(), expectedSubscriberList);
+		assertEquals(subscriberAaiResponse.getSubscriberList().customer.size(), 1);
+		assertEquals(subscriberAaiResponse.getSubscriberList().customer.get(0), sampleSubscriber);
+
 	}
 }
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberFilteredResultsTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberFilteredResultsTest.java
index 4655292..f9668c9 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberFilteredResultsTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberFilteredResultsTest.java
@@ -20,45 +20,89 @@
 
 package org.onap.vid.aai;
 
+import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Before;
 import org.junit.Test;
+import org.onap.vid.model.Subscriber;
 import org.onap.vid.model.SubscriberList;
 import org.onap.vid.roles.EcompRole;
 import org.onap.vid.roles.Role;
 import org.onap.vid.roles.RoleValidator;
 
+import static org.junit.Assert.assertEquals;
+
 public class SubscriberFilteredResultsTest {
 
-    private SubscriberFilteredResults createTestSubject() {
-        ArrayList<Role> list = new ArrayList<Role>();
-        list.add(new Role(EcompRole.READ, "a", "a", "a"));
-        RoleValidator rl=new RoleValidator(list);
-        SubscriberList sl = new SubscriberList();
-        sl.customer = new ArrayList<org.onap.vid.model.Subscriber>();
-        sl.customer.add(new org.onap.vid.model.Subscriber());
-        return new SubscriberFilteredResults(rl, sl, "OK", 200);
+    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+    private SubscriberFilteredResults subscriberFilteredResults;
+    private RoleValidator roleValidator;
+    private SubscriberList subscriberList;
+    private SubscriberListWithFilterData subscriberListWithFilterData;
+
+    private static final String SUBSCRIBER_JSON_EXAMPLE = "{\n" +
+            "  \"global-customer-id\": \"id\",\n" +
+            "  \"subscriber-name\": \"name\",\n" +
+            "  \"subscriber-type\": \"type\",\n" +
+            "  \"resource-version\": \"version\"\n" +
+            "}";
+
+    @Before
+    public void setUp() throws IOException {
+        createTestSubject();
     }
 
     @Test
-    public void testGetSubscriberList() throws Exception {
-        SubscriberFilteredResults testSubject;
-        SubscriberListWithFilterData result;
-
-        // default test
-        testSubject = createTestSubject();
-        result = testSubject.getSubscriberList();
+    public void testGetSubscriberList(){
+        assertEquals(subscriberFilteredResults.getSubscriberList(), subscriberListWithFilterData);
     }
 
     @Test
     public void testSetSubscriberList() throws Exception {
-        SubscriberFilteredResults testSubject;
-        SubscriberListWithFilterData subscriberList = null;
+        subscriberList.customer = new ArrayList<>();
+        subscriberList.customer.add(new Subscriber());
+        SubscriberListWithFilterData expectedList = createSubscriberList(subscriberList,roleValidator);
+        subscriberFilteredResults.setSubscriberList(expectedList);
 
-        // default test
-        testSubject = createTestSubject();
-        //testSubject.setSubscriberList(subscriberList);
-        testSubject.getSubscriberList();
+        assertEquals(subscriberFilteredResults.getSubscriberList(), expectedList);
+    }
+
+    private void createTestSubject() throws IOException {
+        prepareRoleValidator();
+        prepareSubscriberList();
+        prepareSubscriberListWithFilterData();
+        createSubscriberFilteredResults();
+    }
+
+    private void createSubscriberFilteredResults() {
+        subscriberFilteredResults =
+                new SubscriberFilteredResults(roleValidator, subscriberList, "OK", 200);
+        subscriberFilteredResults.setSubscriberList(subscriberListWithFilterData);
+    }
+
+    private void prepareSubscriberListWithFilterData() {
+        subscriberListWithFilterData = createSubscriberList(subscriberList, roleValidator);
+    }
+
+    private void prepareRoleValidator() {
+        ArrayList<Role> list = new ArrayList<>();
+        list.add(new Role(EcompRole.READ, "a", "a", "a"));
+       roleValidator = RoleValidator.by(list);
+    }
+
+    private void prepareSubscriberList() throws IOException {
+        Subscriber sampleSubscriber =
+                OBJECT_MAPPER.readValue(SUBSCRIBER_JSON_EXAMPLE, Subscriber.class);
+        List<Subscriber> expectedListOfSubscribers = Collections.singletonList(sampleSubscriber);
+        subscriberList = new SubscriberList(expectedListOfSubscribers);
+    }
+
+    private SubscriberListWithFilterData createSubscriberList(SubscriberList subscriberList,
+                                                              RoleValidator roleValidator){
+        return new SubscriberListWithFilterData(subscriberList,roleValidator);
     }
 }
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/ServicePropertiesTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ServicePropertiesTest.java
similarity index 96%
rename from vid-app-common/src/test/java/org/onap/vid/aai/ServicePropertiesTest.java
rename to vid-app-common/src/test/java/org/onap/vid/aai/model/ServicePropertiesTest.java
index 4c08753..3eccba9 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/ServicePropertiesTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ServicePropertiesTest.java
@@ -18,12 +18,11 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.aai;
+package org.onap.vid.aai.model;
 
 import java.io.IOException;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.onap.vid.aai.model.ServiceProperties;
 import org.testng.annotations.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -82,10 +81,9 @@
     }
 
     @Test
-    public void shouldProperlyAddAdditionalProperty() throws IOException {
+    public void shouldAddAdditionalProperty() throws IOException {
         ServiceProperties serviceProperties = OBJECT_MAPPER.readValue(SERVICE_PROPERTIES_JSON, ServiceProperties.class);
 
-
         serviceProperties.setAdditionalProperty("additional", "property");
 
         assertThat(serviceProperties.getAdditionalProperties())
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/VnfResultTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/VnfResultTest.java
similarity index 93%
rename from vid-app-common/src/test/java/org/onap/vid/aai/VnfResultTest.java
rename to vid-app-common/src/test/java/org/onap/vid/aai/model/VnfResultTest.java
index 7ee3b61..075d29f 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/VnfResultTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/VnfResultTest.java
@@ -18,14 +18,16 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.aai;
+package org.onap.vid.aai.model;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.onap.vid.aai.model.VnfResult;
+import org.junit.Assert;
 import org.testng.annotations.Test;
 
 import java.io.IOException;
 
+import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanEquals;
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
 import static org.assertj.core.api.Assertions.assertThat;
 
 
@@ -68,7 +70,6 @@
             "\t}]\n" +
             "}";
 
-
     @Test
     public void shouldProperlyConvertJsonToVnfResult() throws IOException {
         VnfResult vnfResult = OBJECT_MAPPER.readValue(VNF_RESULT_JSON, VnfResult.class);
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/util/AAIRestInterfaceTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/util/AAIRestInterfaceTest.java
index 3ed59ed..e64b2ac 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/util/AAIRestInterfaceTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/util/AAIRestInterfaceTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * VID
  * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 - 2019 Nokia. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,80 +20,276 @@
 
 package org.onap.vid.aai.util;
 
-import org.junit.Test;
+
+import org.mockito.Mock;
+import org.mockito.Mockito;
+
+import org.onap.vid.aai.ExceptionWithRequestInfo;
+import org.onap.vid.aai.exceptions.InvalidPropertyException;
+import org.onap.vid.exceptions.GenericUncheckedException;
+import org.onap.vid.utils.Unchecked;
+import org.springframework.http.HttpMethod;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.util.Optional;
+import java.util.UUID;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
+import static javax.ws.rs.core.Response.Status.*;
+import static junit.framework.TestCase.assertSame;
+import static junit.framework.TestCase.fail;
+import static org.junit.Assert.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.MockitoAnnotations.initMocks;
+
 
 public class AAIRestInterfaceTest {
 
-    /*
-    TO BE IMPLEMENTED
-    
+    private static final String PATH = "path";
+    private static final String HTTP_LOCALHOST = "http://localhost/";
+    @Mock
+    private Client client;
+    @Mock
+    private WebTarget webTarget;
+    @Mock
+    private Invocation.Builder builder;
+    @Mock
+    private Invocation invocation;
+    @Mock
+    private ServletRequestHelper servletRequestHelper;
+    @Mock
+    private HttpsAuthClient httpsAuthClient;
+    @Mock
+    private HttpServletRequest httpServletRequest;
+    @Mock
+    private Response response;
+    @Mock
+    private SystemPropertyHelper systemPropertyHelper;
+
+    private AAIRestInterface testSubject;
+
+    @BeforeMethod
+    public void setUp() throws Exception {
+        initMocks(this);
+        mockSystemProperties();
+        testSubject = createTestSubject();
+        when(client.target(HTTP_LOCALHOST+PATH)).thenReturn(webTarget);
+        when(webTarget.request()).thenReturn(builder);
+        when(builder.accept(Mockito.anyString())).thenReturn(builder);
+        when(builder.header(Mockito.anyString(), Mockito.anyString())).thenReturn(builder);
+        when(builder.build(Mockito.anyString())).thenReturn(invocation);
+        when(builder.build(Mockito.anyString(), any(Entity.class))).thenReturn(invocation);
+        when(invocation.invoke()).thenReturn(response);
+        when(servletRequestHelper.extractOrGenerateRequestId()).thenReturn(UUID.randomUUID().toString());
+    }
+
     private AAIRestInterface createTestSubject() {
-        return new AAIRestInterface("");
+        return new AAIRestInterface(Optional.of(client), httpsAuthClient, servletRequestHelper, systemPropertyHelper);
     }
 
     @Test
-    public void testEncodeURL() throws Exception {
-        AAIRestInterface testSubject;
-        String nodeKey = "";
-        String result;
-
-        // default test
-        testSubject = createTestSubject();
-        result = testSubject.encodeURL(nodeKey);
+    public void shouldEncodeURL() throws Exception {
+        String nodeKey = "some unusual uri";
+        String nodeKey2 = "some/usual/uri";
+        Assert.assertEquals(testSubject.encodeURL(nodeKey), "some%20unusual%20uri");
+        Assert.assertEquals(testSubject.encodeURL(nodeKey2), "some%2Fusual%2Furi");
     }
 
     @Test
-    public void testSetRestSrvrBaseURL() throws Exception {
-        AAIRestInterface testSubject;
-        String baseURL = "";
-
-        // test 1
-        testSubject = createTestSubject();
-        baseURL = null;
-        testSubject.SetRestSrvrBaseURL(baseURL);
-
-        // test 2
-        testSubject = createTestSubject();
-        baseURL = "";
-        testSubject.SetRestSrvrBaseURL(baseURL);
+    public void shouldSetRestSrvrBaseURL() {
+        String baseUrl = "anything";
+        testSubject.setRestSrvrBaseURL(baseUrl);
+        Assert.assertEquals(testSubject.getRestSrvrBaseURL(), baseUrl);
     }
 
     @Test
-    public void testGetRestSrvrBaseURL() throws Exception {
-        AAIRestInterface testSubject;
-        String result;
+    public void shouldExecuteRestJsonPutMethodWithResponse200() {
+        // given
+        String payload = "{\"id\": 1}";
+        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
 
-        // default test
-        testSubject = createTestSubject();
-        result = testSubject.getRestSrvrBaseURL();
+        // when
+        when(response.getStatusInfo()).thenReturn(OK);
+        Response finalResponse = testSubject.RestPut("", PATH, payload, false, true).getResponse();
+
+        // then
+        verify(builder).build(HttpMethod.PUT.name(), entity);
+        Assert.assertEquals(response, finalResponse);
     }
 
+    @Test(expectedExceptions = {ExceptionWithRequestInfo.class})
+    public void shouldFailWhenRestJsonPutMethodExecuted() {
+        // given
+        String payload = "{\"id\": 1}";
 
-    @Test
-    public void testRestPut() throws Exception {
-        AAIRestInterface testSubject;
-        String fromAppId = "";
-        String transId = "";
-        String path = "";
-        String payload = "";
-        boolean xml = false;
+        // when
+        when(builder.build(eq(HttpMethod.PUT.name()), any(Entity.class))).thenThrow(new GenericUncheckedException("msg"));
+        testSubject.RestPut("", PATH, payload, false, true);
 
-        // default test
-        testSubject = createTestSubject();
-        testSubject.RestPut(fromAppId, transId, path, payload, xml);
+        //then
     }
 
     @Test
-    public void testRestPost() throws Exception {
-        AAIRestInterface testSubject;
-        String fromAppId = "";
-        String transId = "";
-        String path = "";
-        String payload = "";
-        boolean xml = false;
+    public void shouldExecuteRestJsonPutMethodWithResponse400() {
+        // given
+        String payload = "{\"id\": 1}";
+        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
 
-        // default test
-        testSubject = createTestSubject();
-        testSubject.RestPost(fromAppId, transId, path, payload, xml);
-    }*/
+        // when
+        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
+        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
+        Response finalResponse = testSubject.RestPut("", PATH, payload, false, true).getResponse();
+
+        // then
+        verify(builder).build(HttpMethod.PUT.name(), entity);
+        Assert.assertEquals(response, finalResponse);
+    }
+
+    @Test
+    public void shouldExecuteRestPostMethodWithResponse200() {
+        // given
+        String payload = "{\"id\": 1}";
+        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
+
+        // when
+        when(builder.post(Mockito.any(Entity.class))).thenReturn(response);
+        when(response.getStatusInfo()).thenReturn(OK);
+        Response finalResponse = testSubject.RestPost("", PATH, payload, false);
+
+        // then
+        verify(builder).post(entity);
+        Assert.assertEquals(response, finalResponse);
+    }
+
+    @Test
+    public void shouldExecuteRestPostMethodWithResponse400() {
+        // given
+        String payload = "{\"id\": 1}";
+        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
+
+        // when
+        when(builder.post(Mockito.any(Entity.class))).thenReturn(response);
+        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
+        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
+        Response finalResponse = testSubject.RestPost("", PATH, payload, false);
+
+        // then
+        verify(builder).post(entity);
+        Assert.assertEquals(response, finalResponse);
+    }
+
+    @Test
+    public void shouldFailWhenRestPostMethodExecuted() {
+        // given
+        String payload = "{\"id\": 1}";
+        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
+
+        // when
+        when(builder.post(Mockito.any(Entity.class))).thenThrow(new RuntimeException());
+        Response finalResponse = testSubject.RestPost("", PATH, payload, false);
+
+        // then
+        verify(builder).post(entity);
+        Assert.assertNull(finalResponse);
+    }
+
+    @Test
+    public void shouldExecuteRestDeleteMethodWithResponse400() {
+        // given
+        // when
+        when(builder.delete()).thenReturn(response);
+        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
+        String reason = "Any reason";
+        when(response.readEntity(String.class)).thenReturn(reason);
+        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
+        boolean finalResponse = testSubject.Delete("", "", PATH);
+
+        // then
+        verify(builder).delete();
+        Assert.assertFalse(finalResponse);
+    }
+
+    @Test
+    public void shouldExecuteRestDeleteMethodWithResponse404() {
+        // given
+        // when
+        when(builder.delete()).thenReturn(response);
+        when(response.getStatusInfo()).thenReturn(NOT_FOUND);
+        String reason = "Any reason";
+        when(response.readEntity(String.class)).thenReturn(reason);
+        when(response.getStatus()).thenReturn(NOT_FOUND.getStatusCode());
+        boolean finalResponse = testSubject.Delete("", "", PATH);
+
+        // then
+        verify(builder).delete();
+        Assert.assertFalse(finalResponse);
+    }
+
+    @Test
+    public void shouldFailWhenRestDeleteExecuted() {
+        // given
+        // when
+        when(builder.delete()).thenThrow(new RuntimeException());
+        boolean finalResponse = testSubject.Delete("", "", PATH);
+        // then
+        verify(builder).delete();
+        Assert.assertFalse(finalResponse);
+    }
+
+    @Test
+    public void shouldExecuteRestGetMethodWithResponse200() {
+        // given
+        // when
+        when(response.getStatusInfo()).thenReturn(OK);
+        Response finalResponse = testSubject.RestGet("", "", Unchecked.toURI(PATH), false).getResponse();
+
+        // then
+        Assert.assertEquals(response, finalResponse);
+    }
+
+    @Test
+    public void shouldExecuteRestGetMethodWithResponse400() {
+        // given
+        // when
+        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
+        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
+        Response finalResponse = testSubject.RestGet("", "", Unchecked.toURI(PATH), false).getResponse();
+
+        // then
+        Assert.assertEquals(response, finalResponse);
+    }
+
+    @Test
+    public void shouldFailWhenRestGetMethodExecuted() {
+        // given
+        // when
+        when(builder.build(HttpMethod.GET.name())).thenThrow(new RuntimeException());
+        Response finalResponse = testSubject.RestGet("", "", Unchecked.toURI(PATH), false).getResponse();
+
+        // then
+        Assert.assertNull(finalResponse);
+    }
+
+    private void mockSystemProperties() throws UnsupportedEncodingException, InvalidPropertyException {
+        when(systemPropertyHelper.getEncodedCredentials()).thenReturn("someCredentials");
+        when(systemPropertyHelper.getFullServicePath(Mockito.anyString())).thenReturn("http://localhost/path");
+        when(systemPropertyHelper.getFullServicePath(Mockito.any(URI.class))).thenReturn("http://localhost/path");
+        when(systemPropertyHelper.getServiceBasePath(Mockito.anyString())).thenReturn("http://localhost/path");
+    }
+
 }
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/util/SingleAAIRestInterfaceTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/util/SingleAAIRestInterfaceTest.java
deleted file mode 100644
index 3393aa7..0000000
--- a/vid-app-common/src/test/java/org/onap/vid/aai/util/SingleAAIRestInterfaceTest.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2018 - 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.vid.aai.util;
-
-
-import org.mockito.Mock;
-import org.mockito.Mockito;
-
-import org.onap.vid.aai.ExceptionWithRequestInfo;
-import org.onap.vid.aai.exceptions.InvalidPropertyException;
-import org.onap.vid.exceptions.GenericUncheckedException;
-import org.onap.vid.utils.Unchecked;
-import org.springframework.http.HttpMethod;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.util.Optional;
-import java.util.UUID;
-
-import static javax.ws.rs.core.Response.Status.*;
-import static junit.framework.TestCase.fail;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.mockito.MockitoAnnotations.initMocks;
-
-
-public class SingleAAIRestInterfaceTest {
-
-    private static final String PATH = "path";
-    private static final String HTTP_LOCALHOST = "http://localhost/";
-    @Mock
-    private Client client;
-    @Mock
-    private WebTarget webTarget;
-    @Mock
-    private Invocation.Builder builder;
-    @Mock
-    private Invocation invocation;
-    @Mock
-    private ServletRequestHelper servletRequestHelper;
-    @Mock
-    private HttpsAuthClient httpsAuthClient;
-    @Mock
-    private HttpServletRequest httpServletRequest;
-    @Mock
-    private Response response;
-    @Mock
-    private SystemPropertyHelper systemPropertyHelper;
-
-    private AAIRestInterface testSubject;
-
-    @BeforeMethod
-    public void setUp() throws Exception {
-        initMocks(this);
-        mockSystemProperties();
-        testSubject = createTestSubject();
-        when(client.target(HTTP_LOCALHOST+PATH)).thenReturn(webTarget);
-        when(webTarget.request()).thenReturn(builder);
-        when(builder.accept(Mockito.anyString())).thenReturn(builder);
-        when(builder.header(Mockito.anyString(), Mockito.anyString())).thenReturn(builder);
-        when(builder.build(Mockito.anyString())).thenReturn(invocation);
-        when(builder.build(Mockito.anyString(), any(Entity.class))).thenReturn(invocation);
-        when(invocation.invoke()).thenReturn(response);
-        when(servletRequestHelper.extractOrGenerateRequestId()).thenReturn(UUID.randomUUID().toString());
-    }
-
-    private AAIRestInterface createTestSubject() {
-        return new AAIRestInterface(Optional.of(client), httpsAuthClient, servletRequestHelper, systemPropertyHelper);
-    }
-
-    @Test
-    public void testEncodeURL() throws Exception {
-        String nodeKey = "some unusual uri";
-        Assert.assertEquals(testSubject.encodeURL(nodeKey), "some%20unusual%20uri");
-    }
-
-    @Test
-    public void testSetRestSrvrBaseURLWithNullValue() {
-        testSubject.SetRestSrvrBaseURL(null);
-    }
-
-    @Test
-    public void testSetRestSrvrBaseURL() {
-        String baseUrl = "anything";
-        testSubject.SetRestSrvrBaseURL(baseUrl);
-        Assert.assertEquals(testSubject.getRestSrvrBaseURL(), baseUrl);
-    }
-
-    @Test
-    public void testRestJsonPutWithResponse200() {
-        // given
-        String methodName = "RestPut";
-        String payload = "{\"id\": 1}";
-        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
-
-        // when
-        when(response.getStatusInfo()).thenReturn(OK);
-        Response finalResponse = testSubject.RestPut("", PATH, payload, false, true).getResponse();
-
-        // then
-        verify(builder).build(HttpMethod.PUT.name(), entity);
-        Assert.assertEquals(response, finalResponse);
-    }
-
-    @Test(expectedExceptions = {ExceptionWithRequestInfo.class})
-    public void testFailedRestJsonPut() {
-        // given
-        String methodName = "RestPut";
-        String payload = "{\"id\": 1}";
-        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
-
-        // when
-        when(builder.build(eq(HttpMethod.PUT.name()), any(Entity.class))).thenThrow(new GenericUncheckedException("msg"));
-        Response finalResponse = testSubject.RestPut("", PATH, payload, false, true).getResponse();
-
-        // then
-        fail("expected unreachable: exception to be thrown");
-    }
-
-    @Test
-    public void testRestJsonPutWithResponse400() {
-        // given
-        String methodName = "RestPut";
-        String payload = "{\"id\": 1}";
-        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
-
-        // when
-        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
-        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
-        Response finalResponse = testSubject.RestPut("", PATH, payload, false, true).getResponse();
-
-        // then
-        verify(builder).build(HttpMethod.PUT.name(), entity);
-        Assert.assertEquals(response, finalResponse);
-    }
-
-    @Test
-    public void testRestPostWithResponse200() {
-        // given
-        String methodName = "RestPost";
-        String payload = "{\"id\": 1}";
-        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
-
-        // when
-        when(builder.post(Mockito.any(Entity.class))).thenReturn(response);
-        when(response.getStatusInfo()).thenReturn(OK);
-        Response finalResponse = testSubject.RestPost("", PATH, payload, false);
-
-        // then
-        verify(builder).post(entity);
-        Assert.assertEquals(response, finalResponse);
-    }
-
-    @Test
-    public void testRestPostWithResponse400() {
-        // given
-        String methodName = "RestPost";
-        String payload = "{\"id\": 1}";
-        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
-
-        // when
-        when(builder.post(Mockito.any(Entity.class))).thenReturn(response);
-        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
-        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
-        Response finalResponse = testSubject.RestPost("", PATH, payload, false);
-
-        // then
-        verify(builder).post(entity);
-        Assert.assertEquals(response, finalResponse);
-    }
-
-    @Test
-    public void testFailedRestPost() {
-        // given
-        String methodName = "RestPost";
-        String payload = "{\"id\": 1}";
-        Entity<String> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
-
-        // when
-        when(builder.post(Mockito.any(Entity.class))).thenThrow(new RuntimeException());
-        Response finalResponse = testSubject.RestPost("", PATH, payload, false);
-
-        // then
-        verify(builder).post(entity);
-        Assert.assertEquals(finalResponse, null);
-    }
-
-    @Test
-    public void testRestDeleteWithResponse400() {
-        // given
-        String methodName = "Delete";
-
-        // when
-        when(builder.delete()).thenReturn(response);
-        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
-        String reason = "Any reason";
-        when(response.readEntity(String.class)).thenReturn(reason);
-        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
-        boolean finalResponse = testSubject.Delete("", "", PATH);
-
-        // then
-        verify(builder).delete();
-        Assert.assertFalse(finalResponse);
-    }
-
-    @Test
-    public void testRestDeleteWithResponse404() {
-        // given
-        String methodName = "Delete";
-
-        // when
-        when(builder.delete()).thenReturn(response);
-        when(response.getStatusInfo()).thenReturn(NOT_FOUND);
-        String reason = "Any reason";
-        when(response.readEntity(String.class)).thenReturn(reason);
-        when(response.getStatus()).thenReturn(NOT_FOUND.getStatusCode());
-        boolean finalResponse = testSubject.Delete("", "", PATH);
-
-        // then
-        verify(builder).delete();
-        Assert.assertFalse(finalResponse);
-    }
-
-    @Test
-    public void testFailedRestDelete() {
-        // given
-        String methodName = "Delete";
-
-        // when
-        when(builder.delete()).thenThrow(new RuntimeException());
-        boolean finalResponse = testSubject.Delete("", "", PATH);
-
-        // then
-        verify(builder).delete();
-        Assert.assertFalse(finalResponse);
-    }
-
-    @Test
-    public void testRestJsonGetWithResponse200() {
-        // given
-        String methodName = "RestGet";
-
-        // when
-        when(response.getStatusInfo()).thenReturn(OK);
-        Response finalResponse = testSubject.RestGet("", "", Unchecked.toURI(PATH), false).getResponse();
-
-        // then
-        Assert.assertEquals(response, finalResponse);
-    }
-
-    @Test
-    public void testRestJsonGetWithResponse400() {
-        // given
-        String methodName = "RestGet";
-
-        // when
-        when(response.getStatusInfo()).thenReturn(BAD_REQUEST);
-        when(response.getStatus()).thenReturn(BAD_REQUEST.getStatusCode());
-        Response finalResponse = testSubject.RestGet("", "", Unchecked.toURI(PATH), false).getResponse();
-
-        // then
-        Assert.assertEquals(response, finalResponse);
-    }
-
-    @Test
-    public void testFailedRestGet() {
-        // given
-        String methodName = "RestGet";
-
-        // when
-        when(builder.build(HttpMethod.GET.name())).thenThrow(new RuntimeException());
-        Response finalResponse = testSubject.RestGet("", "", Unchecked.toURI(PATH), false).getResponse();
-
-        // then
-        Assert.assertEquals(finalResponse, null);
-    }
-
-    private void mockSystemProperties() throws UnsupportedEncodingException, InvalidPropertyException {
-        when(systemPropertyHelper.getEncodedCredentials()).thenReturn("someCredentials");
-        when(systemPropertyHelper.getFullServicePath(Mockito.anyString())).thenReturn("http://localhost/path");
-        when(systemPropertyHelper.getFullServicePath(Mockito.any(URI.class))).thenReturn("http://localhost/path");
-        when(systemPropertyHelper.getServiceBasePath(Mockito.anyString())).thenReturn("http://localhost/path");
-    }
-
-}
diff --git a/vid-app-common/src/test/java/org/onap/vid/bl/AaiServiceTest.java b/vid-app-common/src/test/java/org/onap/vid/bl/AaiServiceTest.java
index 9f1dc84..1b50681 100644
--- a/vid-app-common/src/test/java/org/onap/vid/bl/AaiServiceTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/bl/AaiServiceTest.java
@@ -20,15 +20,29 @@
 
 package org.onap.vid.bl;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.arrayWithSize;
+import static org.hamcrest.Matchers.equalTo;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.onap.vid.aai.AaiClientInterface;
 import org.onap.vid.aai.AaiResponse;
-import org.onap.vid.aai.model.*;
+import org.onap.vid.aai.model.AaiGetPnfResponse;
 import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
 import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.aai.model.LogicalLinkResponse;
+import org.onap.vid.aai.model.Relationship;
+import org.onap.vid.aai.model.RelationshipData;
+import org.onap.vid.aai.model.RelationshipList;
+import org.onap.vid.aai.model.ServiceRelationships;
 import org.onap.vid.roles.Role;
 import org.onap.vid.roles.RoleValidator;
 import org.onap.vid.services.AaiServiceImpl;
@@ -36,16 +50,6 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.arrayWithSize;
-import static org.hamcrest.Matchers.equalTo;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
 public class AaiServiceTest {
 
     @InjectMocks
@@ -164,7 +168,7 @@
         AaiResponse<GetTenantsResponse[]> aaiResponse = new AaiResponse<>(getTenantsResponses, null, 200);
         Mockito.doReturn(aaiResponse).when(aaiClientInterface).getTenants(serviceGlobalCustomerId, serviceServiceType);
         Role role = new Role(null, userGlobalCustomerId, userServiceType, userTenantName);
-        RoleValidator roleValidator = new RoleValidator(Collections.singletonList(role));
+        RoleValidator roleValidator = RoleValidator.by(Collections.singletonList(role));
         AaiResponse<GetTenantsResponse[]> actualTenants = aaiService.getTenants(serviceGlobalCustomerId, serviceServiceType, roleValidator);
 
         assertThat(actualTenants.getT(), arrayWithSize(1));
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/AaiControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/AaiControllerTest.java
index 6d4508d..0abf6cd 100644
--- a/vid-app-common/src/test/java/org/onap/vid/controller/AaiControllerTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/AaiControllerTest.java
@@ -3,13 +3,14 @@
  * VID
  * ================================================================================
  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nokia.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,33 +21,41 @@
 
 package org.onap.vid.controller;
 
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.onap.vid.aai.AaiResponseTranslator;
-import org.onap.vid.services.AaiService;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.Map;
-
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.vid.aai.AaiResponseTranslator;
+import org.onap.vid.aai.util.AAIRestInterface;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.services.AaiService;
+import org.onap.vid.utils.SystemPropertiesWrapper;
+
+@RunWith(MockitoJUnitRunner.class)
 public class AaiControllerTest {
 
-    @InjectMocks
-    AaiController aaiController = new AaiController();
-
     @Mock
-    AaiService aaiService;
+    private AaiService aaiService;
+    @Mock
+    private AAIRestInterface aaiRestInterface;
+    @Mock
+    private RoleProvider roleProvider;
+    @Mock
+    private SystemPropertiesWrapper systemPropertiesWrapper;
 
-    @BeforeMethod
-    public void initMocks(){
-        MockitoAnnotations.initMocks(this);
+    private AaiController aaiController;
+
+    @Before
+    public void setUp(){
+        aaiController = new AaiController(aaiService, aaiRestInterface, roleProvider, systemPropertiesWrapper);
     }
 
     @Test
@@ -70,7 +79,4 @@
                 "c", toBeReturnedForC
         )));
     }
-
-
-
 }
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/ControllersUtilsTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/ControllersUtilsTest.java
index f084b3d..80836d1 100644
--- a/vid-app-common/src/test/java/org/onap/vid/controller/ControllersUtilsTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/ControllersUtilsTest.java
@@ -21,16 +21,25 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.mock;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang.exception.ExceptionUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.portalsdk.core.domain.User;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.vid.model.ExceptionResponse;
 import org.onap.vid.utils.SystemPropertiesWrapper;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 
 @RunWith(MockitoJUnitRunner.class)
 public class ControllersUtilsTest {
@@ -110,4 +119,26 @@
         // THEN
         assertThat(loginId).isEmpty();
     }
+
+    @Test
+    public void shouldCreateResponseEntity_fromGivenException() {
+        // GIVEN
+        EELFLoggerDelegate eelfLoggerDelegate = mock(EELFLoggerDelegate.class);
+        Response response = mock(Response.class);
+        given(response.getStatus()).willReturn(HttpStatus.OK.value());
+        WebApplicationException webApplicationException = new WebApplicationException("ErrorMessage", response);
+
+        // WHEN
+        ResponseEntity responseEntity = ControllersUtils
+            .handleWebApplicationException(webApplicationException, eelfLoggerDelegate);
+
+        // THEN
+        assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
+        assertThat(responseEntity.getBody())
+            .isInstanceOfSatisfying(ExceptionResponse.class,
+                er -> assertThat(er.getMessage()).isEqualTo("ErrorMessage (Request id: null)"));
+        then(eelfLoggerDelegate).should()
+            .error(EELFLoggerDelegate.errorLogger, "{}: {}", "handleWebApplicationException",
+                ExceptionUtils.getMessage(webApplicationException), webApplicationException);
+    }
 }
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/ServicePermissionsTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/ServicePermissionsTest.java
index abdf315..36af92c 100644
--- a/vid-app-common/src/test/java/org/onap/vid/controller/ServicePermissionsTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/ServicePermissionsTest.java
@@ -20,14 +20,6 @@
 
 package org.onap.vid.controller;
 
-import org.jetbrains.annotations.NotNull;
-import org.onap.vid.aai.model.Permissions;
-import org.onap.vid.roles.RoleProvider;
-import org.onap.vid.roles.RoleValidator;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
 import static java.lang.Boolean.FALSE;
 import static java.lang.Boolean.TRUE;
 import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
@@ -37,6 +29,14 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import org.jetbrains.annotations.NotNull;
+import org.onap.vid.aai.model.Permissions;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.roles.RoleValidator;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
 public class ServicePermissionsTest {
 
     @DataProvider
diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/AlwaysValidRoleValidatorTest.java b/vid-app-common/src/test/java/org/onap/vid/roles/AlwaysValidRoleValidatorTest.java
new file mode 100644
index 0000000..363c6ff
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/roles/AlwaysValidRoleValidatorTest.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.roles;
+
+import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Test;
+
+public class AlwaysValidRoleValidatorTest {
+
+    @Test
+    public void testIsSubscriberPermitted() {
+        assertTrue(new AlwaysValidRoleValidator().isSubscriberPermitted("any"));
+    }
+
+    @Test
+    public void testIsServicePermitted() {
+        assertTrue(new AlwaysValidRoleValidator().isServicePermitted("any", "any"));
+    }
+
+    @Test
+    public void testIsTenantPermitted() {
+        assertTrue(new AlwaysValidRoleValidator().isTenantPermitted("any", "any", "any"));
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java b/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorByRolesTest.java
similarity index 96%
rename from vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java
rename to vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorByRolesTest.java
index 69ec345..9362ec9 100644
--- a/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorByRolesTest.java
@@ -21,18 +21,17 @@
 package org.onap.vid.roles;
 
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
+import java.util.List;
+import java.util.Map;
 import org.onap.vid.mso.rest.RequestDetails;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class RoleValidatorTest {
+public class RoleValidatorByRolesTest {
 
     private static final String SAMPLE_SUBSCRIBER = "sampleSubscriber";
     private static final String NOT_MATCHING_SUBSCRIBER = "notMatchingSubscriber";
@@ -47,12 +46,11 @@
     private Map<String, Object> requestParameters = ImmutableMap.of("subscriptionServiceType", SAMPLE_SERVICE_TYPE);
     private Map<String, Object> requestDetailsProperties = ImmutableMap.of("subscriberInfo", subscriberInfo, "requestParameters", requestParameters);
     private RequestDetails requestDetails;
-    private RoleValidator roleValidator;
+    private RoleValidatorByRoles roleValidator;
 
     @BeforeMethod
     public void setUp() {
-        roleValidator = new RoleValidator(roles);
-        roleValidator.enableRoles();
+        roleValidator = new RoleValidatorByRoles(roles);
         requestDetails = new RequestDetails();
     }
 
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
index 59cee89..e9f94ca 100644
--- 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
@@ -44,6 +44,7 @@
 import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
 import org.onap.vid.aai.model.VnfResult;
 import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.roles.RoleValidatorByRoles;
 
 public class AaiServiceImplTest {
 
@@ -137,7 +138,7 @@
         when(response.getT()).thenReturn(new GetTenantsResponse[]{ permittedTenant, unpermittedTenant });
         when(aaiClient.getTenants(globalCustomerId, serviceType)).thenReturn(response);
 
-        RoleValidator roleValidator = mock(RoleValidator.class);
+        RoleValidator roleValidator = mock(RoleValidatorByRoles.class);
         when(roleValidator.isTenantPermitted(globalCustomerId, serviceType, "permitted_tenant")).thenReturn(true);
         when(roleValidator.isTenantPermitted(globalCustomerId, serviceType, "unpermitted_tenant")).thenReturn(false);
 
@@ -202,7 +203,7 @@
     @SuppressWarnings("unchecked")
     public void getServicesShouldMarkAllServicesAsPermitted() {
         // given
-        RoleValidator roleValidator = modelGenerator.nextObject(RoleValidator.class);
+        RoleValidator roleValidator = modelGenerator.nextObject(RoleValidatorByRoles.class);
 
         GetServicesAAIRespone inputPayload = modelGenerator.nextObject(GetServicesAAIRespone.class);
         assertThat(inputPayload.service.stream().allMatch(service -> service.isPermitted)).isFalse();
diff --git a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
index fce0d1a..a0f0dbe 100644
--- a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
+++ b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
@@ -71,6 +71,8 @@
 element_map_file_path = app/fusionapp/files/
 element_map_icon_path = app/fusionapp/icons/
 
+role_management_activated = false
+
 #aai related properties
 #dev server
 #ist servers
diff --git a/vid-ext-services-simulator/src/main/resources/preset_registration/changeManagement/mso_get_manual_task.json b/vid-ext-services-simulator/src/main/resources/preset_registration/changeManagement/mso_get_manual_task.json
index 7fab6c6..9c4481e 100644
--- a/vid-ext-services-simulator/src/main/resources/preset_registration/changeManagement/mso_get_manual_task.json
+++ b/vid-ext-services-simulator/src/main/resources/preset_registration/changeManagement/mso_get_manual_task.json
@@ -21,7 +21,7 @@
           "errorCode": "404",
           "errorMessage": "Failed in A&AI 404",
           "description": "Manually restart VM id vm8776da8-4c8cbe860422, then verify logs still contain task id daf4dd84-b77a-42da-a051-3239b7a9392c",
-          "timeout": "PT3000S",
+          "timeout": "P3DT1H1M",
           "validResponses": [
             "rollback",
             "abort",
