TransactionTokenInterceptor implements HandlerInterceptor { @Override public void afterCompletion(final HttpServletRequest request, final HttpServletResponse response, final Object handler, final Exception ex) { logger.trace("afterCompletion"); if (ex != null) { TransactionTokenContextImpl tokenContext = (TransactionTokenContextImpl) request .getAttribute(TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME); if (tokenContext != null) { TransactionToken token = tokenContext.getReceivedToken(); removeToken(token); } } } TransactionTokenInterceptor();  TransactionTokenInterceptor(int sizePerTokenName);  TransactionTokenInterceptor(TokenStringGenerator generator,
            TransactionTokenInfoStore tokenInfoStore,
            TransactionTokenStore tokenStore); @Override boolean preHandle(final HttpServletRequest request,
            final HttpServletResponse response, final Object handler); @Override void postHandle(final HttpServletRequest request,
            final HttpServletResponse response, final Object handler,
            final ModelAndView modelAndView); @Override void afterCompletion(final HttpServletRequest request,
            final HttpServletResponse response, final Object handler,
            final Exception ex); static final String TOKEN_CONTEXT_REQUEST_ATTRIBUTE_NAME; static final String NEXT_TOKEN_REQUEST_ATTRIBUTE_NAME; static final String TOKEN_REQUEST_PARAMETER; }
@Test public void testAfterCompletionWithoutException() { try { interceptor.afterCompletion(request, response, null, null); } catch (Exception e) { fail(); } }
@Test public void testAfterCompletionWithExceptionHasNoTransactionTokenContextImpl() { try { interceptor.afterCompletion(request, response, null, new Exception()); } catch (Exception e) { fail(); } }