Package org.jtalks.common.model.entity

Examples of org.jtalks.common.model.entity.Group


        assertReflectionEquals(actual.get(1), group1);
    }

    @Test
    public void testGetByNameContains() {
        Group group = ObjectsFactory.getRandomGroup();

        saveAndEvict(group);

        List<Group> actual = groupDao.getMatchedByName(group.getName());
        assertEquals(actual.size(), 1);
        assertReflectionEquals(actual.get(0), group);
    }
View Full Code Here


        assertReflectionEquals(actual.get(0), group);
    }

    @Test
    public void testGetByNameContainsWithEmptyName() {
        Group group = ObjectsFactory.getRandomGroup();
        saveAndEvict(group);

        group = ObjectsFactory.getRandomGroup();
        saveAndEvict(group);
View Full Code Here

        assertEquals(actual, all);
    }

    @Test
    public void testGetByName() {
        Group group = ObjectsFactory.getRandomGroup();

        saveAndEvict(group);

        Group actual = groupDao.getGroupByName(group.getName());
        assertReflectionEquals(actual, group);
    }
View Full Code Here

        assertReflectionEquals(actual, group);
    }

    @Test
    public void testGetByNameFailWithEmptyString() {
        Group group = ObjectsFactory.getRandomGroup();

        saveAndEvict(group);

        Group actual = groupDao.getGroupByName(NO_FILTER);
        assertNull(actual);
    }
View Full Code Here

        assertNull(actual);
    }

    @Test
    public void testGetByNameLowerCase() {
        Group group = ObjectsFactory.getRandomGroup();

        saveAndEvict(group);

        Group actual = groupDao.getGroupByName(group.getName().toLowerCase());
        assertReflectionEquals(actual, group);
    }
View Full Code Here

        assertReflectionEquals(actual, group);
    }

    @Test
    public void testGetByNameUpperCase() {
        Group group = ObjectsFactory.getRandomGroup();

        saveAndEvict(group);

        Group actual = groupDao.getGroupByName(group.getName().toUpperCase());
        assertReflectionEquals(actual, group);
    }
View Full Code Here

        assertReflectionEquals(actual, group);
    }

    @Test
    public void testGetByNameWithSpecialChars() {
        Group group = ObjectsFactory.getRandomGroup();
        group.setName("!@#$%^&*()\"\'\\/");
        saveAndEvict(group);

        Group actual = groupDao.getGroupByName(group.getName());
        assertReflectionEquals(actual, group);
    }
View Full Code Here


    @Test
    public void getGetUsersCount() {
        int count = 5;
        Group group = PersistedObjectsFactory.groupWithUsers(count);
        int actual = groupDao.get(group.getId()).getUsers().size();
        assertEquals(actual, count);
    }
View Full Code Here

        assertEquals(actual, count);
    }

    @Test
    public void testDeleteGroup() {
        Group group = ObjectsFactory.getRandomGroup();
        saveAndEvict(group);

        groupDao.delete(group);
        Group actual = groupDao.get(group.getId());
        assertNull(actual);
    }
View Full Code Here

        return accessControlEntry;
    }

    private GroupAce createGroupAce(BranchPermission permission, boolean isGranted) {
        GroupAce groupAce = Mockito.mock(GroupAce.class);
        Group group = Mockito.mock(Group.class);
        List<User> users = new ArrayList<>();
        users.add(user);
        Mockito.when(group.getUsers()).thenReturn(users);
        Mockito.when(groupAce.getGroup(groupDao)).thenReturn(group);
        Mockito.when(groupAce.isGranting()).thenReturn(isGranted);
        Mockito.when(groupAce.getPermission()).thenReturn(permission);
        return groupAce;
    }
View Full Code Here

TOP

Related Classes of org.jtalks.common.model.entity.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.