@Test
public void testSpanCreation() throws Exception {

  when(request.getRequestURI()).thenReturn("/index");
  when(response.getStatus()).thenReturn(200);
  ArgumentCaptor<Labels> labelsArgument = ArgumentCaptor.forClass(Labels.class);
  ArgumentCaptor<TraceContext> traceArgument = ArgumentCaptor.forClass(TraceContext.class);
  Label indexLabel = new Label(HttpLabels.HTTP_URL.getValue(), "/index");
  Label statusCodeLabel = new Label(HttpLabels.HTTP_STATUS_CODE.getValue(), "200");
  valve.invoke(request, response);
  verify(tracer).startSpan(matches("/index"));
  verify(tracer).annotateSpan(traceArgument.capture(), labelsArgument.capture());
  verify(tracer).endSpan(traceContext);
  assertEquals(labelsArgument.getValue().getLabels().size(), 2);
  assertTrue(labelsArgument.getValue().getLabels().contains(indexLabel));
  assertTrue(labelsArgument.getValue().getLabels().contains(statusCodeLabel));
}