@ContextConfiguration(locations={"/system/conf/global-system.xml","/conf/global.xml","/system/conf/mvc-beans.xml","/system/conf/webflow-config.xml","/test/test-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 |
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 |
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() |
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 |
overrideDirectNamePredicates()
Configure Direct NameID c14n by overriding the activation condition attached to the Direct c14n descriptors.
|
void |
overrideEndStateOutput(String flowID)
Map the
ProfileRequestContext as an end state output attribute with name
END_STATE_OUTPUT_ATTR_NAME by assembling the flow with the given ID and manually setting the output
attributes. |
void |
overrideIPBasedAuthn()
Configure IP address based authentication by assembling the
IP_ADDRESS_AUTHN_FLOW_ID flow for the first
time and overriding the map of allowed principals to IP ranges via the IP_ADDRESS_AUTHN_MAP_BEAN_NAME
bean. |
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 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 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 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 payloadpublic void overrideEndStateOutput(@Nonnull String flowID)
ProfileRequestContext as an end state output attribute with name
END_STATE_OUTPUT_ATTR_NAME by assembling the flow with the given ID and manually setting the output
attributes.flowID - the flow IDpublic void overrideIPBasedAuthn()
IP_ADDRESS_AUTHN_FLOW_ID flow for the first
time and overriding the map of allowed principals to IP ranges via the IP_ADDRESS_AUTHN_MAP_BEAN_NAME
bean.public void overrideDirectNamePredicates()
Copyright © 1999–2014. All rights reserved.