use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testEqualsDescNullTarget.
@Test
public void testEqualsDescNullTarget() {
JsonEntityBean jeb1 = buildNullBean();
jeb1.setChildrenInitialized(true);
jeb1.setCreatorId("");
jeb1.setDescription("");
JsonEntityBean jeb2 = buildNullBean();
jeb2.setChildrenInitialized(true);
jeb2.setCreatorId("");
jeb2.setDescription(null);
assertFalse(jeb1.equals(jeb2));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testCompareToDiffName.
@Test
public void testCompareToDiffName() {
String val1 = "asdf";
String val2 = "hjkl";
JsonEntityBean jeb1 = buildBeanFromEntityGroup();
jeb1.setName(val1);
JsonEntityBean jeb2 = buildBeanFromEntityGroup();
jeb2.setName(val2);
assertEquals(val1.compareTo(val2), jeb1.compareTo(jeb2));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testConstructFromGroupMemberWithPerson.
@Test
public void testConstructFromGroupMemberWithPerson() {
String key = "test-key";
Mockito.when(groupMember.getKey()).thenReturn(key);
JsonEntityBean jeb = new JsonEntityBean(groupMember, EntityEnum.PERSON);
assertEquals(EntityEnum.PERSON, jeb.getEntityType());
assertEquals(key, jeb.getId());
assertEquals(key, jeb.getTargetString());
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testCompareToDiffId.
@Test
public void testCompareToDiffId() {
String val1 = "asdf";
String val2 = "hjkl";
JsonEntityBean jeb1 = buildBeanFromEntityGroup();
jeb1.setId(val1);
JsonEntityBean jeb2 = buildBeanFromEntityGroup();
jeb2.setId(val2);
assertEquals(val1.compareTo(val2), jeb1.compareTo(jeb2));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testConstructFromGroupMemberWithNullEntityEnum.
@Test(expected = IllegalArgumentException.class)
public void testConstructFromGroupMemberWithNullEntityEnum() {
String key = "test-key";
Mockito.when(groupMember.getKey()).thenReturn(key);
JsonEntityBean jeb = new JsonEntityBean(groupMember, null);
}
Aggregations