@Test public void testGetDetectorsToBeTrained() { serviceUnderTest.getDetectorsToBeTrained(1595152176000L); verify(repository, times(1)).findByDetectorConfig_TrainingMetaData_DateTrainingNextRunLessThan(anyString()); }
@Override public List<Detector> getDetectorsToBeTrained(long timestampMs) { val trainInstant = Instant.ofEpochMilli(timestampMs); val date = DateUtil.toUtcDateString(trainInstant); return repository.findByDetectorConfig_TrainingMetaData_DateTrainingNextRunLessThan(date); }
DetectorServiceImpl implements DetectorService { @Override public List<Detector> getDetectorsToBeTrained(long timestampMs) { val trainInstant = Instant.ofEpochMilli(timestampMs); val date = DateUtil.toUtcDateString(trainInstant); return repository.findByDetectorConfig_TrainingMetaData_DateTrainingNextRunLessThan(date); } }
DetectorServiceImpl implements DetectorService { @Override public List<Detector> getDetectorsToBeTrained(long timestampMs) { val trainInstant = Instant.ofEpochMilli(timestampMs); val date = DateUtil.toUtcDateString(trainInstant); return repository.findByDetectorConfig_TrainingMetaData_DateTrainingNextRunLessThan(date); }  }
DetectorServiceImpl implements DetectorService { @Override public List<Detector> getDetectorsToBeTrained(long timestampMs) { val trainInstant = Instant.ofEpochMilli(timestampMs); val date = DateUtil.toUtcDateString(trainInstant); return repository.findByDetectorConfig_TrainingMetaData_DateTrainingNextRunLessThan(date); }  @Override UUID createDetector(Detector detector); @Override Detector findByUuid(String uuid); @Override List<Detector> findByCreatedBy(String user); @Override void toggleDetector(String uuid, Boolean enabled); @Override void trustDetector(String uuid, Boolean trusted); @Override List<Detector> getLastUpdatedDetectors(long interval); @Override List<Detector> getLastUsedDetectors(int noOfDays); @Override List<Detector> getDetectorsToBeTrained(long timestampMs); @Override void updateDetector(String uuid, Detector detector); @Override void updateDetectorLastUsed(String uuid); @Override void updateDetectorTrainingTime(String uuid, long nextRun); @Override void deleteDetector(String uuid); }
DetectorServiceImpl implements DetectorService { @Override public List<Detector> getDetectorsToBeTrained(long timestampMs) { val trainInstant = Instant.ofEpochMilli(timestampMs); val date = DateUtil.toUtcDateString(trainInstant); return repository.findByDetectorConfig_TrainingMetaData_DateTrainingNextRunLessThan(date); }  @Override UUID createDetector(Detector detector); @Override Detector findByUuid(String uuid); @Override List<Detector> findByCreatedBy(String user); @Override void toggleDetector(String uuid, Boolean enabled); @Override void trustDetector(String uuid, Boolean trusted); @Override List<Detector> getLastUpdatedDetectors(long interval); @Override List<Detector> getLastUsedDetectors(int noOfDays); @Override List<Detector> getDetectorsToBeTrained(long timestampMs); @Override void updateDetector(String uuid, Detector detector); @Override void updateDetectorLastUsed(String uuid); @Override void updateDetectorTrainingTime(String uuid, long nextRun); @Override void deleteDetector(String uuid);  }