@Test public void createdArticles() throws Exception { Article a1 = article(zone, "ruby is great"); Article a2 = article(zone, "I like rails"); when(articleService.listArticlesByAuthor("foo-user", null)).thenReturn(asList(a1, a2)); mockMvc.perform(get("/u/foo-user/articles")) .andExpect(content().string(containsString("I like rails"))); }
@RequestMapping("/u/{username}/articles") public ModelAndView createdArticles(@PathVariable("username") String username, @RequestParam(value = "start", required = false) FlakeId startArticleId) { List<Article> articles = articleService.listArticlesByAuthor(username, startArticleId); return new ModelAndView("account/user-articles") .addObject("articleList", new ArticleList(articles)).addObject("username", username); }
UserController { @RequestMapping("/u/{username}/articles") public ModelAndView createdArticles(@PathVariable("username") String username, @RequestParam(value = "start", required = false) FlakeId startArticleId) { List<Article> articles = articleService.listArticlesByAuthor(username, startArticleId); return new ModelAndView("account/user-articles") .addObject("articleList", new ArticleList(articles)).addObject("username", username); } }
UserController { @RequestMapping("/u/{username}/articles") public ModelAndView createdArticles(@PathVariable("username") String username, @RequestParam(value = "start", required = false) FlakeId startArticleId) { List<Article> articles = articleService.listArticlesByAuthor(username, startArticleId); return new ModelAndView("account/user-articles") .addObject("articleList", new ArticleList(articles)).addObject("username", username); }  }
UserController { @RequestMapping("/u/{username}/articles") public ModelAndView createdArticles(@PathVariable("username") String username, @RequestParam(value = "start", required = false) FlakeId startArticleId) { List<Article> articles = articleService.listArticlesByAuthor(username, startArticleId); return new ModelAndView("account/user-articles") .addObject("articleList", new ArticleList(articles)).addObject("username", username); }  @RequestMapping("/u/{username}") Object userProfile(@PathVariable("username") String username); @RequestMapping("/u/{username}/articles") ModelAndView createdArticles(@PathVariable("username") String username,
      @RequestParam(value = "start", required = false) FlakeId startArticleId); @RequestMapping("/u/{username}/honors") ModelAndView userHonors(@PathVariable("username") String username); @RequestMapping("/u/{username}/debates") ModelAndView createdDebates(@PathVariable("username") String username,
      @RequestParam(value = "start", required = false) FlakeId startDebateId); }
UserController { @RequestMapping("/u/{username}/articles") public ModelAndView createdArticles(@PathVariable("username") String username, @RequestParam(value = "start", required = false) FlakeId startArticleId) { List<Article> articles = articleService.listArticlesByAuthor(username, startArticleId); return new ModelAndView("account/user-articles") .addObject("articleList", new ArticleList(articles)).addObject("username", username); }  @RequestMapping("/u/{username}") Object userProfile(@PathVariable("username") String username); @RequestMapping("/u/{username}/articles") ModelAndView createdArticles(@PathVariable("username") String username,
      @RequestParam(value = "start", required = false) FlakeId startArticleId); @RequestMapping("/u/{username}/honors") ModelAndView userHonors(@PathVariable("username") String username); @RequestMapping("/u/{username}/debates") ModelAndView createdDebates(@PathVariable("username") String username,
      @RequestParam(value = "start", required = false) FlakeId startDebateId);  }