Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.WidgetComment


        user.setUsername(VALID_USERNAME);
        user.setEntityId(VALID_USER_ID);
        user2 = new User();
        user2.setUsername(VALID_USERNAME2);
        user2.setEntityId(INVALID_USER_ID);
        widgetComment = new WidgetComment();
        widgetComment.setEntityId(VALID_COMMENT_ID);
        widgetComment.setUser(user);
        grantedAuthoritiesList = new ArrayList<GrantedAuthority>();
        grantedAuthoritiesList.add(new SimpleGrantedAuthority("ROLE_USER"));
    }
View Full Code Here


        EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthoritiesList).anyTimes();
        expect(mockAuthentication.getPrincipal()).andReturn(user).anyTimes();
        replay(mockAuthentication);

        WidgetComment localWidgetComment = new WidgetComment();
        User localUser = new User();
        localUser.setEntityId(VALID_USER_ID);
        localWidgetComment.setUser(localUser);
        expect(mockWidgetCommentRepository.get(VALID_COMMENT_ID)).andReturn(localWidgetComment).anyTimes();
        replay(mockWidgetCommentRepository);

        assertThat(defaultWidgetCommentPermissionEvaluator.hasPermission(mockAuthentication, localWidgetComment, Permission.CREATE), is(true));
View Full Code Here

        widgetCommentService = new DefaultWidgetCommentService(widgetCommentRepository);
    }

    @Test
    public void getWidgetComment() {
        WidgetComment comment = new WidgetComment();
        comment.setEntityId(1L);
        expect(widgetCommentRepository.get(1L)).andReturn(comment);
        replay(widgetCommentRepository);

        assertEquals(comment, widgetCommentService.getWidgetComment(1L));
        verify(widgetCommentRepository);
View Full Code Here

        verify(widgetCommentRepository);
    }

    @Test
    public void saveWidgetComment() {
        WidgetComment comment = new WidgetComment();
        comment.setEntityId(1L);
        expect(widgetCommentRepository.save(comment)).andReturn(comment);
        replay(widgetCommentRepository);

        widgetCommentService.saveWidgetComment(comment);
        verify(widgetCommentRepository);
View Full Code Here

        verify(widgetCommentRepository);
    }

    @Test
    public void deleteWidgetComment() {
        WidgetComment comment = new WidgetComment();
        comment.setEntityId(1L);
        expect(widgetCommentRepository.get(1L)).andReturn(comment);
        widgetCommentRepository.delete(comment);
        replay(widgetCommentRepository);

        widgetCommentService.removeWidgetComment(1L);
View Full Code Here

        widgetCommentService = new DefaultWidgetCommentService(widgetCommentRepository);
    }

    @Test
    public void getWidgetComment() {
        WidgetComment comment = new WidgetComment();
        comment.setEntityId(1L);
        expect(widgetCommentRepository.get(1L)).andReturn(comment);
        replay(widgetCommentRepository);

        assertEquals(comment, widgetCommentService.getWidgetComment(1L));
        verify(widgetCommentRepository);
View Full Code Here

        verify(widgetCommentRepository);
    }

    @Test
    public void saveWidgetComment() {
        WidgetComment comment = new WidgetComment();
        comment.setEntityId(1L);
        expect(widgetCommentRepository.save(comment)).andReturn(comment);
        replay(widgetCommentRepository);

        widgetCommentService.saveWidgetComment(comment);
        verify(widgetCommentRepository);
View Full Code Here

        verify(widgetCommentRepository);
    }

    @Test
    public void deleteWidgetComment() {
        WidgetComment comment = new WidgetComment();
        comment.setEntityId(1L);
        expect(widgetCommentRepository.get(1L)).andReturn(comment);
        widgetCommentRepository.delete(comment);
        replay(widgetCommentRepository);

        widgetCommentService.removeWidgetComment(1L);
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.WidgetComment

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.