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