use of org.apache.ranger.view.VXGroupList in project ranger by apache.
the class TestXUserMgr method test22GetXUserGroups.
@Test
public void test22GetXUserGroups() {
VXGroupList dbVXGroupList = xUserMgr.getXUserGroups(userId);
Assert.assertNotNull(dbVXGroupList);
}
use of org.apache.ranger.view.VXGroupList in project ranger by apache.
the class TestXUserREST method test71getXUserGroups.
@Test
public void test71getXUserGroups() {
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
VXGroupList groupList = createxGroupList();
Mockito.when(xUserMgr.getXUserGroups(id)).thenReturn(groupList);
VXGroupList retVxGroupList = xUserRest.getXUserGroups(request, id);
assertNotNull(retVxGroupList);
assertEquals(groupList.getClass(), retVxGroupList.getClass());
assertEquals(groupList.getResultSize(), retVxGroupList.getResultSize());
Mockito.verify(xUserMgr).getXUserGroups(id);
}
use of org.apache.ranger.view.VXGroupList in project ranger by apache.
the class TestXUserREST method createxGroupList.
private VXGroupList createxGroupList() {
VXGroupList testVXGroupList = new VXGroupList();
VXGroup VXGroup1 = createVXGroup();
List<VXGroup> vXGroups = new ArrayList<VXGroup>();
vXGroups.add(VXGroup1);
testVXGroupList.setVXGroups(vXGroups);
testVXGroupList.setStartIndex(0);
testVXGroupList.setTotalCount(1);
return testVXGroupList;
}
use of org.apache.ranger.view.VXGroupList in project ranger by apache.
the class TestServiceDBStore method test41getMetricByTypeusergroup.
@Test
public void test41getMetricByTypeusergroup() throws Exception {
VXGroupList vxGroupList = new VXGroupList();
vxGroupList.setTotalCount(4l);
vxGroupList.setPageSize(1);
String type = "usergroup";
VXUserList vXUserList = new VXUserList();
vXUserList.setTotalCount(4l);
Mockito.when(xUserMgr.searchXGroups(Mockito.any(SearchCriteria.class))).thenReturn(vxGroupList);
Mockito.when(xUserMgr.searchXUsers(Mockito.any(SearchCriteria.class))).thenReturn(vXUserList);
serviceDBStore.getMetricByType(ServiceDBStore.METRIC_TYPE.getMetricTypeByName(type));
}
use of org.apache.ranger.view.VXGroupList in project ranger by apache.
the class XGroupServiceBase method searchXGroups.
/**
* @param searchCriteria
* @return
*/
public VXGroupList searchXGroups(SearchCriteria searchCriteria) {
VXGroupList returnList = new VXGroupList();
List<VXGroup> xGroupList = new ArrayList<VXGroup>();
List<T> resultList = searchResources(searchCriteria, searchFields, sortFields, returnList);
// Iterate over the result list and create the return list
for (T gjXGroup : resultList) {
VXGroup vXGroup = populateViewBean(gjXGroup);
xGroupList.add(vXGroup);
}
returnList.setVXGroups(xGroupList);
return returnList;
}
Aggregations