@Test
public void test40setUserRolesByName() {

	destroySession();
	setup();
	XXPortalUserRoleDao xPortalUserRoleDao = Mockito.mock(XXPortalUserRoleDao.class);
	VXPortalUser userProfile = userProfile();
	List<VXString> vStringRolesList = new ArrayList<VXString>();
	VXString vXStringObj = new VXString();
	vXStringObj.setValue("ROLE_USER");
	vStringRolesList.add(vXStringObj);
	List<XXPortalUserRole> xPortalUserRoleList = new ArrayList<XXPortalUserRole>();
	XXPortalUserRole XXPortalUserRole = new XXPortalUserRole();
	XXPortalUserRole.setId(userId);
	XXPortalUserRole.setUserId(userId);
	XXPortalUserRole.setUserRole("ROLE_USER");
	xPortalUserRoleList.add(XXPortalUserRole);
	List<XXUserPermission> xUserPermissionsList = new ArrayList<XXUserPermission>();
	XXUserPermission xUserPermissionObj = xxUserPermission();
	xUserPermissionsList.add(xUserPermissionObj);
	List<XXGroupPermission> xGroupPermissionList = new ArrayList<XXGroupPermission>();
	XXGroupPermission xGroupPermissionObj = xxGroupPermission();
	xGroupPermissionList.add(xGroupPermissionObj);
	List<VXGroupPermission> groupPermList = new ArrayList<VXGroupPermission>();
	VXGroupPermission groupPermission = vxGroupPermission();
	groupPermList.add(groupPermission);
	Mockito.when(daoManager.getXXPortalUserRole()).thenReturn(xPortalUserRoleDao);
	Mockito.when(xPortalUserRoleDao.findByUserId(userId)).thenReturn(xPortalUserRoleList);
	Mockito.when(userMgr.getUserProfileByLoginId(userProfile.getLoginId())).thenReturn(userProfile);
	VXStringList vXStringList = xUserMgr.setUserRolesByName(userProfile.getLoginId(), vStringRolesList);
	Assert.assertNotNull(vXStringList);
	Mockito.when(restErrorUtil.createRESTException("Login ID doesn't exist.",MessageEnums.INVALID_INPUT_DATA)).thenThrow(new WebApplicationException());
	thrown.expect(WebApplicationException.class);
	xUserMgr.setUserRolesByName(null, vStringRolesList);
}