@Test
public void test63getServices() throws Exception{

	HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
	PList<RangerService> paginatedSvcs = new PList<RangerService>();
	RangerService svc1 = rangerService();
	
	String userLoginID = "testuser";
	Long userId = 8L;
	
	RangerSecurityContext context = new RangerSecurityContext();
	context.setUserSession(new UserSessionBase());
	RangerContextHolder.setSecurityContext(context);
	UserSessionBase currentUserSession = ContextUtil.getCurrentUserSession();
	currentUserSession.setUserAdmin(false);
	XXPortalUser xXPortalUser = new XXPortalUser();
	xXPortalUser.setLoginId(userLoginID);
	xXPortalUser.setId(userId);
	currentUserSession.setXXPortalUser(xXPortalUser);
	
	VXUser loggedInUser = new VXUser();
	List<String> loggedInUserRole = new ArrayList<String>();
	loggedInUserRole.add(RangerConstants.ROLE_USER);
	loggedInUser.setId(8L);
	loggedInUser.setName("testuser");
	loggedInUser.setUserRoleList(loggedInUserRole);
	
	Map<String, String> configs = new HashMap<String, String>();
	configs.put("username", "servicemgr");
	configs.put("password", "servicemgr");
	configs.put("namenode", "servicemgr");
	configs.put("hadoop.security.authorization", "No");
	configs.put("hadoop.security.authentication", "Simple");
	configs.put("hadoop.security.auth_to_local", "");
	configs.put("dfs.datanode.kerberos.principal", "");
	configs.put("dfs.namenode.kerberos.principal", "");
	configs.put("dfs.secondary.namenode.kerberos.principal", "");
	configs.put("hadoop.rpc.protection", "Privacy");
	configs.put("commonNameForCertificate", "");
	RangerService svc2 = new RangerService();
	svc2.setId(9L);
	svc2.setConfigs(configs);
	svc2.setCreateTime(new Date());
	svc2.setDescription("service policy");
	svc2.setGuid("1427365526516_835_1");
	svc2.setIsEnabled(true);
	svc2.setName("YARN_1");
	svc2.setPolicyUpdateTime(new Date());
	svc2.setType("yarn");
	svc2.setUpdatedBy("Admin");
	svc2.setUpdateTime(new Date());
	
	List<RangerService> rangerServiceList = new ArrayList<RangerService>();
	rangerServiceList.add(svc1);
	rangerServiceList.add(svc2);
	
	paginatedSvcs.setList(rangerServiceList);
	
	SearchFilter filter = new SearchFilter();
	Mockito.when(searchUtil.getSearchFilter(request, svcService.sortFields)).thenReturn(filter);
	Mockito.when(svcStore.getPaginatedServices(filter)).thenReturn(paginatedSvcs);
	Mockito.when(xUserService.getXUserByUserName("testuser")).thenReturn(loggedInUser);
	RangerServiceList retServiceList = serviceREST.getServices(request);
	Assert.assertNotNull(retServiceList);
	Assert.assertNull(retServiceList.getServices().get(0).getDescription());
	Assert.assertTrue(retServiceList.getServices().get(0).getConfigs().isEmpty());
	Assert.assertNull(retServiceList.getServices().get(1).getDescription());
	Assert.assertTrue(retServiceList.getServices().get(1).getConfigs().isEmpty());
	Assert.assertEquals(retServiceList.getServices().get(0).getId(), Id);
	Assert.assertEquals(retServiceList.getServices().get(0).getName(), "HDFS_1");
	Assert.assertEquals(retServiceList.getServices().get(0).getType(), "1");
	
	Assert.assertEquals(retServiceList.getServices().get(1).getId(), svc2.getId());
	Assert.assertEquals(retServiceList.getServices().get(1).getName(), "YARN_1");
	Assert.assertEquals(retServiceList.getServices().get(1).getType(), "yarn");
	
	
}