@Test
public void test37createUserSearchQuery() {

	EntityManager entityManager = Mockito.mock(EntityManager.class);
	String queryString="Select id,loginId,emailAddress,firstName,lastName,statusList,publicScreenName,status from XXPortalUser";
	Query query = Mockito.mock(Query.class);
	SearchCriteria searchCriteria = new SearchCriteria();
	searchCriteria.setDistinct(true);
	searchCriteria.setGetChildren(true);
	searchCriteria.setGetCount(true);
	searchCriteria.setMaxRows(12);
	searchCriteria.setOwnerId(userId);
	searchCriteria.setStartIndex(1);
	searchCriteria.setSortBy("asc");
	VXPortalUser vXPortalUser=userProfile();
	List<String> userRoleList = new ArrayList<String>();
	userRoleList.add("ROLE_USER");
	List<Integer> statusList = new ArrayList<Integer>();
	statusList.add(1);
	searchCriteria.addParam("roleList", userRoleList);
	searchCriteria.addParam("userId", vXPortalUser.getId());
	searchCriteria.addParam("loginId", vXPortalUser.getLoginId());
	searchCriteria.addParam("emailAddress", vXPortalUser.getEmailAddress());
	searchCriteria.addParam("firstName", vXPortalUser.getFirstName());
	searchCriteria.addParam("lastName", vXPortalUser.getLastName());
	searchCriteria.addParam("statusList", statusList);
	searchCriteria.addParam("publicScreenName", vXPortalUser.getPublicScreenName());
	searchCriteria.addParam("status", vXPortalUser.getStatus());
	searchCriteria.addParam("familyScreenName", vXPortalUser.getPublicScreenName());
	Mockito.when(daoManager.getEntityManager()).thenReturn(entityManager);
	Mockito.when(entityManager.createQuery(Mockito.anyString())).thenReturn(query);
	Query newQuery = userMgr.createUserSearchQuery(query.toString(),queryString,searchCriteria);
	Assert.assertNotNull(newQuery);
	userRoleList.add("ROLE_SYS_ADMIN");
	statusList.add(0);
	searchCriteria.addParam("statusList", statusList);
	searchCriteria.addParam("roleList", userRoleList);
	newQuery = userMgr.createUserSearchQuery(query.toString(),queryString,searchCriteria);
}