ArticleController extends BaseController { @RequestMapping(value = "/tag", method = RequestMethod.GET) public @ResponseBody PageOut<ArticleOut> getArticlesByTag(@RequestParam(required = false) String tag) { return this.articleService.getArticlesByTagName(tag); }  @RequestMapping(value = "/article/{uri}", method = RequestMethod.GET) @ResponseBody Article getArticleById(@PathVariable String uri); @RequestMapping(value = "/article/relevancy/{id}") @ResponseBody List<Article> relevancy(@PathVariable Integer id); @RequestMapping(value = "/articles", method = RequestMethod.GET) @ResponseBody PageOut<ArticleOut> getArticlePage(@RequestParam(required = false) Integer page, @RequestParam(required = false) String column, @RequestParam(required = false) Integer year, @RequestParam(required = false) Integer month); @RequestMapping(value = "/tag", method = RequestMethod.GET) @ResponseBody PageOut<ArticleOut> getArticlesByTag(@RequestParam(required = false) String tag);  }
@Test public void getArticlesByTag() throws Exception { mockMvc.perform(get("/api/tag").param("tag", "java")).andExpect(status().isOk()); }