@GetMapping("/trace")
  @PreAuthorize(value = "@apolloAuditLogQueryApiPreAuthorizer.hasQueryPermission()")
  public List<ApolloAuditLogDetailsDTO> findTraceDetails(@RequestParam String traceId) {
    List<ApolloAuditLogDetailsDTO> detailsDTOList = api.queryTraceDetails(traceId);
    return detailsDTOList;
  }
@Test
  public void testFindTraceDetails() throws Exception {
    final String traceId = "query-trace-id";
    final int traceDetailsListLength = 3;
    {
      List<ApolloAuditLogDetailsDTO> mockDetailsDTOList = MockBeanFactory.mockTraceDetailsDTOListByLength(
          traceDetailsListLength);
      mockDetailsDTOList.forEach(e -> e.getLogDTO().setTraceId(traceId));
      Mockito.when(api.queryTraceDetails(Mockito.eq(traceId))).thenReturn(mockDetailsDTOList);
    }

    mockMvc.perform(MockMvcRequestBuilders.get("/apollo/audit/trace")
            .param("traceId", traceId))
        .andExpect(MockMvcResultMatchers.status().isOk())
        .andExpect(MockMvcResultMatchers.jsonPath("$").isArray())
        .andExpect(MockMvcResultMatchers.jsonPath("$.length()").value(traceDetailsListLength))
        .andExpect(MockMvcResultMatchers.jsonPath("$[0].logDTO.traceId").value(traceId));

    Mockito.verify(api, Mockito.times(1)).queryTraceDetails(Mockito.eq(traceId));
  }