[java-identity-provider] branch main updated: Fix failing tests due to stronger ID enforcement.
Scott Cantor
cantor.2 at osu.edu
Fri Feb 21 21:02:36 UTC 2025
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=3f0eee6aec6bd0f61432d5dc4ca50c4ef3fe9390
The following commit(s) were added to refs/heads/main by this push:
new 3f0eee6ae Fix failing tests due to stronger ID enforcement.
3f0eee6ae is described below
commit 3f0eee6aec6bd0f61432d5dc4ca50c4ef3fe9390
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Feb 21 16:02:33 2025 -0500
Fix failing tests due to stronger ID enforcement.
---
.../PopulateSubjectCanonicalizationContextTest.java | 11 +++++++----
.../impl/SelectSubjectCanonicalizationFlowTest.java | 19 +++----------------
.../SubjectCanonicalizationFlowDescriptorTest.java | 8 ++++----
3 files changed, 14 insertions(+), 24 deletions(-)
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java
index 82d7c3d32..dd6505441 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java
@@ -47,9 +47,12 @@ public class PopulateSubjectCanonicalizationContextTest {
c14nFlows = List.of(new SubjectCanonicalizationFlowDescriptor(),
new SubjectCanonicalizationFlowDescriptor(), new SubjectCanonicalizationFlowDescriptor());
- c14nFlows.get(0).setId("test1");
- c14nFlows.get(1).setId("test2");
- c14nFlows.get(2).setId("test3");
+ c14nFlows.get(0).setId("c14n/test1");
+ c14nFlows.get(1).setId("c14n/test2");
+ c14nFlows.get(2).setId("c14n/test3");
+ for (final var flow : c14nFlows) {
+ flow.initialize();
+ }
final PopulateSubjectCanonicalizationContext action = new PopulateSubjectCanonicalizationContext();
action.setAvailableFlows(c14nFlows);
@@ -70,6 +73,6 @@ public class PopulateSubjectCanonicalizationContextTest {
assert c14nCtx!=null;
Assert.assertEquals(c14nCtx.getPotentialFlows().size(), 3);
- Assert.assertNotNull(c14nCtx.getPotentialFlows().get("test1"));
+ Assert.assertNotNull(c14nCtx.getPotentialFlows().get("c14n/test1"));
}
}
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectSubjectCanonicalizationFlowTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectSubjectCanonicalizationFlowTest.java
index 18abbf1ff..713dae5ed 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectSubjectCanonicalizationFlowTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectSubjectCanonicalizationFlowTest.java
@@ -14,7 +14,6 @@
package net.shibboleth.idp.authn.impl;
-import org.opensaml.profile.context.ProfileRequestContext;
import org.springframework.webflow.execution.Event;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
@@ -22,7 +21,6 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor;
import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
-import net.shibboleth.shared.logic.PredicateSupport;
/** {@link SelectSubjectCanonicalizationFlow} unit test. */
@SuppressWarnings("javadoc")
@@ -49,29 +47,18 @@ public class SelectSubjectCanonicalizationFlowTest extends PopulateSubjectCanoni
final SubjectCanonicalizationFlowDescriptor flow = c14nCtx.getAttemptedFlow();
assert flow != null;
Assert.assertEquals(c14nCtx.getAttemptedFlow(), c14nCtx.getPotentialFlows().get(event.getId()));
- Assert.assertEquals(flow.getId(), "test1");
+ Assert.assertEquals(flow.getId(), "c14n/test1");
}
@Test public void testIntermediate() {
- c14nCtx.getIntermediateFlows().put("test1", c14nCtx.getPotentialFlows().get("test1"));
+ c14nCtx.getIntermediateFlows().put("c14n/test1", c14nCtx.getPotentialFlows().get("c14n/test1"));
final Event event = action.execute(src);
final SubjectCanonicalizationFlowDescriptor flow = c14nCtx.getAttemptedFlow();
assert flow != null && event != null;
Assert.assertEquals(c14nCtx.getAttemptedFlow(), c14nCtx.getPotentialFlows().get(event.getId()));
- Assert.assertEquals(flow.getId(), "test2");
- }
-
- @Test public void testPredicate() {
- c14nCtx.getPotentialFlows().get("test1").setActivationCondition(PredicateSupport.<ProfileRequestContext>alwaysFalse());
-
- final Event event = action.execute(src);
- final SubjectCanonicalizationFlowDescriptor flow = c14nCtx.getAttemptedFlow();
- assert flow != null && event != null;
-
- Assert.assertEquals(c14nCtx.getAttemptedFlow(), c14nCtx.getPotentialFlows().get(event.getId()));
- Assert.assertEquals(flow.getId(), "test2");
+ Assert.assertEquals(flow.getId(), "c14n/test2");
}
}
\ No newline at end of file
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/tests/SubjectCanonicalizationFlowDescriptorTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/tests/SubjectCanonicalizationFlowDescriptorTest.java
index adc2d6bbe..4809d09f8 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/tests/SubjectCanonicalizationFlowDescriptorTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/tests/SubjectCanonicalizationFlowDescriptorTest.java
@@ -39,7 +39,7 @@ public class SubjectCanonicalizationFlowDescriptorTest {
@BeforeMethod public void setUp() throws ComponentInitializationException {
descriptor = new SubjectCanonicalizationFlowDescriptor();
- descriptor.setId("test");
+ descriptor.setId("c14n/test");
descriptor.initialize();
src = new RequestContextBuilder().buildRequestContext();
@@ -62,17 +62,17 @@ public class SubjectCanonicalizationFlowDescriptorTest {
@Test public void testEquality() {
final SubjectCanonicalizationFlowDescriptor sameId = new SubjectCanonicalizationFlowDescriptor();
- sameId.setId("test");
+ sameId.setId("c14n/test");
Assert.assertTrue(descriptor.equals(sameId));
final SubjectCanonicalizationFlowDescriptor differentId = new SubjectCanonicalizationFlowDescriptor();
- differentId.setId("differentId");
+ differentId.setId("c14n/differentId");
Assert.assertFalse(descriptor.equals(differentId));
}
@Test public void testPredicate() throws ComponentInitializationException {
descriptor = new SubjectCanonicalizationFlowDescriptor();
- descriptor.setId("test");
+ descriptor.setId("c14n/test");
descriptor.setActivationCondition(PredicateSupport.alwaysFalse());
descriptor.initialize();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list