@Test public void applicationJsonHomeShouldNotContainAdditionalInformation() throws Exception { final JsonHomeController controller = jsonHomeController( ControllerWithDocumentation.class, "http: final MockHttpServletResponse response = new MockHttpServletResponse(); final Map<String, ?> resourcesMap = controller.getAsApplicationJsonHome(response); @SuppressWarnings("unchecked") final Map<String, Map<String, ?>> resources = (Map<String, Map<String, ?>>) resourcesMap.get("resources"); final Map<String, ?> hints = asMap(resources.get("http: assertNull(hints.get("description")); }
@RequestMapping(produces = {"application/json-home"}) @ResponseBody public Map<String, ?> getAsApplicationJsonHome(final HttpServletResponse response) { LOG.info("Returning json-home in application/json-home format."); response.setHeader("Cache-Control", "max-age=" + maxAge); response.setHeader("Vary", "Accept"); return toRepresentation(jsonHomeSource.getJsonHome(), APPLICATION_JSONHOME); }
JsonHomeController { @RequestMapping(produces = {"application/json-home"}) @ResponseBody public Map<String, ?> getAsApplicationJsonHome(final HttpServletResponse response) { LOG.info("Returning json-home in application/json-home format."); response.setHeader("Cache-Control", "max-age=" + maxAge); response.setHeader("Vary", "Accept"); return toRepresentation(jsonHomeSource.getJsonHome(), APPLICATION_JSONHOME); } }
JsonHomeController { @RequestMapping(produces = {"application/json-home"}) @ResponseBody public Map<String, ?> getAsApplicationJsonHome(final HttpServletResponse response) { LOG.info("Returning json-home in application/json-home format."); response.setHeader("Cache-Control", "max-age=" + maxAge); response.setHeader("Vary", "Accept"); return toRepresentation(jsonHomeSource.getJsonHome(), APPLICATION_JSONHOME); }  }
JsonHomeController { @RequestMapping(produces = {"application/json-home"}) @ResponseBody public Map<String, ?> getAsApplicationJsonHome(final HttpServletResponse response) { LOG.info("Returning json-home in application/json-home format."); response.setHeader("Cache-Control", "max-age=" + maxAge); response.setHeader("Vary", "Accept"); return toRepresentation(jsonHomeSource.getJsonHome(), APPLICATION_JSONHOME); }  @Autowired void setJsonHomeSource(final JsonHomeSource jsonHomeSource); @Value("${jsonhome.relationTypeBaseUri}") void setRelationTypeBaseUri(String relationTypeBaseUri); URI relationTypeBaseUri(); void setMaxAgeSeconds(int maxAge); @RequestMapping(produces = {"application/json-home"}) @ResponseBody Map<String, ?> getAsApplicationJsonHome(final HttpServletResponse response); @RequestMapping(produces = {"application/json"}) @ResponseBody Map<String, ?> getAsApplicationJson(final HttpServletResponse response); }
JsonHomeController { @RequestMapping(produces = {"application/json-home"}) @ResponseBody public Map<String, ?> getAsApplicationJsonHome(final HttpServletResponse response) { LOG.info("Returning json-home in application/json-home format."); response.setHeader("Cache-Control", "max-age=" + maxAge); response.setHeader("Vary", "Accept"); return toRepresentation(jsonHomeSource.getJsonHome(), APPLICATION_JSONHOME); }  @Autowired void setJsonHomeSource(final JsonHomeSource jsonHomeSource); @Value("${jsonhome.relationTypeBaseUri}") void setRelationTypeBaseUri(String relationTypeBaseUri); URI relationTypeBaseUri(); void setMaxAgeSeconds(int maxAge); @RequestMapping(produces = {"application/json-home"}) @ResponseBody Map<String, ?> getAsApplicationJsonHome(final HttpServletResponse response); @RequestMapping(produces = {"application/json"}) @ResponseBody Map<String, ?> getAsApplicationJson(final HttpServletResponse response);  }