mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 07:40:55 +03:00
Fixed some codacy warnings
This commit is contained in:
@@ -15,16 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package com.hierynomus.sshj;
|
package com.hierynomus.sshj;
|
||||||
|
|
||||||
import net.schmizz.sshj.DefaultConfig;
|
import java.io.File;
|
||||||
import net.schmizz.sshj.SSHClient;
|
import java.io.IOException;
|
||||||
import net.schmizz.sshj.transport.verification.OpenSSHKnownHosts;
|
|
||||||
import com.hierynomus.sshj.userauth.keyprovider.OpenSSHKeyV1KeyFile;
|
|
||||||
|
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import net.schmizz.sshj.DefaultConfig;
|
||||||
import java.io.IOException;
|
import net.schmizz.sshj.SSHClient;
|
||||||
|
import net.schmizz.sshj.transport.verification.OpenSSHKnownHosts;
|
||||||
|
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
|
|
||||||
@@ -35,8 +33,6 @@ public class IntegrationTest {
|
|||||||
SSHClient sshClient = new SSHClient(new DefaultConfig());
|
SSHClient sshClient = new SSHClient(new DefaultConfig());
|
||||||
sshClient.addHostKeyVerifier(new OpenSSHKnownHosts(new File("/Users/ajvanerp/.ssh/known_hosts")));
|
sshClient.addHostKeyVerifier(new OpenSSHKnownHosts(new File("/Users/ajvanerp/.ssh/known_hosts")));
|
||||||
sshClient.connect("172.16.37.147");
|
sshClient.connect("172.16.37.147");
|
||||||
// OpenSSHKeyV1KeyFile openSSHKeyV1KeyFile = new OpenSSHKeyV1KeyFile();
|
|
||||||
// openSSHKeyV1KeyFile.init(new File("/Users/ajvanerp/.ssh/id_ed25519"));
|
|
||||||
sshClient.authPublickey("jeroen");
|
sshClient.authPublickey("jeroen");
|
||||||
assertThat("Is connected", sshClient.isAuthenticated());
|
assertThat("Is connected", sshClient.isAuthenticated());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ public class OpenSSHKeyFileTest {
|
|||||||
public void shouldLoadED25519PrivateKey() throws IOException {
|
public void shouldLoadED25519PrivateKey() throws IOException {
|
||||||
OpenSSHKeyV1KeyFile keyFile = new OpenSSHKeyV1KeyFile();
|
OpenSSHKeyV1KeyFile keyFile = new OpenSSHKeyV1KeyFile();
|
||||||
keyFile.init(new File("src/test/resources/keytypes/test_ed25519"));
|
keyFile.init(new File("src/test/resources/keytypes/test_ed25519"));
|
||||||
String expected = "256 MD5:d3:5e:40:72:db:08:f1:6d:0c:d7:6d:35:0d:ba:7c:32 root@sshj (ED25519)\n";
|
|
||||||
PrivateKey aPrivate = keyFile.getPrivate();
|
PrivateKey aPrivate = keyFile.getPrivate();
|
||||||
assertThat(aPrivate.getAlgorithm(), equalTo("EdDSA"));
|
assertThat(aPrivate.getAlgorithm(), equalTo("EdDSA"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user