Search in sources :

Example 1 with IGroupManager

use of com.agiletec.aps.system.services.group.IGroupManager in project entando-core by entando.

the class TestAuthorityManager method testGetUsersByAuthority_2.

public void testGetUsersByAuthority_2() throws Throwable {
    // name equal to an existing role
    Group groupForTest = this.createGroupForTest("pageManager");
    try {
        ((IGroupManager) this._groupManager).addGroup(groupForTest);
        Group group = this.getGroup(groupForTest.getName());
        assertNotNull(group);
        List<String> usersByGroup = this._authorizationManager.getUsersByAuthority(group, false);
        assertNotNull(usersByGroup);
        assertTrue(usersByGroup.isEmpty());
        usersByGroup = this._authorizationManager.getUsersByGroup(group, false);
        assertNotNull(usersByGroup);
        assertTrue(usersByGroup.isEmpty());
        List<String> usersByRole = this._authorizationManager.getUsersByRole(group, false);
        assertNull(usersByRole);
    } catch (Throwable t) {
        throw t;
    } finally {
        ((IGroupManager) this._groupManager).removeGroup(groupForTest);
        Group group = this.getGroup(groupForTest.getName());
        assertNull(group);
    }
}
Also used : Group(com.agiletec.aps.system.services.group.Group) IGroupManager(com.agiletec.aps.system.services.group.IGroupManager)

Aggregations

Group (com.agiletec.aps.system.services.group.Group)1 IGroupManager (com.agiletec.aps.system.services.group.IGroupManager)1