public ApolloAuditSpan getActiveSpan() {
    ApolloAuditSpan activeSpan = getActiveSpanFromContext();
    if (activeSpan != null) {
      return activeSpan;
    }
    activeSpan = getActiveSpanFromHttp();
    // might be null, root span generate should be done in other place
    return activeSpan;
  }
@Test
  public void testGetActiveSpanFromHttpRequestCaseInRequestThread() {
    final String httpParentId = "100010002";
    final String httpFollowsFromId = "100010003";
    {
      // no span would be in context
      Mockito.when(manager.activeSpan()).thenReturn(null);
      // in request thread
      HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
      RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
      Mockito.when(request.getHeader(Mockito.eq(ApolloAuditConstants.TRACE_ID)))
          .thenReturn(activeTraceId);
      Mockito.when(request.getHeader(Mockito.eq(ApolloAuditConstants.SPAN_ID)))
          .thenReturn(activeSpanId);
      Mockito.when(request.getHeader(Mockito.eq(ApolloAuditConstants.OPERATOR)))
          .thenReturn(operator);
      Mockito.when(request.getHeader(Mockito.eq(ApolloAuditConstants.PARENT_ID)))
          .thenReturn(httpParentId);
      Mockito.when(request.getHeader(Mockito.eq(ApolloAuditConstants.FOLLOWS_FROM_ID)))
          .thenReturn(httpFollowsFromId);
    }
    ApolloAuditSpan get = tracer.getActiveSpan();
    assertEquals(activeTraceId, get.traceId());
    assertEquals(activeSpanId, get.spanId());
    assertEquals(operator, get.operator());
    assertEquals(httpParentId, get.parentId());
    assertEquals(httpFollowsFromId, get.followsFromId());

    assertNull(get.getOpType());
    assertNull(get.getOpName());
  }