Spring MVC Test with RequestPostProcessor vs. Annotations
I have an application I've created with JHipster. I generated a Blog entity, then modified the BlogResource class so its getAll() method only returns the blog for the current user. /** * GET /blogs -> get all the blogs. */ @RequestMapping(value = "/blogs", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public List<Blog> getAll() { log.debug("REST request to get all Blogs"); return blogRepository.findAllForCurrentUser(); } BlogRepository has the following for its findAllForCurrentUser() method. @Query("select blog from Blog blog where blog.user.login = ?#