Package org.jtalks.jcommune.plugin.api.exceptions

Examples of org.jtalks.jcommune.plugin.api.exceptions.NotFoundException


    }

    @Test(expectedExceptions = NotFoundException.class)
    public void testDeleteBranchIncorrectId() throws NotFoundException {
        doReturn(userWithPassword("password")).when(userService).getCommonUserByUsername("admin");
        when(branchService.deleteAllTopics(anyLong())).thenThrow(new NotFoundException());
        controller.deleteBranch(BRANCH_ID, "password");
    }
View Full Code Here


    }

    @Test(expectedExceptions = NotFoundException.class)
    public void testDeleteSectionIncorrectId() throws NotFoundException {
        doReturn(userWithPassword("password")).when(userService).getCommonUserByUsername("admin");
        when(sectionService.deleteAllTopicsInSection(anyLong())).thenThrow(new NotFoundException());
        controller.deleteSection(SECTION_ID, "password");

        assertTrue(false);
    }
View Full Code Here

    }

    @Test(expectedExceptions = NotFoundException.class)
    public void testDeleteComponentFail() throws NotFoundException {
        doReturn(userWithPassword("password")).when(userService).getCommonUserByUsername("admin");
        doThrow(new NotFoundException()).when(sectionService).deleteAllTopicsInForum();

        controller.deleteComponent("password");
    }
View Full Code Here

        EditUserProfileDto userDto = getEditUserProfileDto();
        MockHttpServletResponse response = new MockHttpServletResponse();
        BindingResult bindingResult = new BeanPropertyBindingResult(userDto, "editedUser");
        when(userService.getCurrentUser()).thenReturn(getUser());
        when(userService.saveEditedUserProfile(anyLong(), any(UserInfoContainer.class)))
            .thenThrow(new NotFoundException());
       
        profileController.saveEditedProfile(userDto, bindingResult, response);
    }
View Full Code Here

    public void testAddCommentReviewNotFound() throws AccessDeniedException, NotFoundException {
        BindingResult bindingResult = mock(BindingResult.class);

        when(bindingResult.hasErrors()).thenReturn(false);
        when(codeReviewService.addComment(anyLong(), anyInt(), anyString()))
            .thenThrow(new NotFoundException());

        controller.addComment(new CodeReviewCommentDto(), bindingResult, 1L);
    }
View Full Code Here

    public void testEditCommentNotFound() throws AccessDeniedException, NotFoundException {
        BindingResult bindingResult = mock(BindingResult.class);

        when(bindingResult.hasErrors()).thenReturn(false);
        when(codeReviewCommentService.updateComment(anyLong(), anyString(), anyLong()))
            .thenThrow(new NotFoundException());

        controller.editComment(new CodeReviewCommentDto(), bindingResult, BRANCH_ID);
    }
View Full Code Here

        assertEquals(jsonResponse.getStatus(), JsonResponseStatus.SUCCESS);
    }

    @Test(expectedExceptions = NotFoundException.class)
    public void testDeleteCommentReviewNotFound() throws NotFoundException {
        doThrow(new NotFoundException()).when(codeReviewService).get(anyLong());
        controller.deleteComment(COMMENT_ID, REVIEW_ID);
    }
View Full Code Here

        controller.deleteComment(COMMENT_ID, REVIEW_ID);
    }

    @Test(expectedExceptions = NotFoundException.class)
    public void testDeleteCommentCommentNotFound() throws NotFoundException {
        doThrow(new NotFoundException()).when(codeReviewCommentService).get(anyLong());
        controller.deleteComment(COMMENT_ID, REVIEW_ID);
    }
View Full Code Here

    }

    @Test
    public void testLogExceptionWithIncomingNotFoundException() throws Exception {
        Log mockLog = replaceLoggerWithMock(prettyLogExceptionResolver);
        NotFoundException notFoundException = new NotFoundException("Entity not found");
        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/");
        request.setContent("".getBytes());
        prettyLogExceptionResolver.logException(notFoundException, request);

        verify(mockLog).info("Entity not found");
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.plugin.api.exceptions.NotFoundException

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.