@Test public void hello() { mockServer.expect(MockRestRequestMatchers.requestTo("/rest/hello")) .andRespond(MockRestResponseCreators.withSuccess( new ClassPathResource("/test.json", getClass()), MediaType.APPLICATION_JSON)); }
@GetMapping("/hello") public ResponseEntity<String> hello() { String data = "myData"; return new ResponseEntity<>(data, HttpStatus.OK); }
MyRestController { @GetMapping("/hello") public ResponseEntity<String> hello() { String data = "myData"; return new ResponseEntity<>(data, HttpStatus.OK); } }
MyRestController { @GetMapping("/hello") public ResponseEntity<String> hello() { String data = "myData"; return new ResponseEntity<>(data, HttpStatus.OK); }  }
MyRestController { @GetMapping("/hello") public ResponseEntity<String> hello() { String data = "myData"; return new ResponseEntity<>(data, HttpStatus.OK); }  @GetMapping("/hello") ResponseEntity<String> hello(); }
MyRestController { @GetMapping("/hello") public ResponseEntity<String> hello() { String data = "myData"; return new ResponseEntity<>(data, HttpStatus.OK); }  @GetMapping("/hello") ResponseEntity<String> hello();  }