use of org.apache.ranger.view.RangerServiceList in project ranger by apache.
the class TestServiceDBStore method test24getServices.
@Test
public void test24getServices() throws Exception {
SearchFilter filter = new SearchFilter();
filter.setParam(SearchFilter.POLICY_NAME, "policyName");
filter.setParam(SearchFilter.SERVICE_NAME, "serviceName");
List<RangerService> serviceList = new ArrayList<RangerService>();
RangerService rangerService = rangerService();
serviceList.add(rangerService);
RangerServiceList serviceListObj = new RangerServiceList();
serviceListObj.setPageSize(0);
serviceListObj.setResultSize(1);
serviceListObj.setSortBy("asc");
serviceListObj.setSortType("1");
serviceListObj.setStartIndex(0);
serviceListObj.setTotalCount(10);
serviceListObj.setServices(serviceList);
Mockito.when(svcService.searchRangerServices(filter)).thenReturn(serviceListObj);
List<RangerService> dbRangerService = serviceDBStore.getServices(filter);
Assert.assertNotNull(dbRangerService);
Assert.assertEquals(dbRangerService, serviceList);
Mockito.verify(svcService).searchRangerServices(filter);
}
Aggregations