### Question:
BackupService { public void deleteBackup(String filename) throws BackupFileNotFoundException { auditDataHelper.putBackupFilename(backupRepository.getFilePath(filename)); if (!getBackup(filename).isPresent()) { throw new BackupFileNotFoundException(getFileNotFoundExceptionMessage(filename)); } backupRepository.deleteBackupFile(filename); } @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();  }### Answer:
@Test public void deleteBackup() throws BackupFileNotFoundException { backupService.deleteBackup(BACKUP_FILE_1_NAME); assertEquals(1, backupService.getBackupFiles().size()); }
@Test public void deleteNonExistingBackup() { try { backupService.deleteBackup("test_file.tar"); fail("should throw BackupFileNotFoundException"); } catch (BackupFileNotFoundException expected) { } }