TimingInterceptor extends HandlerInterceptorAdapter { @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { StopWatch stopWatch = (StopWatch) request.getAttribute(STOP_WATCH); stopWatch.stop(); String requestURL = getRequestUrl(request); LOGGER.info("{} - time taken {}", requestURL, stopWatch.getTotalTimeSeconds()); }  @Override boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler); @Override void postHandle(HttpServletRequest request,
                           HttpServletResponse response,
                           Object handler,
                           ModelAndView modelAndView);  }
@Test public void testPostHandle() { subject.postHandle(requestMock, null, null, null); verify(requestMock).getAttribute(STOP_WATCH); verify(stopWatch).stop(); }