Package org.jtalks.jcommune.model.entity

Examples of org.jtalks.jcommune.model.entity.CodeReview


        assertEquals(dto.getComments().size(), 0);
    }
   
    @Test
    public void testPrototypeConstructor() {
        CodeReview review = getCodeReview();
       
        CodeReviewDto dto = new CodeReviewDto(review);
       
        assertEquals(dto.getId(), REVIEW_ID);
        assertNotNull(dto.getComments());
        assertEquals(dto.getComments().size(), review.getComments().size());
    }
View Full Code Here


        assertNotNull(dto.getComments());
        assertEquals(dto.getComments().size(), review.getComments().size());
    }
   
    private CodeReview getCodeReview() {
        CodeReview review = new CodeReview();
        review.setId(REVIEW_ID);
       
        CodeReviewComment comment1 = new CodeReviewComment();
        comment1.setId(1L);
        comment1.setAuthor(new JCUser("username1", "mail1", "password1" ));
        comment1.setBody("Comment1 body");
        comment1.setLineNumber(1);
        comment1.setCreationDate(new DateTime(1));
        review.addComment(comment1);
       
        CodeReviewComment comment2 = new CodeReviewComment();
        comment2.setId(2L);
        comment2.setAuthor(new JCUser("username2", "mail2", "password2" ));
        comment2.setBody("Comment2 body");
        comment2.setLineNumber(2);
        comment2.setCreationDate(new DateTime(2));
        review.addComment(comment1);

        return review;
    }
View Full Code Here

        controller.editComment(new CodeReviewCommentDto(), bindingResult, BRANCH_ID);
    }

    @Test
    public void testDeleteComment() throws NotFoundException {
        CodeReview cr = new CodeReview();
        CodeReviewComment crc = new CodeReviewComment();

        when(codeReviewService.get(REVIEW_ID)).thenReturn(cr);
        when(codeReviewCommentService.get(COMMENT_ID)).thenReturn(crc);
        JsonResponse jsonResponse = controller.deleteComment(COMMENT_ID, REVIEW_ID);
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.model.entity.CodeReview

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.