ConsoleConfigController extends AbstractOhfController { @RequestMapping(method = RequestMethod.GET, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.OK) @ResponseBody public ConsoleConfigRpc get() { return config; }  @RequestMapping(method = RequestMethod.GET, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.OK) @ResponseBody ConsoleConfigRpc get(); static final String REST_URI; }
@Test public void testGet() throws Exception { final URIBuilder uriBuilder = createGetUrl(ROOT_URI); mockMvc.perform(get(toUrl(uriBuilder)) .accept(MediaType.APPLICATION_JSON) .with(SecurityMockMvcRequestPostProcessors.authentication(mockAuthentication("ADMIN")))) .andExpect(status().isOk()) .andExpect(jsonPath("config.menu.changes.enabled", is(true))) .andExpect(jsonPath("config.menu.externalLinks.enabled", is(true))) .andExpect(jsonPath("config.menu.externalLinks.items[0].title", is("title1"))) .andExpect(jsonPath("config.menu.externalLinks.items[0].link", is("link1"))) .andExpect(jsonPath("config.menu.externalLinks.items[0].enabled", is(true))) .andExpect(jsonPath("config.menu.externalLinks.items[1].title", is("title2"))) .andExpect(jsonPath("config.menu.externalLinks.items[1].link", is("link2"))) .andExpect(jsonPath("config.menu.externalLinks.items[1].enabled", is(true))); }