Search in sources :

Example 31 with JsonEntityBean

use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.

the class PermissionAdministrationHelperTest 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;
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean)

Example 32 with JsonEntityBean

use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.

the class PermissionAdministrationHelperTest method testGetPrincipalsForEntities.

@Test(expected = NullPointerException.class)
public void testGetPrincipalsForEntities() {
    JsonEntityBean bean = buildJsonGroupEntityBean();
    List<JsonEntityBean> beans = new ArrayList<JsonEntityBean>();
    beans.add(bean);
    Set<JsonEntityBean> returnBeans = permissionAdministrationHelper.getEntitiesForPrincipals(null);
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 33 with JsonEntityBean

use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.

the class EntitiesRESTControllerTest method testFindEntityNull.

@Test
public void testFindEntityNull() {
    Mockito.when(groupListHelper.getEntity(null, null, true)).thenReturn(null);
    JsonEntityBean entityBean = entitiesRESTController.findEntity(req, res, null, null);
    Assert.assertNull(entityBean);
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 34 with JsonEntityBean

use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.

the class EntitiesRESTControllerTest method testFindEntityEmpty.

@Test
public void testFindEntityEmpty() {
    Mockito.when(groupListHelper.getEntity("", "", true)).thenReturn(null);
    JsonEntityBean entityBean = entitiesRESTController.findEntity(req, res, "", "");
    Assert.assertNull(entityBean);
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 35 with JsonEntityBean

use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.

the class PrincipalsRESTControllerTest 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;
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean)

Aggregations

JsonEntityBean (org.apereo.portal.layout.dlm.remoting.JsonEntityBean)86 Test (org.junit.Test)53 EntityEnum (org.apereo.portal.portlets.groupselector.EntityEnum)13 ModelAndView (org.springframework.web.servlet.ModelAndView)10 IEntityGroup (org.apereo.portal.groups.IEntityGroup)9 IGroupMember (org.apereo.portal.groups.IGroupMember)9 IAuthorizationPrincipal (org.apereo.portal.security.IAuthorizationPrincipal)9 ArrayList (java.util.ArrayList)7 HashSet (java.util.HashSet)7 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)7 IPermission (org.apereo.portal.security.IPermission)4 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)4 List (java.util.List)3 IPermissionTarget (org.apereo.portal.permission.target.IPermissionTarget)3 PortletCategory (org.apereo.portal.portlet.om.PortletCategory)3 IPerson (org.apereo.portal.security.IPerson)3 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 GroupListHelperImpl (org.apereo.portal.layout.dlm.remoting.GroupListHelperImpl)2 IPermissionActivity (org.apereo.portal.permission.IPermissionActivity)2