@Test void testExecute() throws FileStorageException { cleaner.execute(EXPIRATION_TIME); verify(fileService).deleteModifiedBefore(EXPIRATION_TIME); }
@Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.DELETED_FILES_0, removedOldFilesCount)); } catch (FileStorageException e) { throw new SLException(e, Messages.COULD_NOT_DELETE_FILES_MODIFIED_BEFORE_0, expirationTime); } }
FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.DELETED_FILES_0, removedOldFilesCount)); } catch (FileStorageException e) { throw new SLException(e, Messages.COULD_NOT_DELETE_FILES_MODIFIED_BEFORE_0, expirationTime); } } }
FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.DELETED_FILES_0, removedOldFilesCount)); } catch (FileStorageException e) { throw new SLException(e, Messages.COULD_NOT_DELETE_FILES_MODIFIED_BEFORE_0, expirationTime); } } @Inject  FilesCleaner(FileService fileService); }
FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.DELETED_FILES_0, removedOldFilesCount)); } catch (FileStorageException e) { throw new SLException(e, Messages.COULD_NOT_DELETE_FILES_MODIFIED_BEFORE_0, expirationTime); } } @Inject  FilesCleaner(FileService fileService); @Override void execute(Date expirationTime); }
FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.DELETED_FILES_0, removedOldFilesCount)); } catch (FileStorageException e) { throw new SLException(e, Messages.COULD_NOT_DELETE_FILES_MODIFIED_BEFORE_0, expirationTime); } } @Inject  FilesCleaner(FileService fileService); @Override void execute(Date expirationTime);  }