@Test void testHandleNotFoundException() { Exception e = mock(Exception.class); HandlerMethod method = mock(HandlerMethod.class); globalControllerExceptionHandler.handleNotFoundException(e, method); verify(exceptionHandlerFacade).logAndHandleException(e, NOT_FOUND, method); }
@ExceptionHandler(UnknownDataException.class) public Object handleNotFoundException(Exception e, HandlerMethod handlerMethod) { return logAndHandleException(e, NOT_FOUND, handlerMethod); }
GlobalControllerExceptionHandler extends SpringExceptionHandler { @ExceptionHandler(UnknownDataException.class) public Object handleNotFoundException(Exception e, HandlerMethod handlerMethod) { return logAndHandleException(e, NOT_FOUND, handlerMethod); } }
GlobalControllerExceptionHandler extends SpringExceptionHandler { @ExceptionHandler(UnknownDataException.class) public Object handleNotFoundException(Exception e, HandlerMethod handlerMethod) { return logAndHandleException(e, NOT_FOUND, handlerMethod); } GlobalControllerExceptionHandler(ExceptionHandlerFacade exceptionHandlerFacade); }
GlobalControllerExceptionHandler extends SpringExceptionHandler { @ExceptionHandler(UnknownDataException.class) public Object handleNotFoundException(Exception e, HandlerMethod handlerMethod) { return logAndHandleException(e, NOT_FOUND, handlerMethod); } GlobalControllerExceptionHandler(ExceptionHandlerFacade exceptionHandlerFacade); @ExceptionHandler(UnknownDataException.class) Object handleNotFoundException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler(DataAlreadyExistsException.class) Object handleConflictException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler({ BadRequestException.class, DataConstraintViolationException.class, RepositoryConstraintViolationException.class }) Object handleBadRequestException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler(ForbiddenException.class) Object handleForbiddenException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler(PermissionDeniedException.class) Object handleUnauthorizedException(Exception e, HandlerMethod handlerMethod); }
GlobalControllerExceptionHandler extends SpringExceptionHandler { @ExceptionHandler(UnknownDataException.class) public Object handleNotFoundException(Exception e, HandlerMethod handlerMethod) { return logAndHandleException(e, NOT_FOUND, handlerMethod); } GlobalControllerExceptionHandler(ExceptionHandlerFacade exceptionHandlerFacade); @ExceptionHandler(UnknownDataException.class) Object handleNotFoundException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler(DataAlreadyExistsException.class) Object handleConflictException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler({ BadRequestException.class, DataConstraintViolationException.class, RepositoryConstraintViolationException.class }) Object handleBadRequestException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler(ForbiddenException.class) Object handleForbiddenException(Exception e, HandlerMethod handlerMethod); @ExceptionHandler(PermissionDeniedException.class) Object handleUnauthorizedException(Exception e, HandlerMethod handlerMethod);  }