use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class PermissionsRESTControllerTest method testGetgetAssignmentsForPrincipalNullPrincipal.
@Test(expected = NullPointerException.class)
public void testGetgetAssignmentsForPrincipalNullPrincipal() throws Exception {
String principal = "principal";
boolean includeInherited = true;
JsonEntityBean entity = buildJsonPersonEntityBean();
Mockito.when(groupListHelper.getEntityForPrincipal(principal)).thenReturn(entity);
Mockito.when(this.authorizationService.newPrincipal(entity.getId(), entity.getEntityType().getClazz())).thenReturn(null);
ModelAndView modelAndView = permissionsRESTController.getAssignmentsForPrincipal(principal, includeInherited, req, res);
Collection<IPermissionTarget> targets = (Collection<IPermissionTarget>) modelAndView.getModel().get("assignments");
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class AssignmentTest method setup.
@Before
public void setup() {
String principal = "principal";
JsonEntityBean principalBean = buildJsonGroupEntityBean();
assignment = new Assignment(principal, principalBean);
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class AssignmentTest method testFindDecendentOrSelfIfExists.
@Test
public void testFindDecendentOrSelfIfExists() {
JsonEntityBean bean = buildJsonGroupEntityBean();
Assignment newAssignment = this.assignment.findDecendentOrSelfIfExists(bean);
Assert.assertNotNull(newAssignment);
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class EntitiesRESTControllerTest 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 EntitiesRESTControllerTest method testFindEntity.
@Test
public void testFindEntity() {
Mockito.when(groupListHelper.getEntity(ENTITY_TYPE, ENTITY_ID_101, true)).thenReturn(new JsonEntityBean());
JsonEntityBean entityBean = entitiesRESTController.findEntity(req, res, ENTITY_TYPE, ENTITY_ID_101);
Assert.assertNotNull(entityBean);
}
Aggregations