public static DigipostBatchClientForTest start(Path tempDirectory) throws IOException { Path batchDir = Files.createDirectory(tempDirectory.resolve("batches")); Path sftpDir = Files.createDirectory(tempDirectory.resolve("sftp")); DigipostBatchClient digipostBatchClient = DigipostBatchClient.init() .withBatchesDirectory(batchDir) .withSftpAccount(new LocalSftpAccount(sftpDir)) .checkForNewBatches(5) .checkForReceipt(30) .start(); return new DigipostBatchClientForTest(digipostBatchClient, batchDir, sftpDir); }