@Override
  public List<ApolloAuditLogDetailsDTO> queryTraceDetails(String traceId) {
    List<ApolloAuditLogDetailsDTO> detailsDTOList = new ArrayList<>();
    logService.findByTraceId(traceId).forEach(log -> {
      detailsDTOList.add(new ApolloAuditLogDetailsDTO(ApolloAuditUtil.logToDTO(log),
          ApolloAuditUtil.dataInfluenceListToDTOList(
              dataInfluenceService.findBySpanId(log.getSpanId()))));
    });
    return detailsDTOList;
  }
@Test
  public void testQueryTraceDetails() {
    final String traceId = "query-trace-id";
    final int traceDetailsLength = 3;
    final int dataInfluenceOfEachLog = 3;
    {
      List<ApolloAuditLog> logList = MockBeanFactory.mockAuditLogListByLength(traceDetailsLength);
      Mockito.when(logService.findByTraceId(Mockito.eq(traceId)))
          .thenReturn(logList);
      List<ApolloAuditLogDataInfluence> dataInfluenceList =
          MockBeanFactory.mockDataInfluenceListByLength(dataInfluenceOfEachLog);
      Mockito.when(dataInfluenceService.findBySpanId(Mockito.any()))
          .thenReturn(dataInfluenceList);
    }

    List<ApolloAuditLogDetailsDTO> detailsDTOList = api.queryTraceDetails(traceId);

    Mockito.verify(logService, Mockito.times(1))
        .findByTraceId(Mockito.eq(traceId));
    Mockito.verify(dataInfluenceService, Mockito.times(3))
        .findBySpanId(Mockito.any());

    assertEquals(traceDetailsLength, detailsDTOList.size());
    assertEquals(dataInfluenceOfEachLog, detailsDTOList.get(0).getDataInfluenceDTOList().size());
  }