Skip to content

Commit

Permalink
Merge pull request #1907 from PrarthonaPaul/ELY-2558
Browse files Browse the repository at this point in the history
Ely-2558 Update assertions in OpenSSHKeyParserTest
  • Loading branch information
Skyllarr authored May 26, 2023
2 parents 7dad158 + 0efe21e commit 793e498
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public void testOpenSSHCredentialDefaultParsing() throws Exception {
Assert.assertNotNull(node);
SSHCredential credential = node.getConfiguration().getCredentialSource().getCredential(SSHCredential.class);
Assert.assertEquals(SSHCredential.DEFAULT_SSH_DIRECTORY, credential.getSshDirectory());
Assert.assertTrue(credential.getPrivateKeyIdentities().length == SSHCredential.DEFAULT_PRIVATE_KEYS.length);
Assert.assertEquals(SSHCredential.DEFAULT_PRIVATE_KEYS.length, credential.getPrivateKeyIdentities().length);
Assert.assertEquals(SSHCredential.DEFAULT_PRIVATE_KEYS[0], credential.getPrivateKeyIdentities()[0]);
Assert.assertEquals(SSHCredential.DEFAULT_KNOWN_HOSTS, credential.getKnownHostsFile());
String password = new String(credential.getPassphrase().castAndApply(PasswordCredential.class, c -> c.getPassword()).castAndApply(ClearPassword.class, ClearPassword::getPassword));
Expand All @@ -246,7 +246,7 @@ public void testOpenSSHCredentialParsing() throws Exception {
Assert.assertNotNull(node);
SSHCredential credential = node.getConfiguration().getCredentialSource().getCredential(SSHCredential.class);
Assert.assertEquals(Paths.get("user", "home","test", ".ssh").toFile().getName(), credential.getSshDirectory().getName());
Assert.assertTrue(credential.getPrivateKeyIdentities().length == 1);
Assert.assertEquals(1, credential.getPrivateKeyIdentities().length);
Assert.assertEquals("id_test_ecdsa", credential.getPrivateKeyIdentities()[0]);
Assert.assertEquals("known_hosts_test", credential.getKnownHostsFile());
String password = new String(credential.getPassphrase().castAndApply(PasswordCredential.class, c -> c.getPassword()).castAndApply(ClearPassword.class, ClearPassword::getPassword));
Expand Down

0 comments on commit 793e498

Please sign in to comment.