StatusController { @RequestMapping("/ping") public Long ping() { return ping.ping(); }  @RequestMapping("/ping") Long ping(); @RequestMapping("/user") Principal user(Principal user);  }
@Test public void testPing() throws Exception { given(ping.ping()).willReturn(123l); mvc.perform(get("/ping").accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string(equalTo("123"))); }