Package org.jtalks.jcommune.model.entity

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


    }


    @Test
    public void testGetInvalidId() {
        CodeReviewComment result = codeReviewCommentDao.get(-567890L);

        assertNull(result);
    }
View Full Code Here


    }

    @Test
    public void testUpdate() {
        String newUuid = "1234-1231-1231";
        CodeReviewComment review = PersistedObjectsFactory.getDefaultCodeReviewComment();
        session.save(review);
        review.setUuid(newUuid);

        codeReviewCommentDao.saveOrUpdate(review);
        session.flush();
        session.evict(review);
        CodeReviewComment result = (CodeReviewComment) session.get(CodeReviewComment.class, review.getId());

        assertEquals(result.getUuid(), newUuid);
    }
View Full Code Here

        assertEquals(result.getUuid(), newUuid);
    }

    @Test(expectedExceptions = org.hibernate.exception.ConstraintViolationException.class)
    public void testUpdateNotNullViolation() {
        CodeReviewComment review = PersistedObjectsFactory.getDefaultCodeReviewComment();
        session.save(review);
        review.setUuid(null);
        codeReviewCommentDao.saveOrUpdate(review);
        session.flush();
    }
View Full Code Here

            BindingResult bindingResult,
            @RequestParam("reviewId") Long reviewId) throws NotFoundException {
        if (bindingResult.hasErrors()) {
            return new FailValidationJsonResponse(bindingResult.getAllErrors());
        }
        CodeReviewComment addedComment = codeReviewService.addComment(
                reviewId, commentDto.getLineNumber(), commentDto.getBody());
        CodeReviewCommentDto addedCommentDto = new CodeReviewCommentDto(addedComment);
        return new JsonResponse(JsonResponseStatus.SUCCESS, addedCommentDto);
    }
View Full Code Here

            BindingResult bindingResult,
            @RequestParam("branchId") long branchId) throws NotFoundException {
        if (bindingResult.hasErrors()) {
            return new FailValidationJsonResponse(bindingResult.getAllErrors());
        }
        CodeReviewComment editedComment = codeReviewCommentService.updateComment(
                commentDto.getId(), commentDto.getBody(), branchId);
        CodeReviewCommentDto editedCommentDto = new CodeReviewCommentDto(editedComment);
        return new JsonResponse(JsonResponseStatus.SUCCESS, editedCommentDto);
    }
View Full Code Here

TOP

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

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.