[java-idp-testbed COMMIT] in /trunk/src/test/java/idp: AbstractFlowTest.java saml1/AbstractSAML1FlowTest.java saml1/S...

noreply at shibboleth.net noreply at shibboleth.net
Wed Apr 30 11:50:56 EDT 2014


Author: tzeller
Date: Wed Apr 30 11:50:56 2014
New Revision: 211

URL: http://svn.shibboleth.net/view/java-idp-testbed?rev=211&view=rev
Log:
Remove the end state output attribute mapping used in the testbed from the abstract SAML flow definition. Instead, manually assembly flows and the output attribute mapper.

Modified:
    trunk/src/test/java/idp/AbstractFlowTest.java
    trunk/src/test/java/idp/saml1/AbstractSAML1FlowTest.java
    trunk/src/test/java/idp/saml1/SAML1AttributeQueryFlowTest.java
    trunk/src/test/java/idp/saml1/SAML1UnsolicitedSSOFlowTest.java
    trunk/src/test/java/idp/saml2/AbstractSAML2FlowTest.java
    trunk/src/test/java/idp/saml2/SAML2AttributeQueryFlowTest.java
    trunk/src/test/java/idp/saml2/SAML2POSTSSOFlowTest.java
    trunk/src/test/java/idp/saml2/SAML2RedirectSSOFlowTest.java
    trunk/src/test/java/idp/saml2/SAML2UnsolicitedSSOFlowTest.java

Modified: trunk/src/test/java/idp/AbstractFlowTest.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/test/java/idp/AbstractFlowTest.java?rev=211&r1=210&r2=211&view=diff
==============================================================================
--- trunk/src/test/java/idp/AbstractFlowTest.java (original)
+++ trunk/src/test/java/idp/AbstractFlowTest.java Wed Apr 30 11:50:56 2014
@@ -41,16 +41,26 @@
 import org.opensaml.soap.soap11.Envelope;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.binding.expression.Expression;
+import org.springframework.binding.expression.ExpressionParser;
+import org.springframework.binding.expression.support.FluentParserContext;
+import org.springframework.binding.mapping.impl.DefaultMapper;
+import org.springframework.binding.mapping.impl.DefaultMapping;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
 import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.mock.web.MockHttpServletResponse;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
 import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.webflow.core.collection.MutableAttributeMap;
 import org.springframework.webflow.definition.FlowDefinition;
+import org.springframework.webflow.engine.EndState;
 import org.springframework.webflow.execution.FlowExecutionOutcome;
+import org.springframework.webflow.execution.RequestContext;
 import org.springframework.webflow.executor.FlowExecutionResult;
 import org.springframework.webflow.executor.FlowExecutor;
 import org.springframework.webflow.executor.FlowExecutorImpl;
+import org.springframework.webflow.expression.spel.WebFlowSpringELExpressionParser;
 import org.springframework.webflow.test.MockExternalContext;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
@@ -77,9 +87,6 @@
     /** Path to LDIF file to be imported into directory server. */
     @Nonnull public final static String LDIF_FILE = "src/main/resources/test/ldap.ldif";
 
-    /** Name of flow output attribute containing the profile request context. */
-    @Nonnull public final static String OUTPUT_ATTR_NAME = "ProfileRequestContext";
-
     /** The IDP entity ID. */
     @Nonnull public final static String IDP_ENTITY_ID = "https://idp.example.org";
 
@@ -91,6 +98,16 @@
 
     /** The SP relay state. */
     @Nonnull public final static String SP_RELAY_STATE = "myRelayState";
+
+    /** The end state ID. */
+    @Nonnull public final static String END_STATE_ID = "end";
+
+    /** The end state output attribute expression which retrieves the profile request context. */
+    @Nonnull public final static String END_STATE_OUTPUT_ATTR_EXPR =
+            "flowRequestContext.getConversationScope().get('org.opensaml.profile.context.ProfileRequestContext')";
+
+    /** The name of the end state flow output attribute containing the profile request context. */
+    @Nonnull public final static String END_STATE_OUTPUT_ATTR_NAME = "ProfileRequestContext";
 
     /** The name of the bean which maps principals to IP ranges for IP address based authn. */
     @Nonnull public final static String IP_ADDRESS_AUTHN_MAP_BEAN_NAME = "shibboleth.authn.IPAddress.Mappings";
@@ -215,8 +232,8 @@
     public void assertFlowExecutionOutcome(@Nullable final FlowExecutionOutcome outcome) {
         Assert.assertNotNull(outcome, "Flow ended with an error");
         Assert.assertEquals(outcome.getId(), "end");
-        Assert.assertTrue(outcome.getOutput().contains(OUTPUT_ATTR_NAME));
-        Assert.assertTrue(outcome.getOutput().get(OUTPUT_ATTR_NAME) instanceof ProfileRequestContext);
+        Assert.assertTrue(outcome.getOutput().contains(END_STATE_OUTPUT_ATTR_NAME));
+        Assert.assertTrue(outcome.getOutput().get(END_STATE_OUTPUT_ATTR_NAME) instanceof ProfileRequestContext);
     }
 
     /**
@@ -251,6 +268,33 @@
     }
 
     /**
+     * Map the {@link ProfileRequestContext} as an end state output attribute with name

[... 150 lines stripped ...]


More information about the commits mailing list