import org.onap.vid.aai.util.AAIRestInterface;
 import org.onap.vid.model.VersionByInvariantIdsRequest;
 import org.onap.vid.properties.Features;
-import org.onap.vid.roles.Role;
 import org.onap.vid.roles.RoleProvider;
 import org.onap.vid.roles.RoleValidator;
 import org.onap.vid.services.AaiService;
 
     @RequestMapping(value = "/aai_get_services", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity<String> doGetServices(HttpServletRequest request) throws IOException {
-        RoleValidator roleValidator = RoleValidator.by(roleProvider.getUserRoles(request));
+        RoleValidator roleValidator = roleProvider.getUserRolesValidator(request);
 
         AaiResponse subscriberList = aaiService.getServices(roleValidator);
         return aaiResponseToResponseEntity(subscriberList);
     @RequestMapping(value = "/aai_get_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity<String> getFullSubscriberList(HttpServletRequest request) throws IOException {
         ResponseEntity<String> responseEntity;
-        RoleValidator roleValidator = RoleValidator.by(roleProvider.getUserRoles(request));
+        RoleValidator roleValidator = roleProvider.getUserRolesValidator(request);
         SubscriberFilteredResults subscriberList = aaiService.getFullSubscriberList(roleValidator);
         if (subscriberList.getHttpCode() == 200) {
             responseEntity = new ResponseEntity<>(objectMapper.writeValueAsString(subscriberList.getSubscriberList()),
     @RequestMapping(value = "/aai_sub_details/{subscriberId}", method = RequestMethod.GET)
     public ResponseEntity<String> getSubscriberDetails(HttpServletRequest request, @PathVariable("subscriberId") String subscriberId,
                                                        @RequestParam(value="omitServiceInstances", required = false, defaultValue = "false") boolean omitServiceInstances) throws IOException {
-        List<Role> roles = roleProvider.getUserRoles(request);
-        RoleValidator roleValidator = RoleValidator.by(roles);
+        RoleValidator roleValidator = roleProvider.getUserRolesValidator(request);
         AaiResponse subscriberData = aaiService.getSubscriberData(subscriberId, roleValidator,
             featureManager.isActive(Features.FLAG_1906_AAI_SUB_DETAILS_REDUCE_DEPTH) && omitServiceInstances);
         String httpMessage = subscriberData.getT() != null ? objectMapper.writeValueAsString(subscriberData.getT()) : subscriberData.getErrorMessage();
         @RequestParam(value = "owningEntity", required = false) List<String> owningEntities) throws IOException {
         ResponseEntity responseEntity;
 
-        List<Role> roles = roleProvider.getUserRoles(request);
-        RoleValidator roleValidator = RoleValidator.by(roles);
+        RoleValidator roleValidator = roleProvider.getUserRolesValidator(request);
 
         AaiResponse<ServiceInstancesSearchResults> searchResult = aaiService
             .getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator, owningEntities, projects);
 
         ResponseEntity responseEntity;
         try {
-            List<Role> roles = roleProvider.getUserRoles(request);
-            RoleValidator roleValidator = RoleValidator.by(roles);
+            RoleValidator roleValidator = roleProvider.getUserRolesValidator(request);
             AaiResponse<GetTenantsResponse[]> response = aaiService
                 .getTenants(globalCustomerId, serviceType, roleValidator);
             if (response.getHttpCode() == 200) {
 
 
     private Function<HttpServletRequest, Integer> getUserIdFunction;
     private Function<HttpServletRequest, Map> getRolesFunction;
+    private final RoleValidatorFactory roleValidatorFactory;
 
     @Autowired
-    public RoleProvider(AaiService aaiService) {
+    public RoleProvider(AaiService aaiService, RoleValidatorFactory roleValidatorFactory) {
         this.aaiService=aaiService;
+        this.roleValidatorFactory = roleValidatorFactory;
         getUserIdFunction = UserUtils::getUserId;
         getRolesFunction = UserUtils::getRoles;
     }
 
-    RoleProvider(AaiService aaiService, Function<HttpServletRequest, Integer> getUserIdFunction, Function<HttpServletRequest, Map> getRolesFunction) {
+    RoleProvider(AaiService aaiService, RoleValidatorFactory roleValidatorFactory,
+        Function<HttpServletRequest, Integer> getUserIdFunction, Function<HttpServletRequest, Map> getRolesFunction) {
         this.aaiService = aaiService;
+        this.roleValidatorFactory = roleValidatorFactory;
         this.getRolesFunction = getRolesFunction;
         this.getUserIdFunction = getUserIdFunction;
     }
     }
 
     public RoleValidator getUserRolesValidator(HttpServletRequest request) {
-        return RoleValidator.by(getUserRoles(request));
+        return roleValidatorFactory.by(getUserRoles(request));
     }
 }
 
 
 
 public interface RoleValidator {
 
-    static RoleValidator by(List<Role> roles) {
-        final boolean disableRoles = StringUtils.equals(SystemProperties.getProperty("role_management_activated"), "false");
-        return by(roles, disableRoles);
-    }
-
-    static RoleValidator by(List<Role> roles, boolean disableRoles) {
-        return disableRoles
-            ? new AlwaysValidRoleValidator()
-            : new RoleValidatorBySubscriberAndServiceType(roles);
-    }
 
     boolean isSubscriberPermitted(String subscriberId);
 
 
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * 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.
+ * 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 org.apache.commons.lang3.StringUtils;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.togglz.core.manager.FeatureManager;
+
+@Component
+public class RoleValidatorFactory {
+    private final FeatureManager featureManager;
+
+    @Autowired
+    public RoleValidatorFactory(FeatureManager featureManager) {
+        this.featureManager = featureManager;
+    }
+
+
+    public RoleValidator by(List<Role> roles) {
+        final boolean disableRoles = StringUtils
+            .equals(SystemProperties.getProperty("role_management_activated"), "false");
+        return by(roles, disableRoles);
+    }
+
+    public RoleValidator by(List<Role> roles, boolean disableRoles) {
+        return disableRoles
+            ? new AlwaysValidRoleValidator()
+            : new RoleValidatorBySubscriberAndServiceType(roles);
+    }
+}
 
 import org.onap.vid.roles.EcompRole;
 import org.onap.vid.roles.Role;
 import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.roles.RoleValidatorFactory;
 
 import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
 
 public class SubscriberFilteredResultsTest {
 
     }
 
     private void prepareRoleValidator() {
-        ArrayList<Role> list = new ArrayList<>();
-        list.add(new Role(EcompRole.READ, "a", "a", "a"));
-       roleValidator = RoleValidator.by(list);
+        roleValidator = mock(RoleValidator.class);
     }
 
     private void prepareSubscriberList() throws IOException {
 
+++ /dev/null
-/*-
- * ============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.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.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;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-public class AaiServiceTest {
-
-    @InjectMocks
-    private AaiServiceImpl aaiService;
-
-    @Mock
-    private AaiClientInterface aaiClientInterface;
-
-
-
-    @BeforeMethod
-    public void initMocks(){
-        MockitoAnnotations.initMocks(this);
-    }
-
-    @Test
-    public void testGetSpecificPnf(){
-        Pnf pnf = Pnf.builder().withPnfId("11111").build();
-        AaiResponse<Pnf> aaiResponse = new AaiResponse<>(pnf, "aaaa", 200);
-        Mockito.doReturn(aaiResponse).when(aaiClientInterface).getSpecificPnf(Mockito.anyString());
-        AaiResponse<Pnf> specificPnf = aaiService.getSpecificPnf("1345667");
-        assertNotNull(specificPnf);
-        pnf = specificPnf.getT();
-        assertNotNull(pnf);
-        assertEquals("11111",pnf.getPnfId());
-        assertEquals("aaaa",specificPnf.getErrorMessage());
-        assertEquals(200,specificPnf.getHttpCode());
-    }
-
-    @Test
-    public void testPnfByRegion(){
-        AaiGetPnfResponse aaiGetPnfResponse = new AaiGetPnfResponse();
-        AaiResponse<AaiGetPnfResponse> aaiResponse = new AaiResponse<>(aaiGetPnfResponse, "", 200);
-        Mockito.doReturn(aaiResponse).when(aaiClientInterface).getPNFData(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
-        AaiResponse<AaiGetPnfResponse> aaiGetPnfResponseWrapper = aaiService.getPNFData("1345667", "1345667", "1345667", "1345667", "1345667", "1345667", "1345667");
-        assertNotNull(aaiGetPnfResponseWrapper);
-        aaiGetPnfResponse = aaiGetPnfResponseWrapper.getT();
-        assertNotNull(aaiGetPnfResponse);
-    }
-
-    @Test
-    public void testGetAssociatedPnfs(){
-        ServiceRelationships serviceRelationships = createServiceRelationships();
-        AaiResponse<ServiceRelationships> aaiResponse = new AaiResponse<>(serviceRelationships, null, 200);
-        Mockito.doReturn(aaiResponse).when(aaiClientInterface).getServiceInstance(Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
-
-        LogicalLinkResponse logicalLinkResponse = createLogicalLinkResponse();
-        AaiResponse<LogicalLinkResponse> aaiResponse1 = new AaiResponse<>(logicalLinkResponse, null, 200);
-        Mockito.doReturn(aaiResponse1).when(aaiClientInterface).getLogicalLink("SANITY6758cce9%3ALAG1992%7CSANITY6785cce9%3ALAG1961");
-
-        List<String> pnfList = aaiService.getServiceInstanceAssociatedPnfs("123", "456", "789");
-        assertNotNull(pnfList);
-        assertEquals(1, pnfList.size());
-        assertEquals("SANITY6785cce9", pnfList.get(0));
-    }
-
-    private ServiceRelationships createServiceRelationships() {
-        ServiceRelationships serviceRelationships = new ServiceRelationships();
-        serviceRelationships.setServiceInstanceName("test service");
-
-        RelationshipData logicalLinksRelationshipData = new RelationshipData();
-        logicalLinksRelationshipData.setRelationshipKey("logical-link.link-name");
-        logicalLinksRelationshipData.setRelationshipValue("SANITY6758cce9:LAG1992|SANITY6785cce9:LAG1961");
-
-        Relationship logicalLinksRelationship = new Relationship();
-        logicalLinksRelationship.setRelatedTo("logical-link");
-        logicalLinksRelationship.setRelationDataList(Arrays.asList(logicalLinksRelationshipData));
-
-        RelationshipList logicalLinksRelationshipsList = new RelationshipList();
-        logicalLinksRelationshipsList.setRelationship(Arrays.asList(logicalLinksRelationship));
-
-        serviceRelationships.setRelationshipList(logicalLinksRelationshipsList);
-        return serviceRelationships;
-    }
-
-    private LogicalLinkResponse createLogicalLinkResponse() {
-        LogicalLinkResponse logicalLinkResponse = new LogicalLinkResponse();
-        logicalLinkResponse.setLinkName("SANITY6758cce9:LAG1992|SANITY6785cce9:LAG1961");
-
-        RelationshipData lagInterfaceRelationshipData = new RelationshipData();
-        lagInterfaceRelationshipData.setRelationshipKey("pnf.pnf-name");
-        lagInterfaceRelationshipData.setRelationshipValue("SANITY6785cce9");
-
-        Relationship lagInterfaceRelationship = new Relationship();
-        lagInterfaceRelationship.setRelatedTo("lag-interface");
-        lagInterfaceRelationship.setRelationDataList(Arrays.asList(lagInterfaceRelationshipData));
-
-        RelationshipList lagInterfaceRelationshipsList = new RelationshipList();
-        lagInterfaceRelationshipsList.setRelationship(Arrays.asList(lagInterfaceRelationship));
-
-        logicalLinkResponse.setRelationshipList(lagInterfaceRelationshipsList);
-
-        return logicalLinkResponse;
-    }
-
-    @DataProvider
-    public static Object[][] getTenantsData() {
-        return new Object[][] {
-                {"customer1", "serviceType1", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", true},
-                {"customer1", "serviceType1", "TeNant1", "customer1", "serviceType1", "tenant1", "id-1", true},
-                {"customer1", "serviceType1", "TENANT1", "customer1", "serviceType1", "tenant1", "id-1", true},
-                {"customer1", "serviceType1", "tenant2", "customer1", "serviceType1", "tenant1", "tenant2", false},
-                {"customer1", "serviceType1", null, "customer1", "serviceType1", "tenant1", "tenant2", true},
-                {"customer2", "serviceType1", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", false},
-                {"customer1", "serviceType2", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", false},
-                {"customer2", "serviceType1", null, "customer1", "serviceType1", "tenant1", "id-1", false},
-                {"customer1", "serviceType2", null, "customer1", "serviceType1", "tenant1", "id-1", false},
-        };
-    }
-
-    @Test(dataProvider = "getTenantsData")
-    public void testGetTenants(String userGlobalCustomerId, String userServiceType, String userTenantName, String serviceGlobalCustomerId,
-                               String serviceServiceType, String serviceTenantName, String serviceTenantId, boolean expectedIsPermitted) {
-        GetTenantsResponse[] getTenantsResponses = new GetTenantsResponse[] {new GetTenantsResponse(null, null, serviceTenantName, serviceTenantId, expectedIsPermitted)};
-        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 = RoleValidator.by(Collections.singletonList(role));
-        AaiResponse<GetTenantsResponse[]> actualTenants = aaiService.getTenants(serviceGlobalCustomerId, serviceServiceType, roleValidator);
-
-        assertThat(actualTenants.getT(), arrayWithSize(1));
-        assertThat(actualTenants.getT()[0].tenantName, equalTo(serviceTenantName));
-        //assertThat(actualTenants.getT()[0].isPermitted, equalTo(expectedIsPermitted));
-    }
-}
 
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.BDDMockito.given;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
 import org.onap.vid.aai.util.AAIRestInterface;
 import org.onap.vid.model.VersionByInvariantIdsRequest;
 import org.onap.vid.properties.Features;
+import org.onap.vid.roles.AlwaysValidRoleValidator;
 import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.roles.RoleValidator;
 import org.onap.vid.roles.RoleValidatorBySubscriberAndServiceType;
+import org.onap.vid.roles.RoleValidatorFactory;
 import org.onap.vid.services.AaiService;
 import org.onap.vid.utils.SystemPropertiesWrapper;
 import org.onap.vid.utils.Unchecked;
     @Mock
     private RoleProvider roleProvider;
     @Mock
+    private RoleValidator roleValidator;
+    @Mock
     private SystemPropertiesWrapper systemPropertiesWrapper;
     @Mock
     private FeatureManager featureManager;
     public void setUp() {
         aaiController = new AaiController(aaiService, aaiRestInterface, roleProvider, systemPropertiesWrapper,
             featureManager);
+        when(roleProvider.getUserRolesValidator(any())).thenReturn(roleValidator);
         mockMvc = MockMvcBuilders.standaloneSetup(aaiController).build();
     }
 
         String okResponseBody = "OK_RESPONSE";
         AaiResponse<String> aaiResponse = new AaiResponse<>(okResponseBody, "", HttpStatus.OK.value());
         given(featureManager.isActive(Features.FLAG_1906_AAI_SUB_DETAILS_REDUCE_DEPTH)).willReturn(isFeatureActive);
-        given(aaiService.getSubscriberData(eq(subscriberId), isA(RoleValidatorBySubscriberAndServiceType.class),
+        given(aaiService.getSubscriberData(eq(subscriberId), isA(RoleValidator.class),
             eq(isFeatureActive && omitServiceInstances)))
             .willReturn(aaiResponse);
 
         String okResponseBody = "OK_RESPONSE";
         AaiResponse<String> aaiResponse = new AaiResponse<>(okResponseBody, "", HttpStatus.OK.value());
         given(featureManager.isActive(Features.FLAG_1906_AAI_SUB_DETAILS_REDUCE_DEPTH)).willReturn(isFeatureActive);
-        given(aaiService.getSubscriberData(eq(subscriberId), isA(RoleValidatorBySubscriberAndServiceType.class),
+        given(aaiService.getSubscriberData(eq(subscriberId), isA(RoleValidator.class),
             eq(isFeatureActive && omitServiceInstances)))
             .willReturn(aaiResponse);
 
 
 
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.hamcrest.CoreMatchers.is;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 import static org.mockito.MockitoAnnotations.initMocks;
 
 import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 import org.assertj.core.util.Lists;
+import org.hamcrest.CoreMatchers;
 import org.mockito.Mock;
 import org.onap.vid.aai.AaiResponse;
 import org.onap.vid.aai.exceptions.RoleParsingException;
     @Mock
     private AaiResponse<SubscriberList> subscriberListResponse;
 
+    @Mock
+    private RoleValidatorFactory roleValidatorFactory;
+
     private RoleProvider roleProvider;
 
 
     @BeforeMethod
     public void setUp() {
         initMocks(this);
-        roleProvider = new RoleProvider(aaiService, httpServletRequest -> 5, httpServletRequest -> createRoles());
+        roleProvider = new RoleProvider(aaiService, roleValidatorFactory, httpServletRequest -> 5, httpServletRequest -> createRoles());
     }
 
     @Test
         assertThat(roleProvider.userPermissionIsReadLogs(Lists.list(withoutPermission, withPermission))).isTrue();
     }
 
+    @Test
+    public void getUserRolesValidator_shouldReturnValidatorFromFactory() {
+        RoleValidator expectedRoleValidator = new AlwaysValidRoleValidator();
+        when(roleValidatorFactory.by(any())).thenReturn(expectedRoleValidator);
+
+        RoleValidator result = roleProvider.getUserRolesValidator(request);
+
+        assertThat(result).isEqualTo(expectedRoleValidator);
+    }
+
     private void setSubscribers() {
         Subscriber subscriber = new Subscriber();
         subscriber.subscriberName = SAMPLE_SUBSCRIBER;
 
             .isTenantPermitted(SAMPLE_SUBSCRIBER, SAMPLE_SERVICE_TYPE, SAMPLE_TENANT)).isTrue();
     }
 
+    @Test
+    public void shouldPermitTenantWhenNameMatchesCaseInsensitive() {
+        assertThat(roleValidatorBySubscriberAndServiceType
+            .isTenantPermitted(SAMPLE_SUBSCRIBER, SAMPLE_SERVICE_TYPE, SAMPLE_TENANT.toUpperCase())).isTrue();
+    }
+
 
     @Test
     public void shouldNotPermitTenantWhenNameNotMatches() {
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.arrayWithSize;
 import static org.hamcrest.Matchers.equalTo;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.withSettings;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
 
 import org.onap.vid.model.aaiTree.AAITreeNode;
 import org.onap.vid.roles.Role;
 import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.roles.RoleValidatorFactory;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
     @Mock
     private AaiClientInterface aaiClientInterface;
 
+    @Mock
+    private RoleValidatorFactory roleValidatorFactory;
+
     @BeforeMethod
     public void initMocks(){
         MockitoAnnotations.initMocks(this);
 
     @Test
     public void testGetSpecificPnf(){
-        Pnf pnf = new Pnf("11111", null, null, null, null, null, null);
+        Pnf pnf = Pnf.builder().withPnfId("11111").build();
         AaiResponse<Pnf> aaiResponse = new AaiResponse<>(pnf, "aaaa", 200);
         Mockito.doReturn(aaiResponse).when(aaiClientInterface).getSpecificPnf(Mockito.anyString());
         AaiResponse<Pnf> specificPnf = aaiService.getSpecificPnf("1345667");
     public static Object[][] getTenantsData() {
         return new Object[][] {
                 {"customer1", "serviceType1", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", true},
-                {"customer1", "serviceType1", "TeNant1", "customer1", "serviceType1", "tenant1", "id-1", true},
-                {"customer1", "serviceType1", "TENANT1", "customer1", "serviceType1", "tenant1", "id-1", true},
                 {"customer1", "serviceType1", "tenant2", "customer1", "serviceType1", "tenant1", "tenant2", false},
                 {"customer1", "serviceType1", null, "customer1", "serviceType1", "tenant1", "tenant2", true},
                 {"customer2", "serviceType1", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", false},
     }
 
     @Test(dataProvider = "getTenantsData")
-    public void testGetTenants(String userGlobalCustomerId, String userServiceType, String userTenantName, String serviceGlobalCustomerId,
-                               String serviceServiceType, String serviceTenantName, String serviceTenantId, boolean expectedIsPermitted) {
+    public void testGetTenants(String userGlobalCustomerId, String userServiceType, String userTenantName,
+                                String serviceGlobalCustomerId, String serviceServiceType, String serviceTenantName,
+                                String serviceTenantId, boolean expectedIsPermitted) {
         GetTenantsResponse[] getTenantsResponses = new GetTenantsResponse[] {new GetTenantsResponse(null, null, serviceTenantName, serviceTenantId, false)};
         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 = RoleValidator.by(Collections.singletonList(role), false);
-        AaiResponse<GetTenantsResponse[]> actualTenants = aaiService.getTenants(serviceGlobalCustomerId, serviceServiceType, roleValidator);
+
+        RoleValidator roleValidatorMock = mock(RoleValidator.class);
+        when(roleValidatorMock.isTenantPermitted(
+            eq(userGlobalCustomerId), eq(userServiceType),
+            (userTenantName == null) ? anyString() : eq(userTenantName))
+        ).thenReturn(true);
+
+        AaiResponse<GetTenantsResponse[]> actualTenants = aaiService.getTenants(serviceGlobalCustomerId, serviceServiceType, roleValidatorMock);
 
         assertThat(actualTenants.getT(), arrayWithSize(1));
         assertThat(actualTenants.getT()[0].tenantName, equalTo(serviceTenantName));