diff --git a/files-sftp-fs/src/test/java/org/apache/sshd/fs/test/SFTPFileSystemTest.java b/files-sftp-fs/src/test/java/org/apache/sshd/fs/test/SFTPFileSystemTest.java index 70e09fc..b1acb68 100644 --- a/files-sftp-fs/src/test/java/org/apache/sshd/fs/test/SFTPFileSystemTest.java +++ b/files-sftp-fs/src/test/java/org/apache/sshd/fs/test/SFTPFileSystemTest.java @@ -39,7 +39,7 @@ public class SFTPFileSystemTest { env.put("username", "joerg"); URI uri = URI.create("sftp://xbib.org"); SshClient sshClient = ClientBuilder.builder().build(); - Path privateKey = Paths.get("/Users/joerg/.ssh/id_ed25519"); + Path privateKey = Paths.get(System.getProperty("user.home") + "/.ssh/id_ed25519"); KeyPairProvider keyPairProvider = new FileKeyPairProvider(privateKey); keyPairProvider.loadKeys(null).forEach(sshClient::addPublicKeyIdentity); for (String keyType : keyPairProvider.getKeyTypes(null)) { @@ -50,6 +50,7 @@ public class SFTPFileSystemTest { sshClient.setNioWorkers(1); sshClient.start(); SftpFileSystem fileSystem = new SftpFileSystemProvider(sshClient).newFileSystem(uri, env); + fileSystem.close(); // ... sshClient.stop(); }