@Test public void getBackups() { List<BackupFile> backups = backupService.getBackupFiles(); assertEquals(2, backups.size()); assertEquals(BACKUP_FILE_1_NAME, backups.get(0).getFilename()); assertEquals(BACKUP_FILE_1_CREATED_AT, backups.get(0).getCreatedAt().toString()); assertEquals(BACKUP_FILE_2_NAME, backups.get(1).getFilename()); assertEquals(BACKUP_FILE_2_CREATED_AT, backups.get(1).getCreatedAt().toString()); }
public List<BackupFile> getBackupFiles() { List<File> files = backupRepository.getBackupFiles(); List<BackupFile> backupFiles = new ArrayList<>(); files.stream().forEach(b -> backupFiles.add(new BackupFile(b.getName()))); setCreatedAt(backupFiles); return backupFiles; }
BackupService { public List<BackupFile> getBackupFiles() { List<File> files = backupRepository.getBackupFiles(); List<BackupFile> backupFiles = new ArrayList<>(); files.stream().forEach(b -> backupFiles.add(new BackupFile(b.getName()))); setCreatedAt(backupFiles); return backupFiles; } }
BackupService { public List<BackupFile> getBackupFiles() { List<File> files = backupRepository.getBackupFiles(); List<BackupFile> backupFiles = new ArrayList<>(); files.stream().forEach(b -> backupFiles.add(new BackupFile(b.getName()))); setCreatedAt(backupFiles); return backupFiles; } @Autowired  BackupService(BackupRepository backupRepository, ServerConfService serverConfService,
            ExternalProcessRunner externalProcessRunner,
            @Value("${script.generate-backup.path}") String generateBackupScriptPath,
            AuditDataHelper auditDataHelper); }
BackupService { public List<BackupFile> getBackupFiles() { List<File> files = backupRepository.getBackupFiles(); List<BackupFile> backupFiles = new ArrayList<>(); files.stream().forEach(b -> backupFiles.add(new BackupFile(b.getName()))); setCreatedAt(backupFiles); return backupFiles; } @Autowired  BackupService(BackupRepository backupRepository, ServerConfService serverConfService,
            ExternalProcessRunner externalProcessRunner,
            @Value("${script.generate-backup.path}") String generateBackupScriptPath,
            AuditDataHelper auditDataHelper); List<BackupFile> getBackupFiles(); void deleteBackup(String filename); byte[] readBackupFile(String filename); BackupFile generateBackup(); BackupFile uploadBackup(Boolean ignoreWarnings, String filename, byte[] fileBytes); String generateBackupFileName(); }
BackupService { public List<BackupFile> getBackupFiles() { List<File> files = backupRepository.getBackupFiles(); List<BackupFile> backupFiles = new ArrayList<>(); files.stream().forEach(b -> backupFiles.add(new BackupFile(b.getName()))); setCreatedAt(backupFiles); return backupFiles; } @Autowired  BackupService(BackupRepository backupRepository, ServerConfService serverConfService,
            ExternalProcessRunner externalProcessRunner,
            @Value("${script.generate-backup.path}") String generateBackupScriptPath,
            AuditDataHelper auditDataHelper); List<BackupFile> getBackupFiles(); void deleteBackup(String filename); byte[] readBackupFile(String filename); BackupFile generateBackup(); BackupFile uploadBackup(Boolean ignoreWarnings, String filename, byte[] fileBytes); String generateBackupFileName();  }