### Question:
BaseController { @ExceptionHandler(Exception.class) public ModelAndView handleException(Exception ex, HttpServletRequest req, HttpServletResponse res) throws Exception { res.setStatus(500); ModelAndView modelAndView = null; if (ex instanceof AjaxException) { return handleAjaxException((AjaxException) ex, res); } else if (ex instanceof ServiceException) { modelAndView = handleServiceException((ServiceException) ex, req, res); } if (modelAndView == null) { modelAndView = getErrorView(req); } modelAndView.getModel().put("exception", getMessage(ex)); modelAndView.getModel().put("url", req.getRequestURL().toString()); return modelAndView; }  @ExceptionHandler(Exception.class) ModelAndView handleException(Exception ex, HttpServletRequest req, HttpServletResponse res);  }### Answer:
@Test public void testHandleException() throws Exception { HttpResponse response = executeGet("/test/exp"); Assert.assertEquals("Exception异常捕获失败！", 500, response.getStatusLine().getStatusCode()); String resStr = EntityUtils.toString(response.getEntity(), defaultEncode); Assert.assertTrue("Exception异常捕获失败！", resStr.contains("测试Exception异常")); }