@Test
public void detectorCacheUpdateTest() {

    DetectorMapping disabledDetectorMapping = new DetectorMapping().setDetector(buildDetector("cid", "2c49ba26-1a7d-43f4-b70c-c6644a2c1689")).setEnabled(false);
    DetectorMapping modifiedDetectorMapping = new DetectorMapping().setDetector(buildDetector("cid", "4d49ba26-1a7d-43f4-b70c-ee644a2c1689")).setEnabled(true);
    List<DetectorMapping> updateDetectorMappings = Arrays.asList(disabledDetectorMapping, modifiedDetectorMapping);
    when(detectorSource.findUpdatedDetectorMappings(60)).thenReturn(updateDetectorMappings);
    doAnswer((e) -> null).when(cache).removeDisabledDetectorMappings(anyList());
    doAnswer((e) -> null).when(cache).invalidateMetricsWithOldDetectorMappings(anyList());
    detectorMapper.detectorMappingCacheSync(System.currentTimeMillis() + 60000);
    verify(cache).removeDisabledDetectorMappings(Collections.singletonList(disabledDetectorMapping));
    verify(cache).invalidateMetricsWithOldDetectorMappings(Collections.singletonList(modifiedDetectorMapping));
}