@Test
public void test7getServiceDefs() throws Exception {

	HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
	SearchFilter filter = new SearchFilter();
	filter.setParam(SearchFilter.POLICY_NAME, "policyName");
	filter.setParam(SearchFilter.SERVICE_NAME, "serviceName");
	Mockito.when(
			searchUtil.getSearchFilter(request,
					serviceDefService.sortFields)).thenReturn(filter);
	List<RangerServiceDef> serviceDefsList = new ArrayList<RangerServiceDef>();
	RangerServiceDef serviceDef = rangerServiceDef();
	serviceDefsList.add(serviceDef);
	PList<RangerServiceDef> serviceDefList = new PList<RangerServiceDef>();
	serviceDefList.setPageSize(0);
	serviceDefList.setResultSize(1);
	serviceDefList.setSortBy("asc");
	serviceDefList.setSortType("1");
	serviceDefList.setStartIndex(0);
	serviceDefList.setTotalCount(10);
	serviceDefList.setList(serviceDefsList);
	Mockito.when(bizUtil.hasModuleAccess(RangerConstants.MODULE_RESOURCE_BASED_POLICIES)).thenReturn(true);
	Mockito.when(svcStore.getPaginatedServiceDefs(filter)).thenReturn(
			serviceDefList);
	RangerServiceDefList dbRangerServiceDef = serviceREST
			.getServiceDefs(request);
	Assert.assertNotNull(dbRangerServiceDef);
	Mockito.verify(searchUtil).getSearchFilter(request,
			serviceDefService.sortFields);
	Mockito.verify(svcStore).getPaginatedServiceDefs(filter);
}