From 0e09156be7bf43fcad2fe134c4ffa70a7e90c0ec Mon Sep 17 00:00:00 2001 From: Deepali Kasture Date: Fri, 22 Sep 2023 18:35:35 -0400 Subject: [PATCH] ELY-2623:Add a new test methods testing that the verifyEvidence method of identity obtained from DistributedSecurityRealm --- .../auth/realm/DistributedSecurityRealmTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/base/src/test/java/org/wildfly/security/auth/realm/DistributedSecurityRealmTest.java b/tests/base/src/test/java/org/wildfly/security/auth/realm/DistributedSecurityRealmTest.java index 1e0001c20bc..1a1abbe686b 100644 --- a/tests/base/src/test/java/org/wildfly/security/auth/realm/DistributedSecurityRealmTest.java +++ b/tests/base/src/test/java/org/wildfly/security/auth/realm/DistributedSecurityRealmTest.java @@ -133,6 +133,16 @@ public void testExistingIdentity3() throws Exception { identity.dispose(); } + @Test + public void testVerifyEvidence() throws Exception { + + RealmIdentity identity = realm.getRealmIdentity(new NamePrincipal("user1")); + Assert.assertTrue(identity.verifyEvidence(new PasswordGuessEvidence(pass1))); + Assert.assertFalse(identity.verifyEvidence(new PasswordGuessEvidence(pass2))); + Assert.assertFalse(identity.verifyEvidence(new PasswordGuessEvidence(pass3))); + identity.dispose(); + } + @Test public void testEvidence() throws Exception { RealmIdentity identity = realm.getRealmIdentity(new SimpleEvidence("evidenceUser", true));