CommentController { @RequestMapping(value = "/comments", method = RequestMethod.GET) public List<Comment> comments(@PathVariable String projectId) { return commentService.loadCommentsByProject(projectId); }  @RequestMapping(value = "/comments", method = RequestMethod.GET) List<Comment> comments(@PathVariable String projectId); @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/comment", method = RequestMethod.POST) void storeComment(@PathVariable String projectId, Principal principal, @Valid @RequestBody Comment comment);  }
@Test public void comments() throws Exception { final MvcResult mvcResult = mockMvc.perform(get("/project/" + EXISTING_PROJECT_ID + "/comments")) .andExpect(status().isOk()) .andReturn(); assertThat( mvcResult.getResponse().getContentAsString(), is("[{\"created\":" + aComment.getCreated().getMillis()+ ",\"userName\":\"Test Name\",\"comment\":\"some comment\"}]")); }