TurbineController { @RequestMapping(path = "/ping", produces = "application/json") public PingResponse ping() throws Exception { logger.info("ping()"); return new PingResponse(ping.ping()); }  @PostConstruct void init(); @RequestMapping(path = "/ping", produces = "application/json") // @CrossOrigin(origins = "*", maxAge = 3600) PingResponse ping(); @RequestMapping("/stocks/{exchange}") // @CrossOrigin(origins = "*", maxAge = 3600) String stocks(@PathVariable String exchange); @RequestMapping("/indicators") // @CrossOrigin(origins = "*", maxAge = 3600) String indicators(); @RequestMapping("/strategies") // @CrossOrigin(origins = "*", maxAge = 3600) String strategies();  }
@Test public void getPing() throws Exception { given(ping.ping()).willReturn(pingTime); given(tickerManager.getTickers()).willReturn(tickers); PingResponse expected = new PingResponse(pingTime); mvc.perform( get(String.format("%s/%s", TurbineCondenserConstants.REST_ROOT_TURBINE, "ping")) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().json(json.writeValueAsString(expected))); }