use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class PermissionsRESTControllerTest method testGetgetAssignmentsForTargetNull.
@Test
public void testGetgetAssignmentsForTargetNull() throws Exception {
String target = "target";
boolean includeInherited = false;
JsonEntityBean entity = buildJsonPersonEntityBean();
Mockito.when(permissionStore.select(null, null, null, target, null)).thenReturn(new IPermission[0]);
Mockito.when(groupListHelper.getEntityForPrincipal(target)).thenReturn(null);
Mockito.when(this.authorizationService.newPrincipal(entity.getId(), entity.getEntityType().getClazz())).thenReturn(null);
ModelAndView modelAndView = permissionsRESTController.getAssignmentsOnTarget(target, includeInherited, req, res);
Collection<IPermissionTarget> assignments = (Collection<IPermissionTarget>) modelAndView.getModel().get("assignments");
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class PermissionsRESTControllerTest method buildJsonPersonEntityBean.
private JsonEntityBean buildJsonPersonEntityBean() {
JsonEntityBean personBean = new JsonEntityBean();
personBean.setEntityType(EntityEnum.GROUP.toString());
personBean.setId("person101");
personBean.setName("test");
personBean.setDescription("Testing person bean");
return personBean;
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class PermissionAssignmentMapControllerTest method buildJsonEntityBean.
private JsonEntityBean buildJsonEntityBean() {
JsonEntityBean bean = new JsonEntityBean();
bean.setEntityType(ENTITY_TYPE);
bean.setId(ENTITY_ID_101);
bean.setName("test");
bean.setDescription("Testing bean");
return bean;
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class AssignmentTest method buildJsonGroupEntityBean.
private JsonEntityBean buildJsonGroupEntityBean() {
JsonEntityBean groupBean = new JsonEntityBean();
groupBean.setEntityType(EntityEnum.GROUP.toString());
groupBean.setId("group101");
groupBean.setName("test");
groupBean.setDescription("Testing group bean");
return groupBean;
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class AssignmentTest method testAddChild.
@Test
public void testAddChild() {
String principal = "principal1";
JsonEntityBean principalBean = buildJsonGroupEntityBean();
Assignment newAssignment = assignment.addChild(new Assignment(principal, principalBean));
Assert.assertEquals(1L, newAssignment.getChildren().size());
}
Aggregations