[java-plugin-shibd] branch main updated: Extend IdP property initializer to eliminate overlap.

Codeberg noreply at shibboleth.net
Fri Nov 21 13:47:14 UTC 2025


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-plugin-shibd.

View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/6d4c9ff1d60fcaf5653fcf6cf35475524154614c

The following commit(s) were added to refs/heads/main by this push:
     new 6d4c9ff  Extend IdP property initializer to eliminate overlap.
6d4c9ff is described below

commit 6d4c9ff1d60fcaf5653fcf6cf35475524154614c
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Nov 21 08:47:02 2025 -0500

    Extend IdP property initializer to eliminate overlap.
---
 ...SPEnvironmentApplicationContextInitializer.java | 29 +++-------------------
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/TestSPEnvironmentApplicationContextInitializer.java b/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/TestSPEnvironmentApplicationContextInitializer.java
index 2b09a6a..123fd1d 100644
--- a/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/TestSPEnvironmentApplicationContextInitializer.java
+++ b/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/TestSPEnvironmentApplicationContextInitializer.java
@@ -16,27 +16,15 @@ package net.shibboleth.sp.flows;
 
 import javax.annotation.Nonnull;
 
-import org.slf4j.Logger;
 import org.springframework.context.ApplicationContextInitializer;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.core.Ordered;
-import org.springframework.core.annotation.Order;
 import org.springframework.mock.env.MockPropertySource;
 
-import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.idp.test.TestEnvironmentApplicationContextInitializer;
 
 /**
- * An {@link ApplicationContextInitializer} which prepends properties.
- *
- * <p>This needs to include the original IdP-test-layer properties and has to be
- * set to {@link Ordered#LOWEST_PRECEDENCE} or things blow up.</p>
+ * An {@link ApplicationContextInitializer} which appends properties to the set used by the IdP flow tests.
  */
- at Order(Ordered.LOWEST_PRECEDENCE)
-public class TestSPEnvironmentApplicationContextInitializer
-        implements ApplicationContextInitializer<ConfigurableApplicationContext> {
-
-    /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(TestSPEnvironmentApplicationContextInitializer.class);
+public class TestSPEnvironmentApplicationContextInitializer extends TestEnvironmentApplicationContextInitializer {
     
     /**
      * Add properties for tests.
@@ -44,19 +32,10 @@ public class TestSPEnvironmentApplicationContextInitializer
      * @param mock property source
      */
     protected void addProperties(@Nonnull final MockPropertySource mock) {
-        mock.setProperty("idp.home", "classpath:/net/shibboleth/idp/module");
-        mock.setProperty("idp.webflows", "classpath*:/flows");
+        super.addProperties(mock);
         mock.setProperty("sp.storageService", "shibboleth.StorageService");
         mock.setProperty("idp.additionalProperties",
                 "/conf/ldap.properties, /conf/saml-nameid.properties, /conf/services.properties, /conf/admin/admin.properties, /conf/authn/authn.properties, /conf/c14n/subject-c14n.properties, /credentials/secrets.properties, /conf/sp/sp.properties");
     }
     
-    /** {@inheritDoc} */
-    @Override public void initialize(@Nonnull final ConfigurableApplicationContext applicationContext) {
-        final MockPropertySource mock = new MockPropertySource();
-        addProperties(mock);
-        applicationContext.getEnvironment().getPropertySources().addFirst(mock);
-        log.info("Prepending properties '{}'", mock.getSource());
-    }
-    
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list