[java-identity-provider] branch main updated: Convert resources in tests.
Scott Cantor
cantor.2 at osu.edu
Thu Jun 15 18:42:53 UTC 2023
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=98b5d358828fbc8792634acbbe09d1b7b28d8f24
The following commit(s) were added to refs/heads/main by this push:
new 98b5d3588 Convert resources in tests.
98b5d3588 is described below
commit 98b5d358828fbc8792634acbbe09d1b7b28d8f24
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jun 15 14:42:50 2023 -0400
Convert resources in tests.
---
.../idp/authn/impl/HTPasswdCredentialValidatorTest.java | 5 +++--
.../idp/authn/impl/JAASCredentialValidatorTest.java | 13 +++++++------
.../shibboleth/idp/authn/impl/ValidateCredentialsTest.java | 3 ++-
3 files changed, 12 insertions(+), 9 deletions(-)
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 76a2f26ff..874948a4f 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
@@ -45,6 +45,7 @@ import net.shibboleth.idp.authn.testing.TestPrincipal;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.spring.resource.ResourceHelper;
import net.shibboleth.shared.testing.ConstantSupplier;
/** Unit test for htpasswd file validation. */
@@ -61,7 +62,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
super.setUp();
validator = new HTPasswdCredentialValidator();
- validator.setResource(new ClassPathResource("net/shibboleth/idp/authn/impl/htpasswd.txt"));
+ validator.setResource(ResourceHelper.of(new ClassPathResource("net/shibboleth/idp/authn/impl/htpasswd.txt")));
validator.setId("htpasswdtest");
action = new ValidateCredentials();
@@ -231,7 +232,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
assert ac != null;
ac.setAttemptedFlow(authenticationFlows.get(0));
- validator.setResource(new FileSystemResource(DATA_PATH + "htpasswd.txt"));
+ validator.setResource(ResourceHelper.of(new FileSystemResource(DATA_PATH + "htpasswd.txt")));
validator.initialize();
action.initialize();
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 d1fa5e77f..920051b56 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
@@ -55,6 +55,7 @@ import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.Pair;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.net.URISupport;
+import net.shibboleth.shared.spring.resource.ResourceHelper;
import net.shibboleth.shared.testing.ConstantSupplier;
import net.shibboleth.shared.testing.InMemoryDirectory;
@@ -252,7 +253,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
assert ac != null;
ac.setAttemptedFlow(authenticationFlows.get(0));
validator.setLoginConfigType("JavaLoginConfig");
- validator.setLoginConfigResource(new ClassPathResource(DATA_CLASSPATH + "jaas.config"));
+ validator.setLoginConfigResource(ResourceHelper.of(new ClassPathResource(DATA_CLASSPATH + "jaas.config")));
validator.initialize();
action.initialize();
@@ -276,7 +277,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
assert ac != null;
ac.setAttemptedFlow(authenticationFlows.get(0));
validator.setLoginConfigType("JavaLoginConfig");
- validator.setLoginConfigResource(new ClassPathResource(DATA_CLASSPATH + "jaas.config"));
+ validator.setLoginConfigResource(ResourceHelper.of(new ClassPathResource(DATA_CLASSPATH + "jaas.config")));
validator.initialize();
action.initialize();
@@ -327,7 +328,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
ac.setAttemptedFlow(authenticationFlows.get(0));
validator.setLoginConfigType("JavaLoginConfig");
- validator.setLoginConfigResource(new ClassPathResource(DATA_CLASSPATH + "jaas.config"));
+ validator.setLoginConfigResource(ResourceHelper.of(new ClassPathResource(DATA_CLASSPATH + "jaas.config")));
validator.initialize();
action.initialize();
@@ -360,7 +361,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
validator.setLoginConfigurations(CollectionSupport.singletonList(new Pair<>("ShibUserPassAuth",
CollectionSupport.singletonList(new TestPrincipal("test1")))));
validator.setLoginConfigType("JavaLoginConfig");
- validator.setLoginConfigResource(new ClassPathResource(DATA_CLASSPATH + "jaas.config"));
+ validator.setLoginConfigResource(ResourceHelper.of(new ClassPathResource(DATA_CLASSPATH + "jaas.config")));
validator.initialize();
action.initialize();
@@ -388,7 +389,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
validator.setLoginConfigNames(Arrays.asList("ShibBadAuth", "ShibUserPassAuth"));
validator.setLoginConfigType("JavaLoginConfig");
- validator.setLoginConfigResource(new ClassPathResource(DATA_CLASSPATH + "jaas.config"));
+ validator.setLoginConfigResource(ResourceHelper.of(new ClassPathResource(DATA_CLASSPATH + "jaas.config")));
validator.initialize();
action.initialize();
@@ -413,7 +414,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
ac.setAttemptedFlow(authenticationFlows.get(0));
validator.setLoginConfigType("JavaLoginConfig");
- validator.setLoginConfigResource(new ClassPathResource(DATA_CLASSPATH + "jaas.config"));
+ validator.setLoginConfigResource(ResourceHelper.of(new ClassPathResource(DATA_CLASSPATH + "jaas.config")));
validator.setMatchExpression(Pattern.compile(".+_THE_.+"));
validator.initialize();
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 08c3ec624..499e66b5d 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
@@ -51,6 +51,7 @@ import net.shibboleth.idp.authn.principal.UsernamePrincipal;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.spring.resource.ResourceHelper;
import net.shibboleth.shared.testing.ConstantSupplier;
import net.shibboleth.shared.testing.InMemoryDirectory;
import net.shibboleth.shared.testing.VelocityEngine;
@@ -121,7 +122,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
final HTPasswdCredentialValidator htpasswd = new HTPasswdCredentialValidator();
htpasswd.setId("htpasswd");
- htpasswd.setResource(new ClassPathResource(DATA_PATH + "htpasswd.txt"));
+ htpasswd.setResource(ResourceHelper.of(new ClassPathResource(DATA_PATH + "htpasswd.txt")));
htpasswd.initialize();
action = new ValidateCredentials();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list