mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix toBean
This commit is contained in:
@@ -157,7 +157,7 @@ public class JschUtil {
|
||||
*/
|
||||
public static Session createSession(String sshHost, int sshPort, String sshUser, String privateKeyPath, byte[] passphrase) {
|
||||
Assert.notEmpty(sshHost, "SSH Host must be not empty!");
|
||||
Assert.isTrue(sshPort < 0, "SSH Host must be not empty!");
|
||||
Assert.isTrue(sshPort > 0, "SSH port must be > 0");
|
||||
Assert.notEmpty(privateKeyPath, "PrivateKey Path must be not empty!");
|
||||
|
||||
// 默认root用户
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.extra.ssh;
|
||||
|
||||
import com.jcraft.jsch.JSch;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -61,4 +62,9 @@ public class JschUtilTest {
|
||||
|
||||
IoUtil.close(sftp);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSessionTest(){
|
||||
JschUtil.getSession("192.168.1.134", 22, "root", "aaa", null);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user