@Test
    public void findAllSubComments_for_comment_returns_collection_status_isFound() throws Exception{
        when(commentService.findCommentsByCommentParentId(anyInt())).thenReturn(Arrays.asList(comments));
        when(userService.findUserById(anyInt())).thenReturn(Optional.of(user));
        when(commentLikeService.checkIfCommentIsLiked(any(Comment.class), any(User.class))).thenReturn(true);
        ResultActions results = mockMvc
                .perform(
                    get("/microblogging/v1/comment/2?requestedUserId=1"))
                .andDo(print());
        results
                .andExpect(status().isOk())
                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andExpect(jsonPath("$.*").isArray())
                .andExpect(jsonPath("$.*",hasSize(4)))
                .andReturn();
    }
@Test
    public void findAllSubComments_for_comment_returns_collection_status_isFound() throws Exception{
        when(commentService.findCommentsByCommentParentId(anyInt())).thenReturn(Arrays.asList(comments));
        when(userService.findUserById(anyInt())).thenReturn(Optional.of(user));
        when(commentLikeService.checkIfCommentIsLiked(any(Comment.class), any(User.class))).thenReturn(true);
        ResultActions results = mockMvc
                .perform(
                    get("/microblogging/v1/comment/2?requestedUserId=1"))
                .andDo(print());
        results
                .andExpect(status().isOk())
                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andExpect(jsonPath("$.*").isArray())
                .andExpect(jsonPath("$.*",hasSize(4)))
                .andReturn();
    }
@test public void findallsubcomments_for_comment_returns_collection_status_isfound() throws exception{ when(commentservice.findcommentsbycommentparentid(anyint())).thenreturn(arrays.aslist(comments)); when(userservice.finduserbyid(anyint())).thenreturn(optional.of(user)); when(commentlikeservice.checkifcommentisliked(any(comment.class), any(user.class))).thenreturn(true); resultactions results = mockmvc .perform( get("/microblogging/v1/comment/2?requesteduserid=1")) .anddo(print()); results .andexpect(status().isok()) .andexpect(content().contenttype(mediatype.application_json)) .andexpect(jsonpath("$.*").isarray()) .andexpect(jsonpath("$.*",hassize(4))) .andreturn(); }