### Question:
Xs2aRestExceptionHandler extends DefaultHandlerExceptionResolver { @Override protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { if (xs2aEndpointChecker.isXs2aEndpoint(request)) { return super.doResolveException(request, response, handler, ex); } return null; }    }### Answer:
@Test void doResolveException_resolve() { when(xs2aEndpointChecker.isXs2aEndpoint(request)).thenReturn(true); ModelAndView actual = exceptionHandler.doResolveException(request, response, handler, methodNotSupportedException); assertNotNull(actual); }
@Test void doResolveException_doNotResolve() { when(xs2aEndpointChecker.isXs2aEndpoint(request)).thenReturn(false); ModelAndView actual = exceptionHandler.doResolveException(request, response, handler, methodNotSupportedException); assertNull(actual); }