### Question:
AbstractRestApi { @ExceptionHandler(Exception.class) public String handleException(Exception ex, HttpServletRequest request, HttpServletResponse response) { logger.info("Error occured while accessing " + request.getRequestURL(), ex); response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); return ClassUtils.getShortName(ex.getClass()); }  @ExceptionHandler(AccessDeniedException.class) void handleAccessDeniedException(Exception ex, HttpServletRequest request, HttpServletResponse response); @ExceptionHandler(Exception.class) String handleException(Exception ex, HttpServletRequest request, HttpServletResponse response);  }### Answer:
@Test public void testHandleException() { RuntimeException re = new RuntimeException("error"); String value = abstractRestApiImpl.handleException(re, request, response); assertThat(value, is(ClassUtils.getShortName(re.getClass()))); assertThat(response.getStatus(), is(HttpStatus.INTERNAL_SERVER_ERROR.value())); }