Search in sources :

Example 61 with JsonEntityBean

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

the class JsonEntityBeanTest method testCompareTo.

@Test
public void testCompareTo() {
    JsonEntityBean jeb1 = buildBeanFromEntityGroup();
    JsonEntityBean jeb2 = buildBeanFromEntityGroup();
    assertEquals(0, jeb1.compareTo(jeb2));
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 62 with JsonEntityBean

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

the class JsonEntityBeanTest method testEqualsNameNullTarget.

@Test
public void testEqualsNameNullTarget() {
    JsonEntityBean jeb1 = buildNullBean();
    jeb1.setChildrenInitialized(true);
    jeb1.setCreatorId("");
    jeb1.setDescription("");
    jeb1.setEntityType(EntityEnum.PORTLET);
    jeb1.setId("");
    jeb1.setName("");
    JsonEntityBean jeb2 = buildNullBean();
    jeb2.setChildrenInitialized(true);
    jeb2.setCreatorId("");
    jeb2.setDescription("");
    jeb2.setEntityType(EntityEnum.PORTLET);
    jeb2.setId("");
    jeb2.setName(null);
    assertFalse(jeb1.equals(jeb2));
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 63 with JsonEntityBean

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

the class JsonEntityBeanTest method testEqualsNameDiff.

@Test
public void testEqualsNameDiff() {
    String val1 = "asdf";
    String val2 = "brtd";
    JsonEntityBean jeb1 = buildNullBean();
    jeb1.setChildrenInitialized(true);
    jeb1.setCreatorId("");
    jeb1.setDescription("");
    jeb1.setEntityType(EntityEnum.PORTLET);
    jeb1.setId("");
    jeb1.setName(val1);
    JsonEntityBean jeb2 = buildNullBean();
    jeb2.setChildrenInitialized(true);
    jeb2.setCreatorId("");
    jeb2.setDescription("");
    jeb2.setEntityType(EntityEnum.PORTLET);
    jeb2.setId("");
    jeb2.setName(val2);
    assertEquals(val1.equals(val2), jeb1.equals(jeb2));
}
Also used : JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) Test(org.junit.Test)

Example 64 with JsonEntityBean

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

the class JsonEntityBeanTest method buildNullBean.

private JsonEntityBean buildNullBean() {
    JsonEntityBean jeb = new JsonEntityBean(groupMember, EntityEnum.PORTLET);
    EntityEnum ee = null;
    jeb.setEntityType(ee);
    jeb.setChildrenInitialized(false);
    jeb.setCreatorId(null);
    jeb.setDescription(null);
    jeb.setId(null);
    jeb.setName(null);
    return jeb;
}
Also used : EntityEnum(org.apereo.portal.portlets.groupselector.EntityEnum) JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean)

Example 65 with JsonEntityBean

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

the class JsonEntityBeanTest method testEqualsIdNullSource.

@Test
public void testEqualsIdNullSource() {
    JsonEntityBean jeb1 = buildNullBean();
    jeb1.setChildrenInitialized(true);
    jeb1.setCreatorId("");
    jeb1.setDescription("");
    jeb1.setEntityType(EntityEnum.PORTLET);
    jeb1.setId(null);
    JsonEntityBean jeb2 = buildNullBean();
    jeb2.setChildrenInitialized(true);
    jeb2.setCreatorId("");
    jeb2.setDescription("");
    jeb2.setEntityType(EntityEnum.PORTLET);
    jeb2.setId("");
    assertFalse(jeb1.equals(jeb2));
}
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