@Test public void getPostByUuid() throws Exception { this.mockMvc.perform(get("/post/uuid/{uuid}", posts.get(1).getUuid())) .andExpect(status().isOk()) .andExpect(jsonPath("$.sourceName", is("The Post"))); }
@ApiOperation("Get a post by its UUID") @RequestMapping(value = "/uuid/{uuid}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Post getPostByUuid(@PathVariable("uuid") String uuid) { return postRepository.findOne(uuid); }
PostController { @ApiOperation("Get a post by its UUID") @RequestMapping(value = "/uuid/{uuid}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Post getPostByUuid(@PathVariable("uuid") String uuid) { return postRepository.findOne(uuid); } }
PostController { @ApiOperation("Get a post by its UUID") @RequestMapping(value = "/uuid/{uuid}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Post getPostByUuid(@PathVariable("uuid") String uuid) { return postRepository.findOne(uuid); } @Autowired  PostController(PostRepository postRepository); }
PostController { @ApiOperation("Get a post by its UUID") @RequestMapping(value = "/uuid/{uuid}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Post getPostByUuid(@PathVariable("uuid") String uuid) { return postRepository.findOne(uuid); } @Autowired  PostController(PostRepository postRepository); @ApiOperation("Get all posts in a paginated format") @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) Page<Post> getAllByPage(Pageable pageable, @RequestParam(value = "whitelist", required = false)
        String[] sourcesWhitelist, @RequestParam(required = false, defaultValue = "") String query); @ApiOperation("Get a post by its UUID") @RequestMapping(value = "/uuid/{uuid}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) Post getPostByUuid(@PathVariable("uuid") String uuid); @ApiOperation("Get posts after a given date") @RequestMapping(value = "/afterdate/{date}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) Iterable<Post> getPostAfterDate(
        @PathVariable("date") long date,
        @RequestParam(required = false, defaultValue = "true", value = "ordered") boolean ordered,
        @PathVariable(required = false) String[] sourcesWhitelist); @ApiOperation("flag a post by its UUID") @RequestMapping(value = "/{uuid}/flag", method = RequestMethod.POST) void flagPost(@PathVariable("uuid") String uuid,
                         @RequestBody FlagRequest body); }
PostController { @ApiOperation("Get a post by its UUID") @RequestMapping(value = "/uuid/{uuid}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Post getPostByUuid(@PathVariable("uuid") String uuid) { return postRepository.findOne(uuid); } @Autowired  PostController(PostRepository postRepository); @ApiOperation("Get all posts in a paginated format") @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) Page<Post> getAllByPage(Pageable pageable, @RequestParam(value = "whitelist", required = false)
        String[] sourcesWhitelist, @RequestParam(required = false, defaultValue = "") String query); @ApiOperation("Get a post by its UUID") @RequestMapping(value = "/uuid/{uuid}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) Post getPostByUuid(@PathVariable("uuid") String uuid); @ApiOperation("Get posts after a given date") @RequestMapping(value = "/afterdate/{date}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) Iterable<Post> getPostAfterDate(
        @PathVariable("date") long date,
        @RequestParam(required = false, defaultValue = "true", value = "ordered") boolean ordered,
        @PathVariable(required = false) String[] sourcesWhitelist); @ApiOperation("flag a post by its UUID") @RequestMapping(value = "/{uuid}/flag", method = RequestMethod.POST) void flagPost(@PathVariable("uuid") String uuid,
                         @RequestBody FlagRequest body);  }