@Test public void testHello() { final String response = client.get().uri("hello").exchange().expectBody(String.class).returnResult().getResponseBody(); assertEquals(HelloController.ERROR_MSG, response); }
@RequestMapping("/hello") public String hello() { final NestedException nested = new NestedException("nested"); throw new CustomException("outer", nested); }
HelloController { @RequestMapping("/hello") public String hello() { final NestedException nested = new NestedException("nested"); throw new CustomException("outer", nested); } }
HelloController { @RequestMapping("/hello") public String hello() { final NestedException nested = new NestedException("nested"); throw new CustomException("outer", nested); }  }
HelloController { @RequestMapping("/hello") public String hello() { final NestedException nested = new NestedException("nested"); throw new CustomException("outer", nested); }  @RequestMapping("/hello") String hello(); @ExceptionHandler() String handleCustomException(final CustomException e); }
HelloController { @RequestMapping("/hello") public String hello() { final NestedException nested = new NestedException("nested"); throw new CustomException("outer", nested); }  @RequestMapping("/hello") String hello(); @ExceptionHandler() String handleCustomException(final CustomException e); static final String ERROR_MSG; }