Search in sources :

Example 6 with GroupListHelperImpl

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

the class GroupListHelperImplTest method testGetPrincipalForEntityTypeIsNull.

@Test(expected = IllegalArgumentException.class)
public void testGetPrincipalForEntityTypeIsNull() {
    GroupListHelperImpl helper = new GroupListHelperImpl();
    Mockito.when(entityGroup.getKey()).thenReturn("test-key");
    Mockito.when(entityGroup.getName()).thenReturn("test-name");
    Mockito.when(entityGroup.getCreatorID()).thenReturn("test-cid");
    Mockito.when(entityGroup.getDescription()).thenReturn("test-desc");
    JsonEntityBean jeb = new JsonEntityBean(entityGroup, EntityEnum.PORTLET);
    EntityEnum ee = null;
    jeb.setEntityType(ee);
    helper.getPrincipalForEntity(jeb);
}
Also used : EntityEnum(org.apereo.portal.portlets.groupselector.EntityEnum) JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) GroupListHelperImpl(org.apereo.portal.layout.dlm.remoting.GroupListHelperImpl) Test(org.junit.Test)

Example 7 with GroupListHelperImpl

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

the class GroupListHelperImplTest method testLookupEntityNameNull.

@Test(expected = IllegalArgumentException.class)
public void testLookupEntityNameNull() {
    GroupListHelperImpl helper = new GroupListHelperImpl();
    helper.lookupEntityName(null);
}
Also used : GroupListHelperImpl(org.apereo.portal.layout.dlm.remoting.GroupListHelperImpl) Test(org.junit.Test)

Example 8 with GroupListHelperImpl

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

the class GroupListHelperImplTest method testLookupEntityNameTypeIsNull.

@Test(expected = IllegalArgumentException.class)
public void testLookupEntityNameTypeIsNull() {
    GroupListHelperImpl helper = new GroupListHelperImpl();
    Mockito.when(entityGroup.getKey()).thenReturn("test-key");
    Mockito.when(entityGroup.getName()).thenReturn("test-name");
    Mockito.when(entityGroup.getCreatorID()).thenReturn("test-cid");
    Mockito.when(entityGroup.getDescription()).thenReturn("test-desc");
    JsonEntityBean jeb = new JsonEntityBean(entityGroup, EntityEnum.PORTLET);
    EntityEnum ee = null;
    jeb.setEntityType(ee);
    helper.lookupEntityName(jeb);
}
Also used : EntityEnum(org.apereo.portal.portlets.groupselector.EntityEnum) JsonEntityBean(org.apereo.portal.layout.dlm.remoting.JsonEntityBean) GroupListHelperImpl(org.apereo.portal.layout.dlm.remoting.GroupListHelperImpl) Test(org.junit.Test)

Example 9 with GroupListHelperImpl

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

the class GroupListHelperImplTest method testGetEntityTypesForGroupTypeGroup.

@Test
public void testGetEntityTypesForGroupTypeGroup() {
    GroupListHelperImpl helper = new GroupListHelperImpl();
    Set<String> res = helper.getEntityTypesForGroupType(EntityEnum.GROUP.name());
    assertEquals(2, res.size());
    assertTrue(res.contains(EntityEnum.GROUP.name()));
    assertTrue(res.contains(EntityEnum.PERSON.toString()));
}
Also used : GroupListHelperImpl(org.apereo.portal.layout.dlm.remoting.GroupListHelperImpl) Test(org.junit.Test)

Example 10 with GroupListHelperImpl

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

the class GroupListHelperImplTest method testGetEntityNull.

@Test(expected = IllegalArgumentException.class)
public void testGetEntityNull() {
    GroupListHelperImpl helper = new GroupListHelperImpl();
    helper.getEntity(null, "asdf", true);
}
Also used : GroupListHelperImpl(org.apereo.portal.layout.dlm.remoting.GroupListHelperImpl) Test(org.junit.Test)

Aggregations

GroupListHelperImpl (org.apereo.portal.layout.dlm.remoting.GroupListHelperImpl)18 Test (org.junit.Test)18 EntityEnum (org.apereo.portal.portlets.groupselector.EntityEnum)4 JsonEntityBean (org.apereo.portal.layout.dlm.remoting.JsonEntityBean)2 ArrayList (java.util.ArrayList)1 IGroupMember (org.apereo.portal.groups.IGroupMember)1