@Test public void createExternalLink() throws Exception { String json = "{" + " 'zone':'programming'," + " 'title':'valid article'," + " 'url':'https: + "}"; mockMvc.perform(put("/api/article/external-link").header(AccountAccessToken.HEADER_KEY, accessToken).contentType(MediaType.APPLICATION_JSON).content(q(json))) .andExpect(status().isOk()); verify(articleService).createExternalLink(Mockito.isA(AccountAccessToken.class), eq(Zone.valueOf("programming")), eq("valid article"), eq("https: }
@RequestMapping(value = "/external-link", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) public void createExternalLink(AccountAccessToken token, @Valid @RequestBody CreateExternalLink request) { articleService.createExternalLink(token, request.zone, request.title.trim(), request.url.trim()); }
ArticleResource { @RequestMapping(value = "/external-link", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) public void createExternalLink(AccountAccessToken token, @Valid @RequestBody CreateExternalLink request) { articleService.createExternalLink(token, request.zone, request.title.trim(), request.url.trim()); } }
ArticleResource { @RequestMapping(value = "/external-link", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) public void createExternalLink(AccountAccessToken token, @Valid @RequestBody CreateExternalLink request) { articleService.createExternalLink(token, request.zone, request.title.trim(), request.url.trim()); }  }
ArticleResource { @RequestMapping(value = "/external-link", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) public void createExternalLink(AccountAccessToken token, @Valid @RequestBody CreateExternalLink request) { articleService.createExternalLink(token, request.zone, request.title.trim(), request.url.trim()); }  @RequestMapping(value = "/external-link", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) void createExternalLink(AccountAccessToken token,
      @Valid @RequestBody CreateExternalLink request); @RequestMapping(value = "/", method = RequestMethod.DELETE, consumes = { MediaType.APPLICATION_JSON_VALUE }) void deleteArticle(AccountAccessToken token, @Valid @RequestBody DeleteArticle request); @RequestMapping(value = "/speak", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) void createSpeak(AccountAccessToken token, @Valid @RequestBody CreateSpeak request); @RequestMapping(value = "/debate", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) SingleWrapper<String> create(AccountAccessToken token,
      @Valid @RequestBody CreateDebate request); @RequestMapping(value = "/debate/content", method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE }) String editDebateContent(AccountAccessToken token,
      @Valid @RequestBody UpdateDebate request); @RequestMapping(value = "/debate/content/preview", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) String previewDebateContent(@Valid @RequestBody Previewer request); @RequestMapping(value = "/speak/preview", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) String previewSpeakContent(@Valid @RequestBody Previewer request); @RequestMapping(value = "/debate/content", method = RequestMethod.GET) String loadEditableDebate(AccountAccessToken token,
      @RequestParam("debateId") FlakeId debateId); @RequestMapping(value = "/can-create", method = RequestMethod.GET) SingleWrapper<Boolean> canCreateArticle(AccountAccessToken token,
      @RequestParam("zone") String rawZone); @RequestMapping(value = "/external-link/exist", method = RequestMethod.GET) SingleWrapper<Boolean> isExternalUrlExist(@RequestParam("zone") String rawZone,
      @RequestParam("url") String url); @RequestMapping(value = "/external-link", method = RequestMethod.GET) List<FlakeId> listArticleIdsByExternalLink(@RequestParam("zone") String rawZone,
      @RequestParam("url") String url); @RequestMapping(value = "/can-delete", method = RequestMethod.GET) SingleWrapper<Boolean> canDeleteArticle(AccountAccessToken token,
      @RequestParam("username") String username,
      @RequestParam("articleId") FlakeId articleId); }
ArticleResource { @RequestMapping(value = "/external-link", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) public void createExternalLink(AccountAccessToken token, @Valid @RequestBody CreateExternalLink request) { articleService.createExternalLink(token, request.zone, request.title.trim(), request.url.trim()); }  @RequestMapping(value = "/external-link", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) void createExternalLink(AccountAccessToken token,
      @Valid @RequestBody CreateExternalLink request); @RequestMapping(value = "/", method = RequestMethod.DELETE, consumes = { MediaType.APPLICATION_JSON_VALUE }) void deleteArticle(AccountAccessToken token, @Valid @RequestBody DeleteArticle request); @RequestMapping(value = "/speak", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) void createSpeak(AccountAccessToken token, @Valid @RequestBody CreateSpeak request); @RequestMapping(value = "/debate", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) SingleWrapper<String> create(AccountAccessToken token,
      @Valid @RequestBody CreateDebate request); @RequestMapping(value = "/debate/content", method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE }) String editDebateContent(AccountAccessToken token,
      @Valid @RequestBody UpdateDebate request); @RequestMapping(value = "/debate/content/preview", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) String previewDebateContent(@Valid @RequestBody Previewer request); @RequestMapping(value = "/speak/preview", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_JSON_VALUE }) String previewSpeakContent(@Valid @RequestBody Previewer request); @RequestMapping(value = "/debate/content", method = RequestMethod.GET) String loadEditableDebate(AccountAccessToken token,
      @RequestParam("debateId") FlakeId debateId); @RequestMapping(value = "/can-create", method = RequestMethod.GET) SingleWrapper<Boolean> canCreateArticle(AccountAccessToken token,
      @RequestParam("zone") String rawZone); @RequestMapping(value = "/external-link/exist", method = RequestMethod.GET) SingleWrapper<Boolean> isExternalUrlExist(@RequestParam("zone") String rawZone,
      @RequestParam("url") String url); @RequestMapping(value = "/external-link", method = RequestMethod.GET) List<FlakeId> listArticleIdsByExternalLink(@RequestParam("zone") String rawZone,
      @RequestParam("url") String url); @RequestMapping(value = "/can-delete", method = RequestMethod.GET) SingleWrapper<Boolean> canDeleteArticle(AccountAccessToken token,
      @RequestParam("username") String username,
      @RequestParam("articleId") FlakeId articleId);  }