I would like to write a JUnit method that can test the functionality of the SFTP function shown below. It is supposed to transfer the file specified by srcDir to destDir using JSch APIs.
My initial thoughts were to have the mock SFTP happen entirely on my local machine. I tried to use "localhost" (as sftpHost), "remote-username" (as sftpUser), and port 22 (as sftpPort). I set the encryption as false since I am not interested in testing that part yet. This led to the following error: com.jcraft.jsch.JSchException: Auth fail
public void sftpSendFile(String sftpHost, String sftpUser, int sftpPort, String privateKeyPath, String srcDir, String destDir, boolean isEncrypted)
Any ideas on how to fix my current approach or on a better way to test SFTP would be greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire