[java-identity-provider] branch main updated: Pre-clean for annotations Use the new test class ConstantSupplier rather than an inline instantiation (which would require annotation

Rod Widdowson rdw at steadingsoftware.com
Thu Nov 24 16:18:55 UTC 2022


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

rdw 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=b6411056823b6127758e2b43873182200a7f7f19

The following commit(s) were added to refs/heads/main by this push:
     new b64110568 Pre-clean for annotations Use the new test class ConstantSupplier rather than an inline instantiation (which would require annotation
b64110568 is described below

commit b6411056823b6127758e2b43873182200a7f7f19
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Nov 24 16:14:44 2022 +0000

    Pre-clean for annotations
    Use the new test class ConstantSupplier rather than an inline
    instantiation (which would require annotation
---
 .../shibboleth/idp/admin/impl/DoStorageOperationTest.java   |  2 +-
 .../idp/authn/impl/HTPasswdCredentialValidatorTest.java     |  5 ++---
 .../idp/authn/impl/JAASCredentialValidatorTest.java         |  5 ++---
 .../idp/authn/impl/LDAPCredentialValidatorTest.java         |  5 ++---
 .../idp/authn/impl/PreserveAuthenticationFlowStateTest.java |  7 +++----
 .../authn/impl/StorageBackedAccountLockoutManagerTest.java  |  4 ++--
 .../shibboleth/idp/authn/impl/ValidateCredentialsTest.java  |  5 ++---
 .../idp/authn/impl/ValidateExternalAuthenticationTest.java  |  5 ++---
 .../shibboleth/idp/authn/impl/ValidateRemoteUserTest.java   |  5 ++---
 .../idp/authn/impl/ValidateUserAgentAddressTest.java        |  5 ++---
 .../authn/impl/X509CertificateCredentialValidatorTest.java  |  5 ++---
 .../idp/authn/proxy/impl/ExtractDiscoveryResponseTest.java  |  5 ++---
 .../idp/authn/spnego/impl/SPNEGOAutoLoginManagerTest.java   |  6 +++---
 idp-consent-impl/pom.xml                                    |  6 ++++++
 .../idp/consent/flow/impl/ConsentFlowDescriptorTest.java    |  2 --
 .../idp/consent/flow/impl/ExtractConsentTest.java           | 13 ++++++-------
 .../idp/profile/audit/impl/WriteAuditLogTest.java           |  3 ++-
 .../impl/AddAuthenticationStatementToAssertionTest.java     |  5 ++---
 .../impl/IdPInitiatedSSORequestMessageDecoderTest.java      |  5 ++---
 .../profile/impl/AddAuthnStatementToAssertionTest.java      |  5 ++---
 .../impl/IdPInitiatedSSORequestMessageDecoderTest.java      |  5 ++---
 .../impl/ProcessAssertionsForAuthenticationTest.java        |  8 +++-----
 22 files changed, 52 insertions(+), 64 deletions(-)

diff --git a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
index ceaa36f78..69b7d7f73 100644
--- a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
+++ b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
@@ -92,7 +92,7 @@ public class DoStorageOperationTest {
         
         action = new DoStorageOperation();
         action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
-        action.setHttpServletResponseSupplier(new NonnullSupplier<> () {public HttpServletResponse get() {return response;}});
+        action.setHttpServletResponseSupplier(new ConstantSupplier<>(response));
         action.setStorageService(storageService);
         action.setObjectMapper(mapper);
         action.initialize();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/HTPasswdCredentialValidatorTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/HTPasswdCredentialValidatorTest.java
index ddf8e9088..5b9a6e31c 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/HTPasswdCredentialValidatorTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/HTPasswdCredentialValidatorTest.java
@@ -34,7 +34,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.context.AuthenticationErrorContext;
@@ -46,7 +45,7 @@ import net.shibboleth.idp.authn.principal.impl.ExactPrincipalEvalPredicateFactor
 import net.shibboleth.idp.authn.testing.TestPrincipal;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** Unit test for htpasswd file validation. */
 public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTest {
@@ -73,7 +72,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
         action.setClassifiedMessages(mappings);
         
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
     }
 
     @Test public void testMissingFlow() throws ComponentInitializationException {
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/JAASCredentialValidatorTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/JAASCredentialValidatorTest.java
index 7dde69005..0192dac7e 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/JAASCredentialValidatorTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/JAASCredentialValidatorTest.java
@@ -41,7 +41,6 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.context.AuthenticationErrorContext;
@@ -55,7 +54,7 @@ import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.collection.Pair;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.net.URISupport;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 import net.shibboleth.shared.testing.InMemoryDirectory;
 
 /** Unit test for JAAS validation. */
@@ -109,7 +108,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
         action.setClassifiedMessages(mappings);
         
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
     }
 
     @Test public void testMissingFlow() throws ComponentInitializationException {
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/LDAPCredentialValidatorTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/LDAPCredentialValidatorTest.java
index 952c78f02..984127870 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/LDAPCredentialValidatorTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/LDAPCredentialValidatorTest.java
@@ -47,7 +47,6 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthenticationResult;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.TemplateSearchDnResolver;
@@ -60,7 +59,7 @@ import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.idp.authn.principal.UsernamePrincipal;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 import net.shibboleth.shared.testing.InMemoryDirectory;
 import net.shibboleth.shared.testing.VelocityEngine;
 
@@ -134,7 +133,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
         mappings.put("ExpiredPassword", Arrays.asList("PASSWORD_EXPIRED", "CHANGE_AFTER_RESET"));
         action.setClassifiedMessages(mappings);
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
     }
 
     @Test public void testMissingFlow() throws ComponentInitializationException {
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PreserveAuthenticationFlowStateTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PreserveAuthenticationFlowStateTest.java
index 8dc10c585..752a5ec6c 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PreserveAuthenticationFlowStateTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PreserveAuthenticationFlowStateTest.java
@@ -26,12 +26,11 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link PreserveAuthenticationFlowState} unit test. */
 public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationContextTest {
@@ -43,7 +42,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
         
         action = new PreserveAuthenticationFlowState();
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.setParameterNames(Arrays.asList("foo", "foo2"));
         action.initialize();
     }
@@ -61,7 +60,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
     @Test public void testNoParameters() throws ComponentInitializationException {
         action = new PreserveAuthenticationFlowState();
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
         
         final Event event = action.execute(src);
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/StorageBackedAccountLockoutManagerTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/StorageBackedAccountLockoutManagerTest.java
index 3d404c4b8..3e814eec4 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/StorageBackedAccountLockoutManagerTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/StorageBackedAccountLockoutManagerTest.java
@@ -32,7 +32,7 @@ import net.shibboleth.idp.authn.context.UsernamePasswordContext;
 import net.shibboleth.idp.authn.impl.StorageBackedAccountLockoutManager.UsernameIPLockoutKeyStrategy;
 import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link StorageBackedAccountLockoutManager} unit test. */
 public class StorageBackedAccountLockoutManagerTest extends BaseAuthenticationContextTest {
@@ -48,7 +48,7 @@ public class StorageBackedAccountLockoutManagerTest extends BaseAuthenticationCo
         
         final UsernameIPLockoutKeyStrategy keyStrategy = new UsernameIPLockoutKeyStrategy();
         final HttpServletRequest request = (HttpServletRequest) src.getExternalContext().getNativeRequest();
-        keyStrategy.setHttpServletRequestSupplier(new NonnullSupplier<>() {public HttpServletRequest get() {return request;}});
+        keyStrategy.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         manager = new StorageBackedAccountLockoutManager();
         manager.setId("test");
         manager.setStorageService(ss);
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateCredentialsTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateCredentialsTest.java
index 485e327e5..2809bce15 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateCredentialsTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateCredentialsTest.java
@@ -40,7 +40,6 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthenticationResult;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.TemplateSearchDnResolver;
@@ -52,7 +51,7 @@ import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.idp.authn.principal.UsernamePrincipal;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 import net.shibboleth.shared.testing.InMemoryDirectory;
 import net.shibboleth.shared.testing.VelocityEngine;
 
@@ -132,7 +131,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
         mappings.put("ExpiredPassword", Arrays.asList("PASSWORD_EXPIRED", "CHANGE_AFTER_RESET"));
         action.setClassifiedMessages(mappings);
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
     }
 
     @Test public void testBadUsername() throws ComponentInitializationException {
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthenticationTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthenticationTest.java
index 40783bddd..08ac556dd 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthenticationTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateExternalAuthenticationTest.java
@@ -30,7 +30,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.ExternalAuthentication;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
@@ -42,7 +41,7 @@ import net.shibboleth.idp.authn.principal.UsernamePrincipal;
 import net.shibboleth.idp.authn.testing.TestPrincipal;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link ValidateExternalAuthentication} unit test. */
 public class ValidateExternalAuthenticationTest extends BaseAuthenticationContextTest {
@@ -60,7 +59,7 @@ public class ValidateExternalAuthenticationTest extends BaseAuthenticationContex
 
         action = new ValidateExternalAuthentication();
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
     }
 
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateRemoteUserTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateRemoteUserTest.java
index 98a50ed1d..90cfe64ba 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateRemoteUserTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateRemoteUserTest.java
@@ -27,14 +27,13 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.idp.authn.principal.UsernamePrincipal;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link ValidateRemoteUser} unit test. */
 public class ValidateRemoteUserTest extends BaseAuthenticationContextTest {
@@ -49,7 +48,7 @@ public class ValidateRemoteUserTest extends BaseAuthenticationContextTest {
         action.setDeniedUsernames(Arrays.asList("foo"));
         action.setMatchExpression(Pattern.compile("^ba(r|z|n)$"));
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
     }
 
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddressTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddressTest.java
index 5893e27ca..62c62d7fa 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddressTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddressTest.java
@@ -29,7 +29,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
@@ -40,7 +39,7 @@ import net.shibboleth.idp.authn.testing.TestPrincipal;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.net.IPRange;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link ValidateUserAgentAddress} unit test. */
 public class ValidateUserAgentAddressTest extends BaseAuthenticationContextTest {
@@ -55,7 +54,7 @@ public class ValidateUserAgentAddressTest extends BaseAuthenticationContextTest
                 "foo", Arrays.asList(IPRange.parseCIDRBlock("192.168.1.0/24"))));
         action.setSupportedPrincipals(Arrays.asList(new TestPrincipal("UserAgentAuthentication")));
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
     }
 
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509CertificateCredentialValidatorTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509CertificateCredentialValidatorTest.java
index ac702c4c6..739f7ef11 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509CertificateCredentialValidatorTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509CertificateCredentialValidatorTest.java
@@ -37,13 +37,12 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link X509CertificateCredentialValidator} unit test. */
 public class X509CertificateCredentialValidatorTest extends BaseAuthenticationContextTest {
@@ -105,7 +104,7 @@ public class X509CertificateCredentialValidatorTest extends BaseAuthenticationCo
         action = new ValidateCredentials();
         action.setValidators(Collections.singletonList(validator));
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
     }
 
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/ExtractDiscoveryResponseTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/ExtractDiscoveryResponseTest.java
index 1ee7389f6..b2c8f942e 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/ExtractDiscoveryResponseTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/ExtractDiscoveryResponseTest.java
@@ -24,13 +24,12 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link ExtractDiscoveryResponse} unit test. */
 public class ExtractDiscoveryResponseTest extends BaseAuthenticationContextTest {
@@ -42,7 +41,7 @@ public class ExtractDiscoveryResponseTest extends BaseAuthenticationContextTest
         
         action = new ExtractDiscoveryResponse();
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
     }
     
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAutoLoginManagerTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAutoLoginManagerTest.java
index 58d91b401..873b346e3 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAutoLoginManagerTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAutoLoginManagerTest.java
@@ -27,7 +27,7 @@ import jakarta.servlet.http.Cookie;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import net.shibboleth.shared.net.CookieManager;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 public class SPNEGOAutoLoginManagerTest {
 
@@ -51,8 +51,8 @@ public class SPNEGOAutoLoginManagerTest {
         final HttpServletRequest request = req != null ? req : new MockHttpServletRequest();
         final HttpServletResponse response = res != null ? res : new MockHttpServletResponse();
         
-        cookieManager.setHttpServletRequestSupplier(new NonnullSupplier<>() {public HttpServletRequest get() { return request;}});
-        cookieManager.setHttpServletResponseSupplier(new NonnullSupplier<>() {public HttpServletResponse get() { return response;}});
+        cookieManager.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
+        cookieManager.setHttpServletResponseSupplier(new ConstantSupplier<>(response));
         cookieManager.initialize();
 
         SPNEGOAutoLoginManager autoLoginManager = new SPNEGOAutoLoginManager();
diff --git a/idp-consent-impl/pom.xml b/idp-consent-impl/pom.xml
index 497a04066..3eb5c0194 100644
--- a/idp-consent-impl/pom.xml
+++ b/idp-consent-impl/pom.xml
@@ -119,6 +119,12 @@
             <artifactId>opensaml-testing</artifactId>
             <scope>test</scope>
         </dependency>
+        
+        <dependency>
+            <groupId>${shib-shared.groupId}</groupId>
+            <artifactId>shib-testing</artifactId>
+            <scope>test</scope>
+        </dependency>
 
         <dependency>
             <groupId>${spring.groupId}</groupId>
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ConsentFlowDescriptorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ConsentFlowDescriptorTest.java
index 8277799e0..e085633a3 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ConsentFlowDescriptorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ConsentFlowDescriptorTest.java
@@ -23,8 +23,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import net.shibboleth.shared.logic.ConstraintViolationException;
-
 /** {@link ConsentFlowDescriptor} unit test. */
 @SuppressWarnings("javadoc")
 public class ConsentFlowDescriptorTest {
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java
index 5d25dd1ba..2d075020a 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java
@@ -24,12 +24,11 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.consent.Consent;
 import net.shibboleth.idp.consent.context.ConsentContext;
 import net.shibboleth.idp.consent.impl.ConsentTestingSupport;
 import net.shibboleth.idp.profile.testing.ActionTestingSupport;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link ExtractConsent} unit test. */
 public class ExtractConsentTest extends AbstractConsentActionTest {
@@ -60,7 +59,7 @@ public class ExtractConsentTest extends AbstractConsentActionTest {
     @Test public void testNoUserInput() throws Exception {
         action = new ExtractConsent();
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
 
         final Event event = action.execute(src);
@@ -78,11 +77,11 @@ public class ExtractConsentTest extends AbstractConsentActionTest {
     }
 
     @Test public void testSingleUserInput() throws Exception {
-        final MockHttpServletRequest httpServletRequest = new MockHttpServletRequest();
-        httpServletRequest.setParameter(ExtractConsent.CONSENT_IDS_REQUEST_PARAMETER, "consent1");
+        final MockHttpServletRequest request = new MockHttpServletRequest();
+        request.setParameter(ExtractConsent.CONSENT_IDS_REQUEST_PARAMETER, "consent1");
 
         action = new ExtractConsent();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return httpServletRequest;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
 
         final Event event = action.execute(src);
@@ -105,7 +104,7 @@ public class ExtractConsentTest extends AbstractConsentActionTest {
         httpServletRequest.addParameter(ExtractConsent.CONSENT_IDS_REQUEST_PARAMETER, "consent2");
 
         action = new ExtractConsent();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return httpServletRequest;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(httpServletRequest));
         action.initialize();
 
         final Event event = action.execute(src);
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLogTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLogTest.java
index 753f07e5e..aee3aca09 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLogTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLogTest.java
@@ -37,6 +37,7 @@ import net.shibboleth.idp.profile.testing.ActionTestingSupport;
 import net.shibboleth.idp.profile.testing.RequestContextBuilder;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link WriteAuditLog} unit test. */
 public class WriteAuditLogTest {
@@ -61,7 +62,7 @@ public class WriteAuditLogTest {
         mock.setRequestURI("/path/to/foo");
         
         action = new FilteringAction();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return mock;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(mock));
     }
     
     @Test public void testNoRules() throws Exception {
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java
index 8351e3de8..1b2a807c5 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java
@@ -35,7 +35,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
 import net.shibboleth.idp.authn.AuthenticationResult;
 import net.shibboleth.idp.authn.AuthnEventIds;
@@ -49,7 +48,7 @@ import net.shibboleth.idp.profile.testing.RequestContextBuilder;
 import net.shibboleth.idp.saml.authn.principal.AuthenticationMethodPrincipal;
 import net.shibboleth.idp.saml.saml1.profile.testing.SAML1ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link AddAuthenticationStatementToAssertion} unit test. */
 public class AddAuthenticationStatementToAssertionTest extends OpenSAMLInitBaseTestCase {
@@ -67,7 +66,7 @@ public class AddAuthenticationStatementToAssertionTest extends OpenSAMLInitBaseT
 
         action = new AddAuthenticationStatementToAssertion();
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
     }
     
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
index a0aff1d2d..70c4a68d4 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
@@ -30,11 +30,10 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.saml.profile.impl.BaseIdPInitiatedSSORequestMessageDecoder;
 import net.shibboleth.idp.saml.profile.impl.IdPInitiatedSSORequest;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /**
  * Test the {@link IdPInitiatedSSORequestMessageDecoder}.
@@ -67,7 +66,7 @@ public class IdPInitiatedSSORequestMessageDecoderTest {
         request.setRequestedSessionId(sessionID);
         
         decoder = new IdPInitiatedSSORequestMessageDecoder();
-        decoder.setHttpServletRequestSupplier(new NonnullSupplier<>() {public HttpServletRequest get() { return request;}});
+        decoder.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         decoder.initialize();
     }
     
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java
index 4b11128f1..11e1f2cee 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java
@@ -38,7 +38,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
 import net.shibboleth.idp.authn.AuthenticationResult;
 import net.shibboleth.idp.authn.AuthnEventIds;
@@ -55,7 +54,7 @@ import net.shibboleth.idp.saml.authn.principal.AuthnContextClassRefPrincipal;
 import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
 import net.shibboleth.idp.saml.saml2.profile.testing.SAML2ActionTestingSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /** {@link AddAuthnStatementToAssertion} unit test. */
 @SuppressWarnings("javadoc")
@@ -74,7 +73,7 @@ public class AddAuthnStatementToAssertionTest extends OpenSAMLInitBaseTestCase {
 
         action = new AddAuthnStatementToAssertion();
         final MockHttpServletRequest request = new MockHttpServletRequest();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return request;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         action.initialize();
     }
     
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
index 578941a1c..3580dc36a 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
@@ -32,10 +32,9 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.idp.saml.profile.impl.BaseIdPInitiatedSSORequestMessageDecoder;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 /**
  * Test the {@link IdPInitiatedSSORequestMessageDecoder}.
@@ -68,7 +67,7 @@ public class IdPInitiatedSSORequestMessageDecoderTest extends XMLObjectBaseTestC
         request.setRequestedSessionId(sessionID);
         
         decoder = new IdPInitiatedSSORequestMessageDecoder();
-        decoder.setHttpServletRequestSupplier(new NonnullSupplier<>() {public HttpServletRequest get() { return request;}});
+        decoder.setHttpServletRequestSupplier(new ConstantSupplier<>(request));
         decoder.initialize();
     }
     
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
index 4a4d4adc7..4c58232bf 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
@@ -47,12 +47,10 @@ import org.testng.annotations.Test;
 
 import com.google.common.base.Predicates;
 
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
+import net.shibboleth.shared.testing.ConstantSupplier;
 
 public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTestCase {
     
@@ -73,8 +71,8 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         httpResponse = new MockHttpServletResponse();
         
         action = new ProcessAssertionsForAuthentication();
-        action.setHttpServletRequestSupplier(new NonnullSupplier<> () {public HttpServletRequest get() { return httpRequest;}});
-        action.setHttpServletResponseSupplier(new NonnullSupplier<> () {public HttpServletResponse get() { return httpResponse;}});
+        action.setHttpServletRequestSupplier(new ConstantSupplier<>(httpRequest));
+        action.setHttpServletResponseSupplier(new ConstantSupplier<>(httpResponse));
         
         
         samlResponse = SAML2ActionTestingSupport.buildResponse();

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


More information about the commits mailing list