Search in sources :

Example 56 with JsonEntityBean

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

the class JsonEntityBeanTest method testGetTypeAndIdHashEntityEnumNull.

@Test(expected = java.lang.AssertionError.class)
public void testGetTypeAndIdHashEntityEnumNull() {
    EntityEnum ee = null;
    JsonEntityBean jeb = buildBeanFromEntityGroup();
    jeb.setEntityType(ee);
    jeb.getTypeAndIdHash();
}
Also used : EntityEnum(org.apereo.portal.portlets.groupselector.EntityEnum) JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 57 with JsonEntityBean

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

the class JsonEntityBeanTest method testConstructFromGroupMemberWithGroup.

@Test(expected = IllegalArgumentException.class)
public void testConstructFromGroupMemberWithGroup() {
    String key = "test-key";
    Mockito.when(groupMember.getKey()).thenReturn(key);
    JsonEntityBean jeb = new JsonEntityBean(groupMember, EntityEnum.GROUP);
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 58 with JsonEntityBean

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

the class JsonEntityBeanTest method testConstructFromGroupMemberWithCategory.

@Test(expected = IllegalArgumentException.class)
public void testConstructFromGroupMemberWithCategory() {
    String key = "test-key";
    Mockito.when(groupMember.getKey()).thenReturn(key);
    JsonEntityBean jeb = new JsonEntityBean(groupMember, EntityEnum.CATEGORY);
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 59 with JsonEntityBean

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

the class JsonEntityBeanTest method testEquals.

@Test
public void testEquals() {
    JsonEntityBean jeb1 = buildBeanFromEntityGroup();
    JsonEntityBean jeb2 = buildBeanFromEntityGroup();
    assertTrue(jeb1.equals(jeb2));
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 60 with JsonEntityBean

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

the class JsonEntityBeanTest method testToString.

@Test
public void testToString() {
    JsonEntityBean jeb1 = buildBeanFromEntityGroup();
    assertEquals("JsonEntityBean [entityType=portlet, id=test-key, name=test-name, creatorId=test-creator-id, description=test-description, principalString=null]", jeb1.toString());
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

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