TimingInterceptor extends HandlerInterceptorAdapter { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { String requestURL = getRequestUrl(request); LOGGER.info("{} - start", requestURL); StopWatch stopWatch = new StopWatch(getClass().getSimpleName()); stopWatch.start(); request.setAttribute(STOP_WATCH, stopWatch); return true; }  @Override boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler); @Override void postHandle(HttpServletRequest request,
                           HttpServletResponse response,
                           Object handler,
                           ModelAndView modelAndView);  }
@Test public void testPreHandle() { assertThat(subject.preHandle(requestWrapper, null, null)).isTrue(); StopWatch localStopWatch = (StopWatch) requestWrapper.getAttribute(STOP_WATCH); assertThat(localStopWatch).isNotNull(); }