@Test void handleException() throws NoSuchMethodException { ResponseEntity<Map> result = service.handleException(new Exception("Msg"), new HandlerMethod(service, "toString", null)); ResponseEntity<Map<String, String>> expected = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(getExpected(500, "Msg")); compareBodies(result, expected); }
@ExceptionHandler(value = Exception.class) public ResponseEntity<Map> handleException(Exception ex, HandlerMethod handlerMethod) { log.warn("Exception handled in service: {}, message: {}", handlerMethod.getMethod().getDeclaringClass().getSimpleName(), ex.getMessage()); return new ResponseEntity<>(buildContentMap(500, ex.getMessage()), INTERNAL_SERVER_ERROR); }
TppExceptionAdvisor { @ExceptionHandler(value = Exception.class) public ResponseEntity<Map> handleException(Exception ex, HandlerMethod handlerMethod) { log.warn("Exception handled in service: {}, message: {}", handlerMethod.getMethod().getDeclaringClass().getSimpleName(), ex.getMessage()); return new ResponseEntity<>(buildContentMap(500, ex.getMessage()), INTERNAL_SERVER_ERROR); } }
TppExceptionAdvisor { @ExceptionHandler(value = Exception.class) public ResponseEntity<Map> handleException(Exception ex, HandlerMethod handlerMethod) { log.warn("Exception handled in service: {}, message: {}", handlerMethod.getMethod().getDeclaringClass().getSimpleName(), ex.getMessage()); return new ResponseEntity<>(buildContentMap(500, ex.getMessage()), INTERNAL_SERVER_ERROR); }  }
TppExceptionAdvisor { @ExceptionHandler(value = Exception.class) public ResponseEntity<Map> handleException(Exception ex, HandlerMethod handlerMethod) { log.warn("Exception handled in service: {}, message: {}", handlerMethod.getMethod().getDeclaringClass().getSimpleName(), ex.getMessage()); return new ResponseEntity<>(buildContentMap(500, ex.getMessage()), INTERNAL_SERVER_ERROR); }  @ExceptionHandler(value = Exception.class) ResponseEntity<Map> handleException(Exception ex, HandlerMethod handlerMethod); @ExceptionHandler(TppException.class) ResponseEntity<Map> handleTppException(TppException ex, HandlerMethod handlerMethod); @ExceptionHandler(FeignException.class) ResponseEntity<Map> handleFeignException(FeignException ex, HandlerMethod handlerMethod); @ExceptionHandler(IllegalArgumentException.class) ResponseEntity<Map> handleIllegalArgumentException(IllegalArgumentException ex, HandlerMethod handlerMethod); }
TppExceptionAdvisor { @ExceptionHandler(value = Exception.class) public ResponseEntity<Map> handleException(Exception ex, HandlerMethod handlerMethod) { log.warn("Exception handled in service: {}, message: {}", handlerMethod.getMethod().getDeclaringClass().getSimpleName(), ex.getMessage()); return new ResponseEntity<>(buildContentMap(500, ex.getMessage()), INTERNAL_SERVER_ERROR); }  @ExceptionHandler(value = Exception.class) ResponseEntity<Map> handleException(Exception ex, HandlerMethod handlerMethod); @ExceptionHandler(TppException.class) ResponseEntity<Map> handleTppException(TppException ex, HandlerMethod handlerMethod); @ExceptionHandler(FeignException.class) ResponseEntity<Map> handleFeignException(FeignException ex, HandlerMethod handlerMethod); @ExceptionHandler(IllegalArgumentException.class) ResponseEntity<Map> handleIllegalArgumentException(IllegalArgumentException ex, HandlerMethod handlerMethod);  }