@Test
public void testDetectorMappingSearch() {

    List<DetectorMapping> detectorMappings = mockDetectorMappingsList();
    SearchMappingsRequest searchMappingsRequest = new SearchMappingsRequest();
    searchMappingsRequest.setDetectorUuid(UUID.fromString(detectorUuid));
    searchMappingsRequest.setUserId(userVal);
    val testDetectorMappingSpanContext = new SpanContext(UUID.randomUUID(), UUID.randomUUID(),
            UUID.randomUUID());
    val testChildSpan = noOpsTracer.buildSpan("mappings-search").asChildOf(testDetectorMappingSpanContext).start();
    when(detectorMappingRepo.search(searchMappingsRequest)).thenReturn(detectorMappings);
    when(trace.extractParentSpan(httpHeaders)).thenReturn(testDetectorMappingSpanContext);
    when(trace.startSpan("mappings-search", testDetectorMappingSpanContext)).thenReturn(testChildSpan);
    List<DetectorMapping> detectorMappingsResponse = controllerUnderTest.searchDetectorMapping(searchMappingsRequest,
            httpHeaders);
    assertEquals(id, detectorMappingsResponse.get(0).getId());
    assertEquals(detectorUuid, detectorMappingsResponse.get(0).getDetector().getUuid().toString());
    assertEquals("test-user", detectorMappingsResponse.get(0).getUser().getId());
}