@Test public void doExecute_ShouldThrowException_IfInputDirIsInexistent() throws Exception { assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> subject.retrieveFiles()); }
@Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } @Inject  MediaScanServiceImpl(MediaScanConfig scanConfig,
                         Provider<FileScanner> scannerProvider); }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } @Inject  MediaScanServiceImpl(MediaScanConfig scanConfig,
                         Provider<FileScanner> scannerProvider); @Override Map<Path, List<Media>> retrieveFiles(); @Override List<Media> retrieveFilesAsList(); }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } @Inject  MediaScanServiceImpl(MediaScanConfig scanConfig,
                         Provider<FileScanner> scannerProvider); @Override Map<Path, List<Media>> retrieveFiles(); @Override List<Media> retrieveFilesAsList();  }