use of org.apache.ranger.view.VXStringList in project ranger by apache.
the class TestXUserREST method test106deleteGroupsByGroupName.
// //////////////////////////////
@Test
public void test106deleteGroupsByGroupName() {
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
String TestforceDeleteStr = "true";
boolean forceDelete = false;
Mockito.when(request.getParameter("forceDelete")).thenReturn(TestforceDeleteStr);
VXString testVXString = new VXString();
testVXString.setValue("testVXGroup");
VXGroup testVXGroup = createVXGroup();
VXStringList vxStringList = createVXStringListGroup();
Mockito.when(xGroupService.getGroupByGroupName(testVXString.getValue())).thenReturn(testVXGroup);
forceDelete = true;
Mockito.doNothing().when(xUserMgr).deleteXGroup(testVXGroup.getId(), forceDelete);
xUserRest.deleteGroupsByGroupName(request, vxStringList);
Mockito.verify(xUserMgr).deleteXGroup(testVXGroup.getId(), forceDelete);
Mockito.verify(xGroupService).getGroupByGroupName(testVXString.getValue());
Mockito.verify(request).getParameter("forceDelete");
}
use of org.apache.ranger.view.VXStringList in project ranger by apache.
the class TestXUserREST method test95setUserRolesByExternalID.
@Test
public void test95setUserRolesByExternalID() {
VXStringList testVXStringList = createVXStringList();
Mockito.when(xUserMgr.setUserRolesByExternalID(id, testVXStringList.getVXStrings())).thenReturn(testVXStringList);
VXStringList retVXStringList = xUserRest.setUserRolesByExternalID(id, testVXStringList);
Mockito.verify(xUserMgr).setUserRolesByExternalID(id, testVXStringList.getVXStrings());
assertNotNull(retVXStringList);
assertEquals(testVXStringList.getTotalCount(), retVXStringList.getTotalCount());
assertEquals(testVXStringList.getClass(), retVXStringList.getClass());
}
use of org.apache.ranger.view.VXStringList in project ranger by apache.
the class TestXUserREST method test109deleteGroupsByGroupNameSetValueNull.
@Test
public void test109deleteGroupsByGroupNameSetValueNull() {
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
String TestforceDeleteStr = "false";
boolean forceDelete = true;
Mockito.when(request.getParameter("forceDelete")).thenReturn(TestforceDeleteStr);
VXString testVXString = new VXString();
testVXString.setValue("testVXGroup");
VXGroup testVXGroup = createVXGroup();
VXStringList vxStringList = createVXStringListGroup();
Mockito.when(xGroupService.getGroupByGroupName(testVXString.getValue())).thenReturn(testVXGroup);
forceDelete = false;
Mockito.doNothing().when(xUserMgr).deleteXGroup(testVXGroup.getId(), forceDelete);
xUserRest.deleteGroupsByGroupName(request, vxStringList);
Mockito.verify(xUserMgr).deleteXGroup(testVXGroup.getId(), forceDelete);
Mockito.verify(xGroupService).getGroupByGroupName(testVXString.getValue());
Mockito.verify(request).getParameter("forceDelete");
}
use of org.apache.ranger.view.VXStringList in project ranger by apache.
the class TestXUserREST method test98getUserRolesByName.
@Test
public void test98getUserRolesByName() {
VXStringList testVXStringList = createVXStringList();
Mockito.when(xUserMgr.getUserRolesByName("Admin")).thenReturn(testVXStringList);
VXStringList retVXStringList = xUserRest.getUserRolesByName("Admin");
Mockito.verify(xUserMgr).getUserRolesByName("Admin");
assertNotNull(retVXStringList);
assertEquals(testVXStringList.getTotalCount(), retVXStringList.getTotalCount());
assertEquals(testVXStringList.getClass(), retVXStringList.getClass());
}
Aggregations