+ @Test
+ public void isAccountAdminUserNull() {
+ boolean actual = adminRolesServiceImpl.isAccountAdmin(null);
+ assertFalse(actual);
+ }
+
+ @Test
+ public void isRoleAdminTest() {
+ EPUser user = mockUser.mockEPUser();
+ List<String> roles = new ArrayList<>();
+ roles.add("approver\\|");
+ Mockito.when(dataAccessService.executeNamedQuery(
+ Matchers.eq("getRoleFunctionsOfUserforAlltheApplications"), Matchers.any(), Matchers.any()))
+ .thenReturn(roles);
+ Mockito.when(externalAccessRolesService.getFunctionCodeType(Matchers.anyString())).thenReturn("approver");
+ boolean actual = adminRolesServiceImpl.isRoleAdmin(user);
+ assertTrue(actual);
+ }
+