@Test(expected = RecordNotFoundException.class) public void testFindByUuid_invalid_uuid() { val actualDetector = serviceUnderTest.findByUuid(UUID.randomUUID().toString()); assertNotNull(actualDetector); }
@Override public Detector findByUuid(String uuid) { Detector detector = repository.findByUuid(uuid); if (detector == null) { throw new RecordNotFoundException("Invalid UUID: " + uuid); } return detector; }
DetectorServiceImpl implements DetectorService { @Override public Detector findByUuid(String uuid) { Detector detector = repository.findByUuid(uuid); if (detector == null) { throw new RecordNotFoundException("Invalid UUID: " + uuid); } return detector; } }
DetectorServiceImpl implements DetectorService { @Override public Detector findByUuid(String uuid) { Detector detector = repository.findByUuid(uuid); if (detector == null) { throw new RecordNotFoundException("Invalid UUID: " + uuid); } return detector; }  }
DetectorServiceImpl implements DetectorService { @Override public Detector findByUuid(String uuid) { Detector detector = repository.findByUuid(uuid); if (detector == null) { throw new RecordNotFoundException("Invalid UUID: " + uuid); } return detector; }  @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 Detector findByUuid(String uuid) { Detector detector = repository.findByUuid(uuid); if (detector == null) { throw new RecordNotFoundException("Invalid UUID: " + uuid); } return detector; }  @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);  }