[java-identity-provider] branch master updated: Fix failing tests.
Scott Cantor
cantor.2 at osu.edu
Mon Jan 14 17:22:37 EST 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=1c20356308e78ab9e32d5e592a18d008c56dc8f4
The following commit(s) were added to refs/heads/master by this push:
new 1c20356 Fix failing tests.
1c20356 is described below
commit 1c20356308e78ab9e32d5e592a18d008c56dc8f4
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jan 14 17:22:34 2019 -0500
Fix failing tests.
---
.../idp/authn/AuthenticationFlowDescriptor.java | 2 +-
idp-saml-impl/pom.xml | 6 ++++++
.../AddAuthenticationStatementToAssertionTest.java | 14 +++++++++++++-
.../impl/AddAuthnStatementToAssertionTest.java | 19 ++++++++++++++++---
4 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
index fe18087..4a40a6b 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
@@ -340,7 +340,7 @@ public class AuthenticationFlowDescriptor extends AbstractIdentifiableInitializa
public void setPrincipalWeightMap(@Nullable @NonnullElements final Map<Principal,Integer> map) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
- principalWeightMap = map != null ? map : Collections.emptyMap();
+ principalWeightMap = map != null ? map : Collections.<Principal,Integer>emptyMap();
}
/** {@inheritDoc} */
diff --git a/idp-saml-impl/pom.xml b/idp-saml-impl/pom.xml
index ffccf42..71e95cc 100644
--- a/idp-saml-impl/pom.xml
+++ b/idp-saml-impl/pom.xml
@@ -118,6 +118,12 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>idp-authn-impl</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>idp-session-impl</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
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 8367b59..a40b2a1 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
@@ -19,10 +19,12 @@ package net.shibboleth.idp.saml.saml1.profile.impl;
import javax.security.auth.Subject;
+import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
import net.shibboleth.idp.authn.AuthenticationResult;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
+import net.shibboleth.idp.authn.impl.DefaultAuthenticationResultSerializer;
import net.shibboleth.idp.profile.ActionTestingSupport;
import org.opensaml.profile.action.EventIds;
@@ -39,6 +41,7 @@ import org.opensaml.core.OpenSAMLInitBaseTestCase;
import org.opensaml.saml.saml1.core.Assertion;
import org.opensaml.saml.saml1.core.AuthenticationStatement;
import org.opensaml.saml.saml1.core.Response;
+import org.opensaml.storage.StorageSerializer;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
@@ -104,7 +107,16 @@ public class AddAuthenticationStatementToAssertionTest extends OpenSAMLInitBaseT
// this is here to allow the event's creation time to deviate from the 'start' time
Thread.sleep(50);
- prc.getSubcontext(AuthenticationContext.class, true).setAuthenticationResult(
+ final StorageSerializer<AuthenticationResult> serializer = new DefaultAuthenticationResultSerializer();
+ serializer.initialize();
+
+ final AuthenticationFlowDescriptor fd = new AuthenticationFlowDescriptor();
+ fd.setId("Test");
+ fd.setResultSerializer(serializer);
+ fd.initialize();
+
+ prc.getSubcontext(AuthenticationContext.class, true).getAvailableFlows().put("Test", fd);
+ prc.getSubcontext(AuthenticationContext.class).setAuthenticationResult(
new AuthenticationResult("Test", new AuthenticationMethodPrincipal("Test")));
((MockHttpServletRequest) action.getHttpServletRequest()).setRemoteAddr("127.0.0.1");
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 f11b5d6..d0bd2da 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
@@ -21,10 +21,12 @@ import java.util.Arrays;
import javax.security.auth.Subject;
+import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
import net.shibboleth.idp.authn.AuthenticationResult;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
+import net.shibboleth.idp.authn.impl.DefaultAuthenticationResultSerializer;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
import net.shibboleth.idp.profile.ActionTestingSupport;
@@ -45,6 +47,7 @@ import org.opensaml.saml.saml2.core.Assertion;
import org.opensaml.saml.saml2.core.AuthnContext;
import org.opensaml.saml.saml2.core.AuthnStatement;
import org.opensaml.saml.saml2.core.Response;
+import org.opensaml.storage.StorageSerializer;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
@@ -105,13 +108,23 @@ public class AddAuthnStatementToAssertionTest extends OpenSAMLInitBaseTestCase {
}
/** Test that the authentication statement is properly added.
- * @throws InterruptedException */
- @Test public void testAddAuthenticationStatement() throws InterruptedException {
+ * @throws InterruptedException
+ * @throws ComponentInitializationException */
+ @Test public void testAddAuthenticationStatement() throws InterruptedException, ComponentInitializationException {
final long now = System.currentTimeMillis();
// this is here to allow the event's creation time to deviate from the 'start' time
Thread.sleep(50);
- prc.getSubcontext(AuthenticationContext.class, true).setAuthenticationResult(
+ final StorageSerializer<AuthenticationResult> serializer = new DefaultAuthenticationResultSerializer();
+ serializer.initialize();
+
+ final AuthenticationFlowDescriptor fd = new AuthenticationFlowDescriptor();
+ fd.setId("Test");
+ fd.setResultSerializer(serializer);
+ fd.initialize();
+
+ prc.getSubcontext(AuthenticationContext.class, true).getAvailableFlows().put("Test", fd);
+ prc.getSubcontext(AuthenticationContext.class).setAuthenticationResult(
new AuthenticationResult("Test", new AuthnContextClassRefPrincipal("Test")));
((MockHttpServletRequest) action.getHttpServletRequest()).setRemoteAddr("127.0.0.1");
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list