@Test public void rssFeed() throws Exception { Article article = article(funZone.getZone(), "joke xyz 1"); when(articleService.listRssTopArticlesWithCache()).thenReturn(singletonList(article)); final DateTimeFormatter RFC1123_FORMATTER = DateTimeFormatter.ofPattern( "EEE, dd MMM yyyy HH:mm:ss zzz").withZone(ZoneId.of("GMT")).withLocale(Locale.US); mockMvc.perform(get("/hot.rss")) .andExpect(content().encoding("UTF-8")) .andExpect(xpath("/rss/channel/title").string("熱門 kaif.io")) .andExpect(xpath("/rss/channel/description").string("綜合熱門")) .andExpect(xpath("/rss/channel/pubDate").string(RFC1123_FORMATTER.format(article.getCreateTime()))) .andExpect(xpath("/rss/channel/item[1]/title").string("joke xyz 1")); }
@RequestMapping("/hot.rss") public Object rssFeed() { ModelAndView modelAndView = new ModelAndView().addObject("articles", articleService.listRssTopArticlesWithCache()); modelAndView.setView(new HotArticleRssContentView()); return modelAndView; }
HomeController { @RequestMapping("/hot.rss") public Object rssFeed() { ModelAndView modelAndView = new ModelAndView().addObject("articles", articleService.listRssTopArticlesWithCache()); modelAndView.setView(new HotArticleRssContentView()); return modelAndView; } }
HomeController { @RequestMapping("/hot.rss") public Object rssFeed() { ModelAndView modelAndView = new ModelAndView().addObject("articles", articleService.listRssTopArticlesWithCache()); modelAndView.setView(new HotArticleRssContentView()); return modelAndView; }  }
HomeController { @RequestMapping("/hot.rss") public Object rssFeed() { ModelAndView modelAndView = new ModelAndView().addObject("articles", articleService.listRssTopArticlesWithCache()); modelAndView.setView(new HotArticleRssContentView()); return modelAndView; }  @RequestMapping("/") ModelAndView index(
      @RequestParam(value = "start", required = false) FlakeId startArticleId); @RequestMapping("/hot.rss") Object rssFeed(); @RequestMapping("/new") ModelAndView listLatestArticles(
      @RequestParam(value = "start", required = false) FlakeId startArticleId); @RequestMapping("/new-debate") ModelAndView listLatestDebates(
      @RequestParam(value = "start", required = false) FlakeId startDebateId); @RequestMapping("/zone/a-z") ModelAndView zoneAtoZ(); @RequestMapping("/honor") ModelAndView listTopHonor(); }
HomeController { @RequestMapping("/hot.rss") public Object rssFeed() { ModelAndView modelAndView = new ModelAndView().addObject("articles", articleService.listRssTopArticlesWithCache()); modelAndView.setView(new HotArticleRssContentView()); return modelAndView; }  @RequestMapping("/") ModelAndView index(
      @RequestParam(value = "start", required = false) FlakeId startArticleId); @RequestMapping("/hot.rss") Object rssFeed(); @RequestMapping("/new") ModelAndView listLatestArticles(
      @RequestParam(value = "start", required = false) FlakeId startArticleId); @RequestMapping("/new-debate") ModelAndView listLatestDebates(
      @RequestParam(value = "start", required = false) FlakeId startDebateId); @RequestMapping("/zone/a-z") ModelAndView zoneAtoZ(); @RequestMapping("/honor") ModelAndView listTopHonor();  }