DefaultDetectorSource implements DetectorSource { @Override public List<UUID> findUpdatedDetectors(long timePeriod) { isTrue(timePeriod > 0, "Required: timePeriod > 0"); return client .findUpdatedDetectorDocuments(timePeriod) .stream() .map(document -> document.getUuid()) .collect(Collectors.toList()); }  @Override DetectorMatchResponse findDetectorMappings(List<Map<String, String>> metricTags); @Override List<DetectorMapping> findUpdatedDetectorMappings(long timePeriod); @Override DetectorMapping findDetectorMappingByUuid(UUID uuid); @Override DetectorContainer findDetector(UUID uuid); @Override List<UUID> findUpdatedDetectors(long timePeriod); @Override void updatedDetectorLastUsed(UUID uuid);  }
@Test public void testFindUpdatedDetectors() { val results = sourceUnderTest.findUpdatedDetectors(1); assertEquals(1, results.size()); }
@Test(expected = IllegalArgumentException.class) public void testFindUpdatedDetectors_invalidTimePeriod() { sourceUnderTest.findUpdatedDetectors(0); }