@Override
  public void afterCompletion(
    HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
    Object span = request.getAttribute(SpanCustomizer.class.getName());
    if (span instanceof SpanCustomizer) {
      setErrorAttribute(request, ex);
      setHttpRouteAttribute(request);
    }
  }
@Test void afterCompletion_addsHttpRouteAttribute() {
    when(request.getAttribute("brave.SpanCustomizer")).thenReturn(span);
    when(request.getAttribute(BEST_MATCHING_PATTERN_ATTRIBUTE)).thenReturn("/items/{itemId}");

    interceptor.afterCompletion(request, response, controller, null);

    verify(request).getAttribute("brave.SpanCustomizer");
    verify(request).getAttribute(BEST_MATCHING_PATTERN_ATTRIBUTE);
    verify(request).setAttribute("http.route", "/items/{itemId}");

    verifyNoMoreInteractions(request, response, parser, span);
  }