@Test
public void testCheckUserAccessibleThrowErrorForAdminAndUserRoleKeyAdmin()
                throws Exception {

        Collection<String> roleList = new ArrayList<String>();
        roleList.add(RangerConstants.ROLE_KEY_ADMIN);
        Mockito.when(userMgr.getRolesByLoginId(vXUser.getName())).thenReturn(
                        roleList);
        Mockito.when(vXUser.getUserRoleList()).thenReturn(roleList);
        currentUserSession.setUserAdmin(true);
        RangerSecurityContext context = new RangerSecurityContext();
        context.setUserSession(currentUserSession);
        RangerContextHolder.setSecurityContext(context);
        Mockito.when(currentUserSession.isUserAdmin()).thenReturn(true);
        WebApplicationException webExp = new WebApplicationException();
        Mockito.when(
                        restErrorUtil.createRESTException(
                                        "Logged in user is not allowed to create/update user",
                                        MessageEnums.OPER_NO_PERMISSION)).thenReturn(webExp);
        thrown.expect(WebApplicationException.class);
        rangerBizUtil.checkUserAccessible(vXUser);
        Mockito.verify(restErrorUtil).createRESTException(
                        "Logged in user is not allowed to create/update user",
                        MessageEnums.OPER_NO_PERMISSION);
}