use of org.apache.ranger.view.VXGroup in project ranger by apache.
the class XGroupService method populateViewBean.
@Override
public VXGroup populateViewBean(XXGroup xGroup) {
VXGroup vObj = super.populateViewBean(xGroup);
vObj.setIsVisible(xGroup.getIsVisible());
return vObj;
}
use of org.apache.ranger.view.VXGroup 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;
}
use of org.apache.ranger.view.VXGroup in project ranger by apache.
the class XGroupService method readResourceWithOutLogin.
public VXGroup readResourceWithOutLogin(Long id) {
XXGroup resource = getDao().getById(id);
if (resource == null) {
// Returns code 400 with DATA_NOT_FOUND as the error message
throw restErrorUtil.createRESTException(getResourceName() + " not found", MessageEnums.DATA_NOT_FOUND, id, null, "preRead: " + id + " not found.");
}
VXGroup view = populateViewBean(resource);
if (view != null) {
view.setGroupSource(resource.getGroupSource());
}
return view;
}
use of org.apache.ranger.view.VXGroup in project ranger by apache.
the class TestXUserREST method test5updateXGroup.
@Test
public void test5updateXGroup() {
VXGroup compareTestVXGroup = createVXGroup();
Mockito.when(xUserMgr.updateXGroup(compareTestVXGroup)).thenReturn(compareTestVXGroup);
VXGroup retVxGroup = xUserRest.updateXGroup(compareTestVXGroup);
assertNotNull(retVxGroup);
assertEquals(compareTestVXGroup.getId(), retVxGroup.getId());
assertEquals(compareTestVXGroup.getName(), retVxGroup.getName());
Mockito.verify(xUserMgr).updateXGroup(compareTestVXGroup);
}
use of org.apache.ranger.view.VXGroup in project ranger by apache.
the class TestXUserREST method test70deleteXGroupAndXUser.
@Test
public void test70deleteXGroupAndXUser() {
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
VXGroup testVXGroup = createVXGroup();
VXUser testVXuser = createVXUser();
Mockito.doNothing().when(xUserMgr).deleteXGroupAndXUser(testVXGroup.getName(), testVXuser.getName());
xUserRest.deleteXGroupAndXUser(testVXGroup.getName(), testVXuser.getName(), request);
Mockito.verify(xUserMgr).deleteXGroupAndXUser(testVXGroup.getName(), testVXuser.getName());
}
Aggregations