@ContextConfiguration(locations={"/system/conf/global-system.xml","/system/conf/mvc-beans.xml","/system/conf/webflow-config.xml","/test/test-beans.xml","/test/override-beans.xml"}, initializers=net.shibboleth.idp.spring.IdPPropertiesApplicationContextInitializer.class, loader=PreferFileSystemContextLoader.class) @WebAppConfiguration public abstract class AbstractFlowTest extends AbstractTestNGSpringContextTests
| Modifier and Type | Field and Description |
|---|---|
protected static org.opensaml.core.xml.XMLObjectBuilderFactory |
builderFactory
XMLObject builder factory
|
protected net.shibboleth.ext.spring.factory.X509CertificateFactoryBean |
certFactoryBean
SP certificate wired via test/test-beans.xml.
|
protected InMemoryDirectory |
directoryServer
In-memory directory server.
|
static String |
END_STATE_ID
The end state ID.
|
static String |
END_STATE_OUTPUT_ATTR_EXPR
The end state output attribute expression which retrieves the profile request context.
|
static String |
END_STATE_OUTPUT_ATTR_NAME
The name of the end state flow output attribute containing the profile request context.
|
protected org.springframework.webflow.test.MockExternalContext |
externalContext
Mock external context.
|
protected org.springframework.webflow.executor.FlowExecutor |
flowExecutor
The web flow executor.
|
protected net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy |
idGenerator
UUID identifier generation strategy.
|
static String |
IDP_ENTITY_ID
The IDP entity ID.
|
protected org.opensaml.security.credential.Credential |
idpCredential
IdP credential wired via test/test-beans.xml.
|
static String |
IP_ADDRESS_AUTHN_FLOW_ID
The flow ID for IP address based authn.
|
static String |
IP_ADDRESS_AUTHN_MAP_BEAN_NAME
The name of the bean which maps principals to IP ranges for IP address based authn.
|
static String |
KEYSTORE_FILE
Path to keystore file to be used by the directory server.
|
static String |
LDIF_FILE
Path to LDIF file to be imported into directory server.
|
private static Logger |
log
Logger.
|
protected static org.opensaml.core.xml.io.MarshallerFactory |
marshallerFactory
XMLObject marshaller factory
|
protected static net.shibboleth.utilities.java.support.xml.ParserPool |
parserPool
Parser pool
|
protected MockHttpServletRequest |
request
Mock request.
|
protected MockHttpServletResponse |
response
Mock response.
|
static String |
SAML1_TRANSFORM_C14N_BEAN_NAME
The name of the bean defining the SAML 1 Direct c14n descriptor.
|
static String |
SAML2_TRANSFORM_C14N_BEAN_NAME
The name of the bean defining the SAML 2 Direct c14n descriptor.
|
static String |
SP_ACS_URL
The SP ACS URL.
|
static String |
SP_ENTITY_ID
The SP entity ID.
|
static String |
SP_RELAY_STATE
The SP relay state.
|
protected org.opensaml.security.credential.Credential |
spCredential
SP credential wired via test/test-beans.xml.
|
protected static org.opensaml.core.xml.io.UnmarshallerFactory |
unmarshallerFactory
XMLObject unmarshaller factory
|
applicationContext, logger| Constructor and Description |
|---|
AbstractFlowTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
assertFlowExecutionOutcome(org.springframework.webflow.execution.FlowExecutionOutcome outcome)
Assert that the flow execution outcome is not null and its id equals "end".
|
void |
assertFlowExecutionOutcome(org.springframework.webflow.execution.FlowExecutionOutcome outcome,
String endStateId)
Assert that the flow execution outcome is not null and its id equals the given end state id.
|
void |
assertFlowExecutionResult(org.springframework.webflow.executor.FlowExecutionResult result,
String flowID)
Assert that the flow execution result is not null, has ended, and its flow id equals the given flow id.
|
void |
assertProfileRequestContext(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Assert that the profile request context has an outbound message context and that the outbound message context has
a message.
|
static org.opensaml.soap.soap11.Envelope |
buildSOAP11Envelope(org.opensaml.core.xml.XMLObject payload)
Build a SOAP11
Envelope with the given payload. |
void |
clearThreadLocals()
HttpServletRequestResponseContext.clearCurrent() |
org.springframework.webflow.engine.Flow |
getFlow(String flowID)
Get the
Flow with the given flow ID. |
void |
initializeFlowExecutor()
Initialize the web flow executor.
|
void |
initializeMocks()
Initialize mock request, response, and external context.
|
void |
initializeThreadLocals()
HttpServletRequestResponseContext.loadCurrent(HttpServletRequest, HttpServletResponse) |
void |
initializeXMLObjectSupport()
Initialize XMLObject support classes.
|
void |
overrideEndStateOutput(String flowID)
Map the
ProfileRequestContext as an end state output attribute with name
"ProfileRequestContext" by assembling the flow with the given flow ID and manually setting the
output attributes of the end state with ID "end". |
void |
overrideEndStateOutput(String flowID,
String endStateId)
Map the
ProfileRequestContext as an end state output attribute with name
"ProfileRequestContext" by assembling the flow with the given flow ID and manually setting the
output attributes of the end state with the given id. |
void |
registerFlowsInParentRegistry(String flowID,
String childRegistryID)
Add flows defined in a child flow definition registry to its parent registry.
|
org.opensaml.profile.context.ProfileRequestContext |
retrieveProfileRequestContext(org.springframework.webflow.executor.FlowExecutionResult result)
Get the
ProfileRequestContext from the output attributes of the result. |
static void |
setAuthnFlowsProperty()
Sets the 'idp.authn.flows' property to "Password".
|
static void |
setIdPHomeProperty()
Set the 'idp.home' property to "classpath:".
|
void |
setupDirectoryServer()
Creates an UnboundID in-memory directory server.
|
void |
teardownDirectoryServer()
Shutdown the in-memory directory server.
|
run, setApplicationContext, springTestContextAfterTestClass, springTestContextAfterTestMethod, springTestContextBeforeTestClass, springTestContextBeforeTestMethod, springTestContextPrepareTestInstance@Nonnull public static final String LDIF_FILE
@Nonnull public static final String KEYSTORE_FILE
@Nonnull public static final String IDP_ENTITY_ID
@Nonnull public static final String SP_ENTITY_ID
@Nonnull public static final String SP_ACS_URL
@Nonnull public static final String SP_RELAY_STATE
@Nonnull public static final String END_STATE_ID
@Nonnull public static final String END_STATE_OUTPUT_ATTR_EXPR
@Nonnull public static final String END_STATE_OUTPUT_ATTR_NAME
@Nonnull public static final String IP_ADDRESS_AUTHN_MAP_BEAN_NAME
@Nonnull public static final String IP_ADDRESS_AUTHN_FLOW_ID
@Nonnull public static final String SAML1_TRANSFORM_C14N_BEAN_NAME
@Nonnull public static final String SAML2_TRANSFORM_C14N_BEAN_NAME
@NonnullAfterInit protected InMemoryDirectory directoryServer
@Nonnull protected org.springframework.webflow.test.MockExternalContext externalContext
@Nonnull protected org.springframework.webflow.executor.FlowExecutor flowExecutor
@Nonnull protected MockHttpServletRequest request
@Nonnull protected MockHttpServletResponse response
@NonnullAfterInit protected static net.shibboleth.utilities.java.support.xml.ParserPool parserPool
@NonnullAfterInit protected static org.opensaml.core.xml.XMLObjectBuilderFactory builderFactory
@NonnullAfterInit protected static org.opensaml.core.xml.io.MarshallerFactory marshallerFactory
@NonnullAfterInit protected static org.opensaml.core.xml.io.UnmarshallerFactory unmarshallerFactory
@Nonnull protected net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy idGenerator
@Qualifier(value="test.idp.Credential") @Autowired protected org.opensaml.security.credential.Credential idpCredential
@Qualifier(value="test.sp.Credential") @Autowired protected org.opensaml.security.credential.Credential spCredential
@Autowired @Qualifier(value="test.sp.X509Certificate") protected net.shibboleth.ext.spring.factory.X509CertificateFactoryBean certFactoryBean
public static void setIdPHomeProperty()
public static void setAuthnFlowsProperty()
public void clearThreadLocals()
HttpServletRequestResponseContext.clearCurrent()public void initializeFlowExecutor()
public void initializeMocks()
public void initializeThreadLocals()
HttpServletRequestResponseContext.loadCurrent(HttpServletRequest, HttpServletResponse)public void initializeXMLObjectSupport()
public void setupDirectoryServer()
throws com.unboundid.ldap.sdk.LDAPException,
IOException
com.unboundid.ldap.sdk.LDAPException - if the in-memory directory server cannot be createdIOException - if the LDIF resource cannot be importedpublic void teardownDirectoryServer()
public void assertFlowExecutionResult(@Nullable org.springframework.webflow.executor.FlowExecutionResult result, @Nonnull String flowID)
result - the flow execution resultflowID - the flow idpublic void assertFlowExecutionOutcome(@Nullable org.springframework.webflow.execution.FlowExecutionOutcome outcome)
ProfileRequestContext.outcome - the flow execution outcomepublic void assertFlowExecutionOutcome(@Nullable org.springframework.webflow.execution.FlowExecutionOutcome outcome, @Nullable String endStateId)
ProfileRequestContext.outcome - the flow execution outcomeendStateId - the end state idpublic void assertProfileRequestContext(@Nullable org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - the profile request context@Nonnull public static org.opensaml.soap.soap11.Envelope buildSOAP11Envelope(@Nonnull org.opensaml.core.xml.XMLObject payload)
Envelope with the given payload.payload - the payload@Nonnull public org.springframework.webflow.engine.Flow getFlow(@Nonnull String flowID)
Flow with the given flow ID.flowID - the flow IDFlowFlowDefinitionLocator#getFlowDefinition(String)}public void overrideEndStateOutput(@Nonnull String flowID)
ProfileRequestContext as an end state output attribute with name
"ProfileRequestContext" by assembling the flow with the given flow ID and manually setting the
output attributes of the end state with ID "end".flowID - the flow IDpublic void overrideEndStateOutput(@Nonnull String flowID, @Nonnull String endStateId)
ProfileRequestContext as an end state output attribute with name
"ProfileRequestContext" by assembling the flow with the given flow ID and manually setting the
output attributes of the end state with the given id.flowID - the flow IDendStateId - the end state IDpublic void registerFlowsInParentRegistry(@Nonnull String flowID, @Nonnull String childRegistryID)
flowID - the flow IDchildRegistryID - the child flow registry ID@Nullable public org.opensaml.profile.context.ProfileRequestContext retrieveProfileRequestContext(@Nonnull org.springframework.webflow.executor.FlowExecutionResult result)
ProfileRequestContext from the output attributes of the result.result - the flow execution resultCopyright © 1999–2015. All rights reserved.