use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testEqualsIdNullTarget.
@Test
public void testEqualsIdNullTarget() {
JsonEntityBean jeb1 = buildNullBean();
jeb1.setChildrenInitialized(true);
jeb1.setCreatorId("");
jeb1.setDescription("");
jeb1.setEntityType(EntityEnum.PORTLET);
jeb1.setId("");
JsonEntityBean jeb2 = buildNullBean();
jeb2.setChildrenInitialized(true);
jeb2.setCreatorId("");
jeb2.setDescription("");
jeb2.setEntityType(EntityEnum.PORTLET);
jeb2.setId(null);
assertFalse(jeb1.equals(jeb2));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testGetTypeAndIdHashKeyNull.
@Test(expected = java.lang.AssertionError.class)
public void testGetTypeAndIdHashKeyNull() {
String key = null;
String name = "test-name";
String cId = "test-creator-id";
String desc = "test-description";
Mockito.when(entityGroup.getKey()).thenReturn(key);
Mockito.when(entityGroup.getName()).thenReturn(name);
Mockito.when(entityGroup.getCreatorID()).thenReturn(cId);
Mockito.when(entityGroup.getDescription()).thenReturn(desc);
JsonEntityBean jeb = new JsonEntityBean(entityGroup, EntityEnum.PORTLET);
jeb.getTypeAndIdHash();
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testEqualsSelf.
@Test
public void testEqualsSelf() {
JsonEntityBean jeb1 = buildNullBean();
assertTrue(jeb1.equals(jeb1));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testEqualsEntityTypeNullSource.
@Test
public void testEqualsEntityTypeNullSource() {
EntityEnum ee = null;
JsonEntityBean jeb1 = buildNullBean();
jeb1.setChildrenInitialized(true);
jeb1.setCreatorId("");
jeb1.setDescription("");
jeb1.setEntityType(ee);
JsonEntityBean jeb2 = buildNullBean();
jeb2.setChildrenInitialized(true);
jeb2.setCreatorId("");
jeb2.setDescription("");
jeb2.setEntityType(EntityEnum.PORTLET);
assertFalse(jeb1.equals(jeb2));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testHashCodeNull.
@Test
public void testHashCodeNull() {
Mockito.when(groupMember.getKey()).thenReturn("");
JsonEntityBean jeb1 = buildNullBean();
JsonEntityBean jeb2 = buildNullBean();
assertEquals(jeb1.hashCode(), jeb2.hashCode());
}
Aggregations