Package org.opensaml.saml.saml1.testing

# Class SAML1ActionTestingSupport

java.lang.Object
org.opensaml.saml.saml1.testing.SAML1ActionTestingSupport

public class SAML1ActionTestingSupport extends Object
Helper methods for creating/testing SAML 1 objects within profile action tests. When methods herein refer to mock objects they are always objects that have been created via Mockito unless otherwise noted.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ASSERTION_ID`
ID used for all generated `Assertion` objects.
`static final String`
`REQUEST_ID`
ID used for all generated `Response` objects.
`static final String`
`RESPONSE_ID`
ID used for all generated `Response` objects.

## Constructor Summary

Constructors
Constructor
Description
`SAML1ActionTestingSupport()`

## Method Summary

Modifier and Type
Method
Description
`static Request`
`buildArtifactRequest(String... artifacts)`
Builds a `Request` containing `AssertionArtifact`s.
`static Assertion`
`buildAssertion()`
Builds an empty assertion.
`static Request`
`buildAttributeQueryRequest(Subject subject)`
Builds a `Request` containing an `AttributeQuery`.
`static AttributeStatement`
`buildAttributeStatement()`
Builds an empty attribute statement.
`static AuthenticationStatement`
`buildAuthenticationStatement()`
Builds an authentication statement.
`static Response`
`buildResponse()`
Builds an empty response.
`static Subject`
`buildSubject(String principalName)`
Builds a `Subject`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### REQUEST_ID

public static final String REQUEST_ID
ID used for all generated `Response` objects.

See Also:
  - Constant Field Values

### RESPONSE_ID

public static final String RESPONSE_ID
ID used for all generated `Response` objects.

See Also:
  - Constant Field Values

### ASSERTION_ID

public static final String ASSERTION_ID
ID used for all generated `Assertion` objects.

See Also:
  - Constant Field Values

## Constructor Details

### SAML1ActionTestingSupport

public SAML1ActionTestingSupport()

## Method Details

### buildResponse

@Nonnull public static Response buildResponse()
Builds an empty response. The ID of the message is `ActionTestingSupport.OUTBOUND_MSG_ID`, the issue instant is 1970-01-01T00:00:00Z and the SAML version is `SAMLVersion.VERSION_11`.

Returns:
  the constructed response

### buildAssertion

@Nonnull public static Assertion buildAssertion()
Builds an empty assertion. The ID of the message is `ASSERTION_ID`, the issue instant is 1970-01-01T00:00:00Z and the SAML version is `SAMLVersion.VERSION_11`.

Returns:
  the constructed assertion

### buildAuthenticationStatement

@Nonnull public static AuthenticationStatement buildAuthenticationStatement()
Builds an authentication statement. The authn instant is set to 1970-01-01T00:00:00Z and the method is set to password.

Returns:
  the constructed statement

### buildAttributeStatement

@Nonnull public static AttributeStatement buildAttributeStatement()
Builds an empty attribute statement.

Returns:
  the constructed statement

### buildSubject

@Nonnull public static Subject buildSubject(@Nullable String principalName)
Builds a `Subject`. If a principal name is given a `NameIdentifier`, whose value is the given principal name, will be created and added to the `Subject`.

Parameters:
  `principalName` - the principal name to add to the subject
Returns:
  the built subject

### buildAttributeQueryRequest

@Nonnull public static Request buildAttributeQueryRequest(@Nullable Subject subject)
Builds a `Request` containing an `AttributeQuery`. If a `Subject` is given, it will be added to the constructed `AttributeQuery`.

Parameters:
  `subject` - the subject to add to the query
Returns:
  the built query

### buildArtifactRequest

@Nonnull public static Request buildArtifactRequest(@Nullable String... artifacts)
Builds a `Request` containing `AssertionArtifact`s.

Parameters:
  `artifacts` - the artifacts to add to the request
Returns:
  the built request