[java-identity-provider] branch main updated: Clean up exception specs in tests.
Scott Cantor
cantor.2 at osu.edu
Wed Dec 15 16:54:04 UTC 2021
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=5a85833d3961edaa7841b1d7c76a63efd3abdad0
The following commit(s) were added to refs/heads/main by this push:
new 5a85833d3 Clean up exception specs in tests.
5a85833d3 is described below
commit 5a85833d3961edaa7841b1d7c76a63efd3abdad0
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Dec 15 11:54:01 2021 -0500
Clean up exception specs in tests.
---
.../ExtractDuoAuthenticationFromHeadersTest.java | 17 ++++-----
...ttributeSourcedSubjectCanonicalizationTest.java | 2 +-
.../idp/authn/impl/ExtractRemoteUserTest.java | 16 ++++-----
.../authn/impl/ExtractUserAgentAddressTest.java | 3 +-
.../authn/impl/ExtractUserAgentIdentifierTest.java | 5 +--
.../ExtractUsernamePasswordFromBasicAuthTest.java | 19 +++++-----
...ExtractUsernamePasswordFromFormRequestTest.java | 14 ++++----
.../ExtractX509CertificateFromRequestTest.java | 13 +++----
.../authn/impl/FilterFlowsByForceAuthnTest.java | 5 +--
.../impl/FilterFlowsByNonBrowserSupportTest.java | 3 +-
.../idp/authn/impl/FinalizeAuthenticationTest.java | 3 +-
.../impl/HTPasswdCredentialValidatorTest.java | 31 ++++++++--------
.../authn/impl/JAASCredentialValidatorTest.java | 34 +++++++++---------
.../authn/impl/LDAPCredentialValidatorTest.java | 41 +++++++++++-----------
.../impl/PopulateAuthenticationContextTest.java | 7 ++--
.../impl/PreserveAuthenticationFlowStateTest.java | 15 ++++----
.../authn/impl/SelectAuthenticationFlowTest.java | 2 +-
.../impl/SimpleSubjectCanonicalizationTest.java | 3 +-
.../StorageBackedAccountLockoutManagerTest.java | 3 +-
.../idp/authn/impl/ValidateCredentialsTest.java | 19 +++++-----
.../impl/ValidateExternalAuthenticationTest.java | 3 +-
.../idp/authn/impl/ValidateFunctionResultTest.java | 2 +-
.../idp/authn/impl/ValidateRemoteUserTest.java | 2 +-
.../authn/impl/ValidateUserAgentAddressTest.java | 2 +-
.../authn/impl/ValidateX509CertificateTest.java | 2 +-
.../impl/X500SubjectCanonicalizationTest.java | 3 +-
.../idp/authn/impl/X509ProxyFilterTest.java | 9 +++--
.../testing/BaseAuthenticationContextTest.java | 5 +--
.../impl/DiscoveryProfileRequestFunctionTest.java | 6 ++--
.../proxy/impl/ExtractDiscoveryResponseTest.java | 9 ++---
30 files changed, 163 insertions(+), 135 deletions(-)
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/duo/impl/ExtractDuoAuthenticationFromHeadersTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/duo/impl/ExtractDuoAuthenticationFromHeadersTest.java
index 623c691d5..66aa0e182 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/duo/impl/ExtractDuoAuthenticationFromHeadersTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/duo/impl/ExtractDuoAuthenticationFromHeadersTest.java
@@ -24,6 +24,7 @@ import net.shibboleth.idp.authn.duo.DuoAuthAPI;
import net.shibboleth.idp.authn.duo.context.DuoAuthenticationContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.webflow.execution.Event;
@@ -36,7 +37,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
private ExtractDuoAuthenticationFromHeaders action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractDuoAuthenticationFromHeaders();
@@ -44,7 +45,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
action.initialize();
}
- @Test public void testNoServletNoAuto() throws Exception {
+ @Test public void testNoServletNoAuto() throws ComponentInitializationException {
action = new ExtractDuoAuthenticationFromHeaders();
action.setAutoAuthenticationSupported(false);
action.initialize();
@@ -57,7 +58,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
Assert.assertNull(duoCtx);
}
- @Test public void testNoAuto() throws Exception {
+ @Test public void testNoAuto() throws ComponentInitializationException {
action = new ExtractDuoAuthenticationFromHeaders();
action.setHttpServletRequest(new MockHttpServletRequest());
action.setAutoAuthenticationSupported(false);
@@ -71,7 +72,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
Assert.assertNull(duoCtx);
}
- @Test public void testNoServletAuto() throws Exception {
+ @Test public void testNoServletAuto() throws ComponentInitializationException {
action = new ExtractDuoAuthenticationFromHeaders();
action.initialize();
@@ -86,7 +87,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
Assert.assertNull(duoCtx.getPasscode());
}
- @Test public void testFactorAutoDevice() throws Exception {
+ @Test public void testFactorAutoDevice() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(DuoAuthAPI.DUO_FACTOR_HEADER_NAME, DuoAuthAPI.DUO_FACTOR_PUSH);
final Event event = action.execute(src);
@@ -100,7 +101,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
Assert.assertNull(duoCtx.getPasscode());
}
- @Test public void testDeviceAutoFactor() throws Exception {
+ @Test public void testDeviceAutoFactor() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(DuoAuthAPI.DUO_DEVICE_HEADER_NAME, "foo");
final Event event = action.execute(src);
@@ -114,7 +115,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
Assert.assertNull(duoCtx.getPasscode());
}
- @Test public void testNoPasscode() throws Exception {
+ @Test public void testNoPasscode() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(DuoAuthAPI.DUO_FACTOR_HEADER_NAME, DuoAuthAPI.DUO_FACTOR_PASSCODE);
final Event event = action.execute(src);
@@ -125,7 +126,7 @@ public class ExtractDuoAuthenticationFromHeadersTest extends BaseAuthenticationC
Assert.assertNull(duoCtx);
}
- @Test public void testPasscode() throws Exception {
+ @Test public void testPasscode() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(DuoAuthAPI.DUO_FACTOR_HEADER_NAME, DuoAuthAPI.DUO_FACTOR_PASSCODE);
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(DuoAuthAPI.DUO_PASSCODE_HEADER_NAME, "foo");
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalizationTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalizationTest.java
index f83290aa2..5bec3f3ac 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalizationTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalizationTest.java
@@ -44,7 +44,7 @@ public class AttributeSourcedSubjectCanonicalizationTest extends BaseAuthenticat
private AttributeSourcedSubjectCanonicalization action;
@BeforeMethod
- public void setUp() throws Exception {
+ public void setUp() throws ComponentInitializationException {
super.setUp();
action = new AttributeSourcedSubjectCanonicalization();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractRemoteUserTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractRemoteUserTest.java
index c3d17cd1a..e983ceed9 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractRemoteUserTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractRemoteUserTest.java
@@ -39,7 +39,7 @@ public class ExtractRemoteUserTest extends BaseAuthenticationContextTest {
private ExtractRemoteUser action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractRemoteUser();
@@ -56,22 +56,22 @@ public class ExtractRemoteUserTest extends BaseAuthenticationContextTest {
}
}
- @Test public void testNoServlet() throws Exception {
+ @Test public void testNoServlet() throws ComponentInitializationException {
action.setHttpServletRequest(null);
action.initialize();
- final Event event = action.execute(src);
+ final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingIdentity() throws Exception {
+ @Test public void testMissingIdentity() throws ComponentInitializationException {
action.initialize();
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testRemoteUser() throws Exception {
+ @Test public void testRemoteUser() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).setRemoteUser("foo");
action.initialize();
@@ -83,7 +83,7 @@ public class ExtractRemoteUserTest extends BaseAuthenticationContextTest {
Assert.assertEquals(unCtx.getUsername(), "foo");
}
- @Test public void testAttribute() throws Exception {
+ @Test public void testAttribute() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).setAttribute("Username", "foo");
action.setCheckAttributes(Arrays.asList("Username"));
action.initialize();
@@ -96,7 +96,7 @@ public class ExtractRemoteUserTest extends BaseAuthenticationContextTest {
Assert.assertEquals(unCtx.getUsername(), "foo");
}
- @Test public void testHeader() throws Exception {
+ @Test public void testHeader() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader("X-Username", "foo");
action.setCheckAttributes(Arrays.asList("Username"));
action.setCheckHeaders(Arrays.asList("X-Username"));
@@ -110,7 +110,7 @@ public class ExtractRemoteUserTest extends BaseAuthenticationContextTest {
Assert.assertEquals(unCtx.getUsername(), "foo");
}
- @Test public void testTransforms() throws Exception {
+ @Test public void testTransforms() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).setRemoteUser(" Foo at osu.edu ");
action.setTrim(true);
action.setTransforms(Arrays.asList(new Pair<>("^(.+)@osu\\.edu$", "$1")));
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentAddressTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentAddressTest.java
index 2c309e357..a93ee65fa 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentAddressTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentAddressTest.java
@@ -23,6 +23,7 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.UserAgentContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.webflow.execution.Event;
@@ -35,7 +36,7 @@ public class ExtractUserAgentAddressTest extends BaseAuthenticationContextTest {
private ExtractUserAgentAddress action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractUserAgentAddress();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifierTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifierTest.java
index 68de86136..654ea9546 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifierTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUserAgentIdentifierTest.java
@@ -23,6 +23,7 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.UserAgentContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.webflow.execution.Event;
@@ -35,7 +36,7 @@ public class ExtractUserAgentIdentifierTest extends BaseAuthenticationContextTes
private ExtractUserAgentIdentifier action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractUserAgentIdentifier();
@@ -43,7 +44,7 @@ public class ExtractUserAgentIdentifierTest extends BaseAuthenticationContextTes
action.initialize();
}
- @Test public void testNoServlet() throws Exception {
+ @Test public void testNoServlet() throws ComponentInitializationException {
action = new ExtractUserAgentIdentifier();
action.initialize();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuthTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuthTest.java
index 565c92d53..18533da83 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuthTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromBasicAuthTest.java
@@ -31,13 +31,14 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.UsernamePasswordContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
/** {@link ExtractUsernamePasswordFromBasicAuth} unit test. */
public class ExtractUsernamePasswordFromBasicAuthTest extends BaseAuthenticationContextTest {
private ExtractUsernamePasswordFromBasicAuth action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractUsernamePasswordFromBasicAuth();
@@ -45,34 +46,34 @@ public class ExtractUsernamePasswordFromBasicAuthTest extends BaseAuthentication
action.initialize();
}
- @Test public void testNoServlet() throws Exception {
+ @Test public void testNoServlet() throws ComponentInitializationException {
action = new ExtractUsernamePasswordFromBasicAuth();
action.initialize();
- final Event event = action.execute(src);
+ final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingIdentity() throws Exception {
+ @Test public void testMissingIdentity() {
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingIdentity2() throws Exception {
+ @Test public void testMissingIdentity2() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(HttpHeaders.AUTHORIZATION, "foo");
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testInvalid() throws Exception {
+ @Test public void testInvalid() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(HttpHeaders.AUTHORIZATION, "Basic foo:bar");
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.INVALID_CREDENTIALS);
}
- @Test public void testInvalid2() throws Exception {
+ @Test public void testInvalid2() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(HttpHeaders.AUTHORIZATION, "Basic Zm9vOg==");
final Event event = action.execute(src);
@@ -80,14 +81,14 @@ public class ExtractUsernamePasswordFromBasicAuthTest extends BaseAuthentication
}
/* Test invalid base64 trailing bits. */
- @Test public void testInvalidBase64() throws Exception {
+ @Test public void testInvalidBase64() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(HttpHeaders.AUTHORIZATION, "Basic AB==");
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.INVALID_CREDENTIALS);
}
- @Test public void testValid() throws Exception {
+ @Test public void testValid() {
((MockHttpServletRequest) action.getHttpServletRequest()).addHeader(HttpHeaders.AUTHORIZATION, "Basic Zm9vOmJhcg==");
final Event event = action.execute(src);
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequestTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequestTest.java
index cd32400a5..8f5f88b13 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequestTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequestTest.java
@@ -23,6 +23,7 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.UsernamePasswordContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.webflow.execution.Event;
@@ -35,7 +36,7 @@ public class ExtractUsernamePasswordFromFormRequestTest extends BaseAuthenticati
private ExtractUsernamePasswordFromFormRequest action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractUsernamePasswordFromFormRequest();
@@ -45,7 +46,7 @@ public class ExtractUsernamePasswordFromFormRequestTest extends BaseAuthenticati
action.initialize();
}
- @Test public void testNoServlet() throws Exception {
+ @Test public void testNoServlet() throws ComponentInitializationException {
action = new ExtractUsernamePasswordFromFormRequest();
action.setUsernameFieldName("j_username");
action.setPasswordFieldName("j_password");
@@ -55,20 +56,19 @@ public class ExtractUsernamePasswordFromFormRequestTest extends BaseAuthenticati
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingIdentity() throws Exception {
+ @Test public void testMissingIdentity() {
final Event event = action.execute(src);
-
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingIdentity2() throws Exception {
+ @Test public void testMissingIdentity2() {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("j_username", "foo");
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testValid() throws Exception {
+ @Test public void testValid() {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("j_username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("j_password", "bar");
@@ -82,7 +82,7 @@ public class ExtractUsernamePasswordFromFormRequestTest extends BaseAuthenticati
Assert.assertEquals(upCtx.getPassword(), "bar");
}
- @Test public void testSSOBypass() throws Exception {
+ @Test public void testSSOBypass() {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("j_username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("j_password", "bar");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("donotcache", "1");
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractX509CertificateFromRequestTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractX509CertificateFromRequestTest.java
index 582de652f..a8aa42e27 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractX509CertificateFromRequestTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ExtractX509CertificateFromRequestTest.java
@@ -18,6 +18,7 @@
package net.shibboleth.idp.authn.impl;
+import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import net.shibboleth.idp.authn.AuthnEventIds;
@@ -25,6 +26,7 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.CertificateContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.opensaml.security.x509.X509Support;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -83,7 +85,7 @@ public class ExtractX509CertificateFromRequestTest extends BaseAuthenticationCon
private ExtractX509CertificateFromRequest action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractX509CertificateFromRequest();
@@ -91,21 +93,20 @@ public class ExtractX509CertificateFromRequestTest extends BaseAuthenticationCon
action.initialize();
}
- @Test public void testNoServlet() throws Exception {
+ @Test public void testNoServlet() throws ComponentInitializationException {
action = new ExtractX509CertificateFromRequest();
action.initialize();
final Event event = action.execute(src);
-
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingIdentity() throws Exception {
+ @Test public void testMissingIdentity() {
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testValidJava() throws Exception {
+ @Test public void testValidJava() throws CertificateException {
final X509Certificate entityCert = X509Support.decodeCertificate(entityCertBase64);
final X509Certificate otherCert1 = X509Support.decodeCertificate(otherCert1Base64);
@@ -124,7 +125,7 @@ public class ExtractX509CertificateFromRequestTest extends BaseAuthenticationCon
Assert.assertSame(certCtx.getIntermediates().iterator().next(), otherCert1);
}
- @Test public void testValidJakarta() throws Exception {
+ @Test public void testValidJakarta() throws CertificateException {
final X509Certificate entityCert = X509Support.decodeCertificate(entityCertBase64);
final X509Certificate otherCert1 = X509Support.decodeCertificate(otherCert1Base64);
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByForceAuthnTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByForceAuthnTest.java
index b1e4d964c..f411143d4 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByForceAuthnTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByForceAuthnTest.java
@@ -21,6 +21,7 @@ import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
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.utilities.java.support.component.ComponentInitializationException;
import java.time.Duration;
@@ -34,14 +35,14 @@ public class FilterFlowsByForceAuthnTest extends BaseAuthenticationContextTest {
private FilterFlowsByForcedAuthn action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new FilterFlowsByForcedAuthn();
action.initialize();
}
- @Test public void testNonForced() throws Exception {
+ @Test public void testNonForced() {
final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
authCtx.setForceAuthn(false);
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByNonBrowserSupportTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByNonBrowserSupportTest.java
index 8f7aa6a6a..ee4686f2a 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByNonBrowserSupportTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FilterFlowsByNonBrowserSupportTest.java
@@ -20,6 +20,7 @@ package net.shibboleth.idp.authn.impl;
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.utilities.java.support.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
import org.testng.Assert;
@@ -31,7 +32,7 @@ public class FilterFlowsByNonBrowserSupportTest extends BaseAuthenticationContex
private FilterFlowsByNonBrowserSupport action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new FilterFlowsByNonBrowserSupport();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java
index 2bdee7acb..570d262d9 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java
@@ -36,6 +36,7 @@ import net.shibboleth.idp.authn.testing.TestPrincipal;
import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
import org.testng.Assert;
@@ -47,7 +48,7 @@ public class FinalizeAuthenticationTest extends BaseAuthenticationContextTest {
private FinalizeAuthentication action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
prc.getSubcontext(RelyingPartyContext.class).setProfileConfig(new BrowserSSOProfileConfiguration());
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 8424a3f7f..f808ca7be 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
@@ -36,6 +36,7 @@ import net.shibboleth.idp.authn.principal.UsernamePrincipal;
import net.shibboleth.idp.authn.principal.impl.ExactPrincipalEvalPredicateFactory;
import net.shibboleth.idp.authn.testing.TestPrincipal;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
@@ -54,7 +55,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
private ValidateCredentials action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
validator = new HTPasswdCredentialValidator();
@@ -72,7 +73,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
action.setHttpServletRequest(new MockHttpServletRequest());
}
- @Test public void testMissingFlow() throws Exception {
+ @Test public void testMissingFlow() throws ComponentInitializationException {
validator.initialize();
action.initialize();
@@ -80,7 +81,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
ActionTestingSupport.assertEvent(event, AuthnEventIds.INVALID_AUTHN_CTX);
}
- @Test public void testMissingUser() throws Exception {
+ @Test public void testMissingUser() throws ComponentInitializationException {
prc.getSubcontext(AuthenticationContext.class).setAttemptedFlow(authenticationFlows.get(0));
validator.initialize();
@@ -90,7 +91,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingUser2() throws Exception {
+ @Test public void testMissingUser2() throws ComponentInitializationException {
final AuthenticationContext ac = prc.getSubcontext(AuthenticationContext.class);
ac.setAttemptedFlow(authenticationFlows.get(0));
ac.getSubcontext(UsernamePasswordContext.class, true);
@@ -102,7 +103,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testUnsupported() throws Exception {
+ @Test public void testUnsupported() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -126,7 +127,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
ActionTestingSupport.assertEvent(event, AuthnEventIds.REQUEST_UNSUPPORTED);
}
- @Test public void testUnmatchedUser() throws Exception {
+ @Test public void testUnmatchedUser() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -145,7 +146,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
ActionTestingSupport.assertEvent(event, AuthnEventIds.REQUEST_UNSUPPORTED);
}
- @Test public void testBadUsername() throws Exception {
+ @Test public void testBadUsername() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -166,7 +167,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
Assert.assertFalse(errorCtx.isClassifiedError("InvalidPassword"));
}
- @Test public void testBadPassword() throws Exception {
+ @Test public void testBadPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -187,7 +188,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
Assert.assertTrue(errorCtx.isClassifiedError("InvalidPassword"));
}
- @Test public void testAuthorizedMD5() throws Exception {
+ @Test public void testAuthorizedMD5() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -208,7 +209,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
.next().getName(), "PETER_THE_PRINCIPAL");
}
- @Test public void testAuthorizedMD5WithFile() throws Exception {
+ @Test public void testAuthorizedMD5WithFile() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -230,7 +231,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
.next().getName(), "PETER_THE_PRINCIPAL");
}
- @Test public void testAuthorizedSHA() throws Exception {
+ @Test public void testAuthorizedSHA() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL2");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -251,7 +252,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
.next().getName(), "PETER_THE_PRINCIPAL2");
}
- @Test public void testAuthorizedCrypt() throws Exception {
+ @Test public void testAuthorizedCrypt() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL3");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -272,7 +273,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
.next().getName(), "PETER_THE_PRINCIPAL3");
}
- @Test public void testAuthorizedAndKeep() throws Exception {
+ @Test public void testAuthorizedAndKeep() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -293,7 +294,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
.next().getName(), "PETER_THE_PRINCIPAL");
}
- @Test public void testSupported() throws Exception {
+ @Test public void testSupported() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -323,7 +324,7 @@ public class HTPasswdCredentialValidatorTest extends BaseAuthenticationContextTe
.next().getName(), "test1");
}
- private void doExtract() throws Exception {
+ private void doExtract() throws ComponentInitializationException {
final ExtractUsernamePasswordFromFormRequest extract = new ExtractUsernamePasswordFromFormRequest();
extract.setHttpServletRequest(action.getHttpServletRequest());
extract.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 82113b538..966162686 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
@@ -19,6 +19,7 @@ package net.shibboleth.idp.authn.impl;
import java.io.File;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.security.Principal;
import java.util.Arrays;
import java.util.Collection;
@@ -40,6 +41,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.utilities.java.support.collection.Pair;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.net.URISupport;
import org.springframework.core.io.ClassPathResource;
@@ -91,7 +93,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
directoryServer.shutDown(true);
}
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
validator = new JAASCredentialValidator();
@@ -108,7 +110,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
action.setHttpServletRequest(new MockHttpServletRequest());
}
- @Test public void testMissingFlow() throws Exception {
+ @Test public void testMissingFlow() throws ComponentInitializationException {
validator.initialize();
action.initialize();
@@ -116,7 +118,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.INVALID_AUTHN_CTX);
}
- @Test public void testMissingUser() throws Exception {
+ @Test public void testMissingUser() throws ComponentInitializationException {
prc.getSubcontext(AuthenticationContext.class).setAttemptedFlow(authenticationFlows.get(0));
validator.initialize();
@@ -126,7 +128,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingUser2() throws Exception {
+ @Test public void testMissingUser2() throws ComponentInitializationException {
final AuthenticationContext ac = prc.getSubcontext(AuthenticationContext.class);
ac.setAttemptedFlow(authenticationFlows.get(0));
ac.getSubcontext(UsernamePasswordContext.class, true);
@@ -138,7 +140,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testNoConfig() throws Exception {
+ @Test public void testNoConfig() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -157,7 +159,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertTrue(errorCtx.getExceptions().get(0) instanceof LoginException);
}
- @Test public void testBadConfig() throws Exception {
+ @Test public void testBadConfig() throws ComponentInitializationException, URISyntaxException, IOException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -180,7 +182,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertTrue(errorCtx.getExceptions().get(0) instanceof LoginException);
}
- @Test public void testUnsupportedConfig() throws Exception {
+ @Test public void testUnsupportedConfig() throws ComponentInitializationException, URISyntaxException, IOException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -208,7 +210,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.REQUEST_UNSUPPORTED);
}
- @Test public void testUnmatchedUser() throws Exception {
+ @Test public void testUnmatchedUser() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -227,7 +229,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.REQUEST_UNSUPPORTED);
}
- @Test public void testBadUsername() throws Exception {
+ @Test public void testBadUsername() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -249,7 +251,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertFalse(errorCtx.isClassifiedError("InvalidPassword"));
}
- @Test public void testBadPassword() throws Exception {
+ @Test public void testBadPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -271,7 +273,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertTrue(errorCtx.isClassifiedError("InvalidPassword"));
}
- @Test public void testAuthorized() throws Exception {
+ @Test public void testAuthorized() throws ComponentInitializationException, URISyntaxException, IOException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -295,7 +297,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
.next().getName(), "PETER_THE_PRINCIPAL");
}
- @Test public void testAuthorizedAndKeep() throws Exception {
+ @Test public void testAuthorizedAndKeep() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -318,7 +320,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
.next().getName(), "PETER_THE_PRINCIPAL");
}
- @Test public void testSupported() throws Exception {
+ @Test public void testSupported() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -351,7 +353,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
.next().getName(), "test1");
}
- @Test public void testMultiConfigAuthorized() throws Exception {
+ @Test public void testMultiConfigAuthorized() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -375,7 +377,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
.next().getName(), "PETER_THE_PRINCIPAL");
}
- @Test public void testMatchAndAuthorized() throws Exception {
+ @Test public void testMatchAndAuthorized() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -399,7 +401,7 @@ public class JAASCredentialValidatorTest extends BaseAuthenticationContextTest {
.next().getName(), "PETER_THE_PRINCIPAL");
}
- private void doExtract() throws Exception {
+ private void doExtract() throws ComponentInitializationException {
final ExtractUsernamePasswordFromFormRequest extract = new ExtractUsernamePasswordFromFormRequest();
extract.setHttpServletRequest(action.getHttpServletRequest());
extract.initialize();
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 3aeb6ed72..b7b491521 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
@@ -37,6 +37,7 @@ import net.shibboleth.idp.authn.context.UsernamePasswordContext;
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.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.velocity.VelocityEngine;
import org.ldaptive.DefaultConnectionFactory;
@@ -118,7 +119,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
directoryServer.shutDown(true);
}
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
validator = new LDAPCredentialValidator();
@@ -136,7 +137,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
action.setHttpServletRequest(new MockHttpServletRequest());
}
- @Test public void testMissingFlow() throws Exception {
+ @Test public void testMissingFlow() throws ComponentInitializationException {
validator.setAuthenticator(authenticator);
validator.initialize();
@@ -146,7 +147,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.INVALID_AUTHN_CTX);
}
- @Test public void testMissingUser() throws Exception {
+ @Test public void testMissingUser() throws ComponentInitializationException {
prc.getSubcontext(AuthenticationContext.class).setAttemptedFlow(authenticationFlows.get(0));
validator.setAuthenticator(authenticator);
@@ -158,7 +159,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testMissingUser2() throws Exception {
+ @Test public void testMissingUser2() throws ComponentInitializationException {
AuthenticationContext ac = prc.getSubcontext(AuthenticationContext.class);
ac.setAttemptedFlow(authenticationFlows.get(0));
ac.getSubcontext(UsernamePasswordContext.class, true);
@@ -174,7 +175,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
}
- @Test public void testUnmatchedUser() throws Exception {
+ @Test public void testUnmatchedUser() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -194,7 +195,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.REQUEST_UNSUPPORTED);
}
- @Test public void testBadConfig() throws Exception {
+ @Test public void testBadConfig() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -222,7 +223,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("UnknownUsername"));
}
- @Test public void testBadConfig2() throws Exception {
+ @Test public void testBadConfig2() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -253,7 +254,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertEquals(aec.getClassifiedErrors().size(), 0);
}
- @Test public void testBadUsername() throws Exception {
+ @Test public void testBadUsername() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -281,7 +282,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("UnknownUsername"));
}
- @Test public void testEmptyPassword() throws Exception {
+ @Test public void testEmptyPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "");
@@ -301,7 +302,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertEvent(event, AuthnEventIds.INVALID_CREDENTIALS);
}
- @Test public void testBadPassword() throws Exception {
+ @Test public void testBadPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -329,7 +330,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("InvalidPassword"));
}
- @Test public void testExpiredPassword() throws Exception {
+ @Test public void testExpiredPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -364,7 +365,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("InvalidPassword"));
}
- @Test public void testChangeAfterReset() throws Exception {
+ @Test public void testChangeAfterReset() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -410,7 +411,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testExpiringPassword() throws Exception {
+ @Test public void testExpiringPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -459,7 +460,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testAuthorized() throws Exception {
+ @Test public void testAuthorized() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -495,7 +496,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testComputedAndAuthorized() throws Exception {
+ @Test public void testComputedAndAuthorized() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "change");
@@ -539,7 +540,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testDefaultFilterSyntax() throws Exception {
+ @Test public void testDefaultFilterSyntax() throws ComponentInitializationException {
TemplateSearchDnResolver testResolver = new TemplateSearchDnResolver(new DefaultConnectionFactory("ldap://localhost:10389"),
VelocityEngine.newVelocityEngine(), "(uid={user})");
testResolver.setBaseDn("ou=people,dc=shibboleth,dc=net");
@@ -580,7 +581,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testCombinedFilterSyntax() throws Exception {
+ @Test public void testCombinedFilterSyntax() throws ComponentInitializationException {
TemplateSearchDnResolver testResolver = new TemplateSearchDnResolver(new DefaultConnectionFactory("ldap://localhost:10389"),
VelocityEngine.newVelocityEngine(), "(|(mail=$usernamePasswordContext.username)(uid={user}))");
testResolver.setBaseDn("ou=people,dc=shibboleth,dc=net");
@@ -621,7 +622,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testMatchAndAuthorized() throws Exception {
+ @Test public void testMatchAndAuthorized() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -658,7 +659,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testAuthorizedAndKeepContext() throws Exception {
+ @Test public void testAuthorizedAndKeepContext() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -676,7 +677,7 @@ public class LDAPCredentialValidatorTest extends BaseAuthenticationContextTest {
ActionTestingSupport.assertProceedEvent(event);
}
- private void doExtract() throws Exception {
+ private void doExtract() throws ComponentInitializationException {
final ExtractUsernamePasswordFromFormRequest extract = new ExtractUsernamePasswordFromFormRequest();
extract.setHttpServletRequest(action.getHttpServletRequest());
extract.initialize();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateAuthenticationContextTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateAuthenticationContextTest.java
index 8498750a4..d2765e698 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateAuthenticationContextTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateAuthenticationContextTest.java
@@ -20,6 +20,7 @@ package net.shibboleth.idp.authn.impl;
import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.logic.FunctionSupport;
import java.util.Collection;
@@ -36,7 +37,7 @@ import org.testng.annotations.Test;
final public class PopulateAuthenticationContextTest extends BaseAuthenticationContextTest {
@BeforeMethod
- public void setUp() throws Exception {
+ public void setUp() throws ComponentInitializationException {
initializeMembers();
}
@@ -71,7 +72,7 @@ final public class PopulateAuthenticationContextTest extends BaseAuthenticationC
*
* @throws Exception if something goes wrong
*/
- @Test public void testNonIdentical() throws Exception {
+ @Test public void testNonIdentical() throws ComponentInitializationException {
final PopulateAuthenticationContext action = new PopulateAuthenticationContext();
action.setAvailableFlows(authenticationFlows);
@@ -104,7 +105,7 @@ final public class PopulateAuthenticationContextTest extends BaseAuthenticationC
*
* @throws Exception if something goes wrong
*/
- @Test public void testFiltered() throws Exception {
+ @Test public void testFiltered() throws ComponentInitializationException {
final PopulateAuthenticationContext action = new PopulateAuthenticationContext();
action.setAvailableFlows(authenticationFlows);
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 214b04c60..66cc0d7a1 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
@@ -21,6 +21,7 @@ package net.shibboleth.idp.authn.impl;
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.utilities.java.support.component.ComponentInitializationException;
import java.util.Arrays;
@@ -35,7 +36,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
private PreserveAuthenticationFlowState action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new PreserveAuthenticationFlowState();
@@ -44,7 +45,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
action.initialize();
}
- @Test public void testNoServlet() throws Exception {
+ @Test public void testNoServlet() throws ComponentInitializationException {
action = new PreserveAuthenticationFlowState();
action.initialize();
@@ -54,7 +55,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
Assert.assertTrue(prc.getSubcontext(AuthenticationContext.class).getAuthenticationStateMap().isEmpty());
}
- @Test public void testNoParameters() throws Exception {
+ @Test public void testNoParameters() throws ComponentInitializationException {
action = new PreserveAuthenticationFlowState();
action.setHttpServletRequest(new MockHttpServletRequest());
action.initialize();
@@ -65,7 +66,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
Assert.assertTrue(prc.getSubcontext(AuthenticationContext.class).getAuthenticationStateMap().isEmpty());
}
- @Test public void testNoneFound() throws Exception {
+ @Test public void testNoneFound(){
final Event event = action.execute(src);
@@ -73,7 +74,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
Assert.assertTrue(prc.getSubcontext(AuthenticationContext.class).getAuthenticationStateMap().isEmpty());
}
- @Test public void testNoValues() throws Exception {
+ @Test public void testNoValues() {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("foo", (String) null);
@@ -87,7 +88,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
Assert.assertNull(authCtx.getAuthenticationStateMap().get("foo"));
}
- @Test public void testSingleValued() throws Exception {
+ @Test public void testSingleValued() {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("foo", "bar");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("foo2", "bar2");
@@ -102,7 +103,7 @@ public class PreserveAuthenticationFlowStateTest extends BaseAuthenticationConte
Assert.assertEquals(authCtx.getAuthenticationStateMap().get("foo2"), "bar2");
}
- @Test public void testMultiValued() throws Exception {
+ @Test public void testMultiValued() {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("foo", new String[]{"bar", "bar2"});
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java
index 001276069..fa435575f 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java
@@ -45,7 +45,7 @@ public class SelectAuthenticationFlowTest extends BaseAuthenticationContextTest
private SelectAuthenticationFlow action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new SelectAuthenticationFlow();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SimpleSubjectCanonicalizationTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SimpleSubjectCanonicalizationTest.java
index bd9e189a3..22944c895 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SimpleSubjectCanonicalizationTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SimpleSubjectCanonicalizationTest.java
@@ -27,6 +27,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.utilities.java.support.collection.Pair;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
import org.testng.Assert;
@@ -38,7 +39,7 @@ public class SimpleSubjectCanonicalizationTest extends BaseAuthenticationContext
private SimpleSubjectCanonicalization action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new SimpleSubjectCanonicalization();
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 bcebf001e..d4505c73b 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
@@ -26,6 +26,7 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
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.utilities.java.support.component.ComponentInitializationException;
import org.opensaml.storage.impl.MemoryStorageService;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -38,7 +39,7 @@ public class StorageBackedAccountLockoutManagerTest extends BaseAuthenticationCo
private StorageBackedAccountLockoutManager manager;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
final MemoryStorageService ss = new MemoryStorageService();
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 d4103cddf..6a810ad7a 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
@@ -34,6 +34,7 @@ import net.shibboleth.idp.authn.context.UsernamePasswordContext;
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.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.velocity.VelocityEngine;
import org.ldaptive.DefaultConnectionFactory;
@@ -106,7 +107,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
directoryServer.shutDown(true);
}
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
final LDAPCredentialValidator ldap = new LDAPCredentialValidator();
@@ -132,7 +133,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
action.setHttpServletRequest(new MockHttpServletRequest());
}
- @Test public void testBadUsername() throws Exception {
+ @Test public void testBadUsername() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "foo");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -157,7 +158,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("UnknownUsername"));
}
- @Test public void testEmptyPassword() throws Exception {
+ @Test public void testEmptyPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "");
@@ -178,7 +179,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("InvalidPassword"));
}
- @Test public void testBadPassword() throws Exception {
+ @Test public void testBadPassword() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "bar");
@@ -203,7 +204,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("InvalidPassword"));
}
- @Test public void testAuthorized() throws Exception {
+ @Test public void testAuthorized() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -238,7 +239,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- @Test public void testAuthorized2() throws Exception {
+ @Test public void testAuthorized2() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL2");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -273,7 +274,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError("UnknownUsername"));
}
- @Test public void testBadPassword2() throws Exception {
+ @Test public void testBadPassword2() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL2");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -299,7 +300,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
Assert.assertTrue(aec.isClassifiedError(AuthnEventIds.UNKNOWN_USERNAME));
}
- @Test public void testAuthorizedAll() throws Exception {
+ @Test public void testAuthorizedAll() throws ComponentInitializationException {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("username", "PETER_THE_PRINCIPAL");
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("password", "changeit");
@@ -337,7 +338,7 @@ public class ValidateCredentialsTest extends BaseAuthenticationContextTest {
Assert.assertNotNull(lp.getLdapEntry());
}
- private void doExtract() throws Exception {
+ private void doExtract() throws ComponentInitializationException {
final ExtractUsernamePasswordFromFormRequest extract = new ExtractUsernamePasswordFromFormRequest();
extract.setHttpServletRequest(action.getHttpServletRequest());
extract.initialize();
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 9052115f1..140b73a11 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
@@ -35,6 +35,7 @@ import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
import net.shibboleth.idp.authn.principal.UsernamePrincipal;
import net.shibboleth.idp.authn.testing.TestPrincipal;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
import org.testng.Assert;
@@ -48,7 +49,7 @@ public class ValidateExternalAuthenticationTest extends BaseAuthenticationContex
private ValidateExternalAuthentication action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
prc.getSubcontext(AuthenticationContext.class).setAttemptedFlow(authenticationFlows.get(0));
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateFunctionResultTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateFunctionResultTest.java
index 5c48b084e..94c51df26 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateFunctionResultTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateFunctionResultTest.java
@@ -43,7 +43,7 @@ public class ValidateFunctionResultTest extends BaseAuthenticationContextTest {
private ValidateFunctionResult action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
prc.getSubcontext(AuthenticationContext.class).setAttemptedFlow(authenticationFlows.get(0));
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 f412a364b..0759bd1b2 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
@@ -41,7 +41,7 @@ public class ValidateRemoteUserTest extends BaseAuthenticationContextTest {
private ValidateRemoteUser action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ValidateRemoteUser();
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 ac2542727..de8716312 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
@@ -45,7 +45,7 @@ public class ValidateUserAgentAddressTest extends BaseAuthenticationContextTest
private ValidateUserAgentAddress action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ValidateUserAgentAddress();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateX509CertificateTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateX509CertificateTest.java
index cabad0dc1..58ec8f39a 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateX509CertificateTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateX509CertificateTest.java
@@ -93,7 +93,7 @@ public class ValidateX509CertificateTest extends BaseAuthenticationContextTest {
private ValidateX509Certificate action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ValidateX509Certificate();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X500SubjectCanonicalizationTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X500SubjectCanonicalizationTest.java
index d89d14b0c..bcbe52d38 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X500SubjectCanonicalizationTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X500SubjectCanonicalizationTest.java
@@ -27,6 +27,7 @@ import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.utilities.java.support.collection.Pair;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
import org.testng.Assert;
@@ -38,7 +39,7 @@ public class X500SubjectCanonicalizationTest extends BaseAuthenticationContextTe
private X500SubjectCanonicalization action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new X500SubjectCanonicalization();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509ProxyFilterTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509ProxyFilterTest.java
index f633d7a20..c69a666c7 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509ProxyFilterTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/X509ProxyFilterTest.java
@@ -32,6 +32,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
/** {@link X509ProxyFilter} unit test. */
public class X509ProxyFilterTest extends BaseAuthenticationContextTest {
@@ -89,7 +90,7 @@ public class X509ProxyFilterTest extends BaseAuthenticationContextTest {
private MockHttpServletRequest request;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
final MockFilterConfig config = new MockFilterConfig();
@@ -98,7 +99,11 @@ public class X509ProxyFilterTest extends BaseAuthenticationContextTest {
"SSL_CLIENT_CERT_CHAIN_0 SSL_CLIENT_CERT_CHAIN_1 SSL_CLIENT_CERT_CHAIN_2 SSL_CLIENT_CERT_CHAIN_3");
filter = new X509ProxyFilter();
- filter.init(config);
+ try {
+ filter.init(config);
+ } catch (final ServletException e) {
+ throw new ComponentInitializationException(e);
+ }
request = (MockHttpServletRequest) src.getExternalContext().getNativeRequest();
}
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/testing/BaseAuthenticationContextTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/testing/BaseAuthenticationContextTest.java
index 0aa12199e..e1577a510 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/testing/BaseAuthenticationContextTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/testing/BaseAuthenticationContextTest.java
@@ -22,6 +22,7 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.impl.PopulateAuthenticationContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.logic.FunctionSupport;
import java.util.List;
@@ -37,7 +38,7 @@ public class BaseAuthenticationContextTest extends OpenSAMLInitBaseTestCase {
protected ProfileRequestContext prc;
protected List<AuthenticationFlowDescriptor> authenticationFlows;
- protected void initializeMembers() throws Exception {
+ protected void initializeMembers() throws ComponentInitializationException {
src = new RequestContextBuilder().buildRequestContext();
prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
prc.addSubcontext(new AuthenticationContext(), true);
@@ -50,7 +51,7 @@ public class BaseAuthenticationContextTest extends OpenSAMLInitBaseTestCase {
authenticationFlows.get(2).setId("test3");
}
- protected void setUp() throws Exception {
+ protected void setUp() throws ComponentInitializationException {
initializeMembers();
final PopulateAuthenticationContext action = new PopulateAuthenticationContext();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunctionTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunctionTest.java
index 1b7ca3a87..973a08e8c 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunctionTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunctionTest.java
@@ -20,9 +20,11 @@ package net.shibboleth.idp.authn.proxy.impl;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.utilities.java.support.collection.Pair;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.logic.FunctionSupport;
import net.shibboleth.utilities.java.support.net.URISupport;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
@@ -40,7 +42,7 @@ public class DiscoveryProfileRequestFunctionTest extends BaseAuthenticationConte
private DiscoveryProfileRequestFunction function;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
((MockFlowExecutionContext) ((MockRequestContext) src).getFlowExecutionContext()).setKey(new MockFlowExecutionKey("flowkey"));
@@ -50,7 +52,7 @@ public class DiscoveryProfileRequestFunctionTest extends BaseAuthenticationConte
function.initialize();
}
- @Test public void test() throws Exception {
+ @Test public void test() throws MalformedURLException {
final URL url = new URL(function.apply(new Pair<>(src, prc)));
Assert.assertEquals(url.getProtocol(), "https");
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 4437eabba..8d8f04164 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
@@ -22,6 +22,7 @@ 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.utilities.java.support.component.ComponentInitializationException;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.webflow.execution.Event;
@@ -34,7 +35,7 @@ public class ExtractDiscoveryResponseTest extends BaseAuthenticationContextTest
private ExtractDiscoveryResponse action;
- @BeforeMethod public void setUp() throws Exception {
+ @BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
action = new ExtractDiscoveryResponse();
@@ -42,7 +43,7 @@ public class ExtractDiscoveryResponseTest extends BaseAuthenticationContextTest
action.initialize();
}
- @Test public void testNoServlet() throws Exception {
+ @Test public void testNoServlet() throws ComponentInitializationException {
action = new ExtractDiscoveryResponse();
action.initialize();
final Event event = action.execute(src);
@@ -51,14 +52,14 @@ public class ExtractDiscoveryResponseTest extends BaseAuthenticationContextTest
Assert.assertNull(prc.getSubcontext(AuthenticationContext.class).getAuthenticatingAuthority());
}
- @Test public void testFailure() throws Exception {
+ @Test public void testFailure() {
final Event event = action.execute(src);
ActionTestingSupport.assertEvent(event, AuthnEventIds.NO_CREDENTIALS);
Assert.assertNull(prc.getSubcontext(AuthenticationContext.class).getAuthenticatingAuthority());
}
- @Test public void testSuccess() throws Exception {
+ @Test public void testSuccess() {
((MockHttpServletRequest) action.getHttpServletRequest()).addParameter("entityID", "foo");
final Event event = action.execute(src);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list