Package net.shibboleth.idp.saml.impl.testing

# Class TestSources

java.lang.Object
net.shibboleth.idp.saml.impl.testing.TestSources

public final class TestSources extends Object
Basic data sources for testing the attribute generators.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`private static class`
`TestSources.StaticAttributeDefinition`
A static `AttributeDefinition` for testing.
`private static class`
`TestSources.StaticDataConnector`
A static `DataConnector`.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final StringAttributeValue`
`ATTRIBUTE_ATTRIBUTE_VALUE_RESULT`
A `StringAttributeValue` with value "at1-Attribute".
`static final String`
`ATTRIBUTE_ATTRIBUTE_VALUE_STRING`
A value from the attribute.
`static final StringAttributeValue`
`COMMON_ATTRIBUTE_VALUE_RESULT`
A `StringAttributeValue` with value "at1-Data".
`static final String`
`COMMON_ATTRIBUTE_VALUE_STRING`
A value from both providers.
`static final String`
`CONNECTOR_ATTRIBUTE_VALUE_REGEXP`
Regexp.
`static final Pattern`
`CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN`
a `Pattern` derived from `CONNECTOR_ATTRIBUTE_VALUE_REGEXP`.
`static final StringAttributeValue`
`CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT`
A `StringAttributeValue` with value "Connect".
`static final StringAttributeValue`
`CONNECTOR_ATTRIBUTE_VALUE_RESULT`
A `StringAttributeValue` with value "at1-Data".
`static final String`
`CONNECTOR_ATTRIBUTE_VALUE_STRING`
A value from the connector.
`static final String`
`DEPENDS_ON_ATTRIBUTE_NAME_ATTR`
The name of the attribute we use as source.
`static final String`
`DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR`
a attribute connector to depend upon.
`static final String`
`DEPENDS_ON_SECOND_ATTRIBUTE_NAME`
The name of another attribute we use as source.
`static final String`
`IDP_ENTITY_ID`
"https://idp.example.org/idp".
`static final String`
`PRINCIPAL_ID`
"PETER_THE_PRINCIPAL".
`static final StringAttributeValue[]`
`SECOND_ATTRIBUTE_VALUE_RESULTS`
Still more attributes values.
`static final String[]`
`SECOND_ATTRIBUTE_VALUE_STRINGS`
Another attributes values.
`static final String`
`SP_ENTITY_ID`
"https://sp.example.org/sp".
`static final String`
`STATIC_CONNECTOR_NAME`
The name we use in this test for the static connector.
`static final String`
`TEST_AUTHN_METHOD`
Authentication method for Principal method tests.
`static final String`
`TEST_PRINCIPAL`
Principal name for Principal method tests.
`static final String`
`TEST_RELYING_PARTY`
Relying party name for Principal method tests.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`TestSources()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static AttributeResolutionContext`
`createResolutionContext(String principal, String issuerID, String recipientId)`
Create a `AttributeResolutionContext`.
`static ResolverAttributeDefinitionDependency`
`makeAttributeDefinitionDependency(String attributeId)`
Make a `ResolverAttributeDefinitionDependency`.
`static ResolverDataConnectorDependency`
`makeDataConnectorDependency(String connectorId, String attributeId)`
Make a `ResolverDataConnectorDependency`.
`static AttributeDefinition`
`nonStringAttributeDefiniton(String name)`
Return a `SAML2NameIDAttributeDefinition` (which doesn't carry string atribure values).
`static AttributeDefinition`
`populatedStaticAttribute()`
Create a static attribute with known values.
`static AttributeDefinition`
`populatedStaticAttribute(String attributeName, int attributeValuesCount)`
Build a Static attribute definition.
`static AttributeDefinition`
`populatedStaticAttribute(IdPAttribute attribute)`
Create a static attribute with known attribute.
`static DataConnector`
`populatedStaticConnector()`
Create a static connector with known attributes and values.
`static DataConnector`
`populatedStaticConnector(List<IdPAttribute> attributes)`
Create a static connector with provided attributes and values.

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

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

## Field Details

### STATIC_CONNECTOR_NAME

@Nonnull public static final String STATIC_CONNECTOR_NAME
The name we use in this test for the static connector.

See Also:
  - Constant Field Values

### DEPENDS_ON_ATTRIBUTE_NAME_ATTR

@Nonnull public static final String DEPENDS_ON_ATTRIBUTE_NAME_ATTR
The name of the attribute we use as source.

See Also:
  - Constant Field Values

### DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR

@Nonnull public static final String DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR
a attribute connector to depend upon.

See Also:
  - Constant Field Values

### DEPENDS_ON_SECOND_ATTRIBUTE_NAME

@Nonnull public static final String DEPENDS_ON_SECOND_ATTRIBUTE_NAME
The name of another attribute we use as source.

See Also:
  - Constant Field Values

### SECOND_ATTRIBUTE_VALUE_STRINGS

@Nonnull public static final String[] SECOND_ATTRIBUTE_VALUE_STRINGS
Another attributes values.

### SECOND_ATTRIBUTE_VALUE_RESULTS

@Nonnull public static final StringAttributeValue[] SECOND_ATTRIBUTE_VALUE_RESULTS
Still more attributes values.

### COMMON_ATTRIBUTE_VALUE_STRING

@Nonnull public static final String COMMON_ATTRIBUTE_VALUE_STRING
A value from both providers.

See Also:
  - Constant Field Values

### COMMON_ATTRIBUTE_VALUE_RESULT

@Nonnull public static final StringAttributeValue COMMON_ATTRIBUTE_VALUE_RESULT
A `StringAttributeValue` with value "at1-Data".

### CONNECTOR_ATTRIBUTE_VALUE_STRING

@Nonnull public static final String CONNECTOR_ATTRIBUTE_VALUE_STRING
A value from the connector.

See Also:
  - Constant Field Values

### CONNECTOR_ATTRIBUTE_VALUE_RESULT

@Nonnull public static final StringAttributeValue CONNECTOR_ATTRIBUTE_VALUE_RESULT
A `StringAttributeValue` with value "at1-Data".

### ATTRIBUTE_ATTRIBUTE_VALUE_STRING

@Nonnull public static final String ATTRIBUTE_ATTRIBUTE_VALUE_STRING
A value from the attribute.

See Also:
  - Constant Field Values

### ATTRIBUTE_ATTRIBUTE_VALUE_RESULT

@Nonnull public static final StringAttributeValue ATTRIBUTE_ATTRIBUTE_VALUE_RESULT
A `StringAttributeValue` with value "at1-Attribute".

### CONNECTOR_ATTRIBUTE_VALUE_REGEXP

@Nonnull public static final String CONNECTOR_ATTRIBUTE_VALUE_REGEXP
Regexp. for CONNECTOR_ATTRIBUTE_VALUE (for map and regexp testing).

See Also:
  - Constant Field Values

### CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN

@Nonnull public static final Pattern CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN
a `Pattern` derived from `CONNECTOR_ATTRIBUTE_VALUE_REGEXP`.

### CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT

@Nonnull public static final StringAttributeValue CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT
A `StringAttributeValue` with value "Connect".

### TEST_PRINCIPAL

@Nonnull public static final String TEST_PRINCIPAL
Principal name for Principal method tests.

See Also:
  - Constant Field Values

### TEST_RELYING_PARTY

@Nonnull public static final String TEST_RELYING_PARTY
Relying party name for Principal method tests.

See Also:
  - Constant Field Values

### TEST_AUTHN_METHOD

@Nonnull public static final String TEST_AUTHN_METHOD
Authentication method for Principal method tests.

See Also:
  - Constant Field Values

### IDP_ENTITY_ID

@Nonnull public static final String IDP_ENTITY_ID
"https://idp.example.org/idp".

See Also:
  - Constant Field Values

### PRINCIPAL_ID

@Nonnull public static final String PRINCIPAL_ID
"PETER_THE_PRINCIPAL".

See Also:
  - Constant Field Values

### SP_ENTITY_ID

@Nonnull public static final String SP_ENTITY_ID
"https://sp.example.org/sp".

See Also:
  - Constant Field Values

## Constructor Details

### TestSources

private TestSources()
Constructor.

## Method Details

### populatedStaticConnector

@Nonnull public static DataConnector populatedStaticConnector(@Nonnull List<IdPAttribute> attributes) throws ComponentInitializationException
Create a static connector with provided attributes and values.

Parameters:
  `attributes` - the objects to populate it with
Returns:
  The connector
Throws:
  `ComponentInitializationException` - if we cannot initialized (unlikely)

### populatedStaticConnector

@Nonnull public static DataConnector populatedStaticConnector() throws ComponentInitializationException
Create a static connector with known attributes and values.

Returns:
  The connector
Throws:
  `ComponentInitializationException` - if we cannot initialized (unlikely)

### populatedStaticAttribute

@Nonnull public static AttributeDefinition populatedStaticAttribute() throws ComponentInitializationException
Create a static attribute with known values.

Returns:
  the attribute definition
Throws:
  `ComponentInitializationException` - if we cannot initialized (unlikely)

### populatedStaticAttribute

@Nonnull public static AttributeDefinition populatedStaticAttribute(@Nonnull String attributeName, int attributeValuesCount) throws ComponentInitializationException
Build a Static attribute definition.

Parameters:
  `attributeName` - name of attribute
  `attributeValuesCount` - count of values
Returns:
  the definition
Throws:
  `ComponentInitializationException` - if the definition fails to init

### populatedStaticAttribute

@Nonnull public static AttributeDefinition populatedStaticAttribute(@Nonnull IdPAttribute attribute) throws ComponentInitializationException
Create a static attribute with known attribute.

Parameters:
  `attribute` - the input attribute
Returns:
  the attribute definition
Throws:
  `ComponentInitializationException` - if we cannot initialized (unlikely)

### nonStringAttributeDefiniton

@Nonnull public static AttributeDefinition nonStringAttributeDefiniton(@Nonnull String name) throws ComponentInitializationException
Return a `SAML2NameIDAttributeDefinition` (which doesn't carry string atribure values).

Parameters:
  `name` - the name
Returns:
  the definition
Throws:
  `ComponentInitializationException` - for completeness

### createResolutionContext

@Nonnull public static AttributeResolutionContext createResolutionContext(@Nonnull String principal, @Nonnull String issuerID, @Nonnull String recipientId)
Create a `AttributeResolutionContext`.

Parameters:
  `principal` - principal
  `issuerID` - issuerID
  `recipientId` - recipientId
Returns:
  the freshly minted context

### makeAttributeDefinitionDependency

@Nonnull public static ResolverAttributeDefinitionDependency makeAttributeDefinitionDependency(@Nonnull String attributeId)
Make a `ResolverAttributeDefinitionDependency`.

Parameters:
  `attributeId` - attributeId
Returns:
  the dependency

### makeDataConnectorDependency

@Nonnull public static ResolverDataConnectorDependency makeDataConnectorDependency(@Nonnull String connectorId, @Nullable String attributeId)
Make a `ResolverDataConnectorDependency`.

Parameters:
  `connectorId` - connectorId
  `attributeId` - attributeId
Returns:
  the dependency