Package org.apache.rave.portal.model.impl

Examples of org.apache.rave.portal.model.impl.GroupImpl


        owner = new PersonImpl();
        owner.setDisplayName(ownerDisplayName);
        owner.setGivenName(ownerGivenName);
        members.add(ownerId);

        group = new GroupImpl();
        group.setDescription(description);
        group.setTitle(title);
        group.setOwnerId(ownerId);
        group.setMemberIds(members);
    }
View Full Code Here


    }

    @Test(expected = IllegalArgumentException.class)
    public void notFound() {
        new JpaConverter(converters);
        JpaConverter.getInstance().convert(new GroupImpl(), Group.class);
    }
View Full Code Here

    }

    @Test
    public void getByTitle() {
        String title = "title";
        Group group = new GroupImpl();
        group.setId("1");
        group.setTitle(title);
        expect(groupTemplate.findOne(Query.query(Criteria.where("title").is(title)))).andReturn(group);
        replay(groupTemplate);

        Group fromRepo = repo.findByTitle(title);
        assertThat(fromRepo.getTitle(), is(equalTo(title)));
View Full Code Here

    @Test
    public void get() {
        String title = "title";
        String id = "1";
        Group group = new GroupImpl();
        group.setId(id);
        group.setTitle(title);
        expect(groupTemplate.get(id)).andReturn(group);
        replay(groupTemplate);

        Group fromRepo = repo.get(id);
        assertThat(fromRepo.getId(), is(equalTo(id)));
View Full Code Here

        assertThat(fromRepo.getTitle(), is(equalTo(title)));
    }

    @Test
    public void getAll() {
        List<Group> groups = Arrays.<Group>asList(new GroupImpl(), new GroupImpl());

        expect(groupTemplate.find(new Query())).andReturn(groups);
        replay(groupTemplate);

        List<Group> result = repo.getAll();
View Full Code Here

    }

    @Test
    public void save(){
        String title = "TITLE";
        Group group = new GroupImpl();
        group.setId("1");
        group.setTitle(title);
        expect(groupTemplate.save(group)).andReturn(group);
        replay(groupTemplate);
        Group returned = repo.save(group);
        verify(groupTemplate);
        assertThat(returned, is(sameInstance(group)));
View Full Code Here


    @Test
    public void delete(){
        String id ="id";
        Group group = new GroupImpl();
        group.setId(id);
        group.setTitle("title");
        groupTemplate.remove(Query.query(Criteria.where("_id").is(id)));
        expectLastCall();
        replay(groupTemplate);

        repo.delete(group);
View Full Code Here

        verify(repository);
    }


    private static Group createGroup(String title) {
        GroupImpl group = new GroupImpl();
        group.setTitle(title);
        return group;
    }
View Full Code Here

    }


    @Test
    public void convert_valid(){
        Group group = new GroupImpl();
        group.setId(USER1ID);
        group.setTitle("asdf");
        group.setDescription("Description");
        group.setMemberIds(Arrays.asList(new String[] {"1", "2", "3"}));
        group.setOwnerId(USER2ID);

        MongoDbGroup mongoGroup = converter.convert(group);
        assertThat(mongoGroup.getId(), is(equalTo(USER1ID)));
        assertThat(mongoGroup.getTitle(), is(equalTo("asdf")));
        assertThat(mongoGroup.getDescription(), is("Description"));
View Full Code Here

    }//end convert_valid

    @Test
    public void convert_Null(){
        Group source = new GroupImpl();

        MongoDbGroup converted = converter.convert(source);

        assertNull(converted.getTitle());
        assertNull(converted.getDescription());
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.impl.GroupImpl

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.