### Question:
Xs2aRestExceptionHandler extends DefaultHandlerExceptionResolver { @Override protected ModelAndView handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException ex, HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { tppErrorMessageWriter.writeError(response, new TppErrorMessage(ERROR, SERVICE_INVALID_405_METHOD_NOT_SUPPORTED, ex.getMethod())); return new ModelAndView(); }    }### Answer:
@Test void handleHttpRequestMethodNotSupported() throws IOException { TppErrorMessage tppErrorMessage = new TppErrorMessage(ERROR, SERVICE_INVALID_405_METHOD_NOT_SUPPORTED, methodNotSupportedException.getMethod()); exceptionHandler.handleHttpRequestMethodNotSupported(methodNotSupportedException, request, response, handler); verify(tppErrorMessageWriter, times(1)).writeError(response, tppErrorMessage); }