From 0efe21e2e6abba4bc4292fb2743e7ddab68a99b4 Mon Sep 17 00:00:00 2001 From: Prarthona Paul Date: Wed, 24 May 2023 15:16:30 -0400 Subject: [PATCH] [ELY-2558] Update assertions in OpenSSHKeyParserTest --- .../wildfly/security/auth/client/OpenSSHKeysParserTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/client/src/test/java/org/wildfly/security/auth/client/OpenSSHKeysParserTest.java b/auth/client/src/test/java/org/wildfly/security/auth/client/OpenSSHKeysParserTest.java index c92740f5c51..9cebc1f05c6 100644 --- a/auth/client/src/test/java/org/wildfly/security/auth/client/OpenSSHKeysParserTest.java +++ b/auth/client/src/test/java/org/wildfly/security/auth/client/OpenSSHKeysParserTest.java @@ -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)); @@ -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));