Package net.shibboleth.idp.attribute.resolver.testing

# Class TestSources

java.lang.Object
net.shibboleth.idp.attribute.resolver.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`
Helper class.
`private static class`
`TestSources.StaticDataConnector`
Helper class.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final StringAttributeValue`
`ATTRIBUTE_ATTRIBUTE_VALUE_RESULT`
A test attribute value.
`static final String`
`ATTRIBUTE_ATTRIBUTE_VALUE_STRING`
A value from the attribute.
`static final StringAttributeValue`
`COMMON_ATTRIBUTE_VALUE_RESULT`
A test attribute value.
`static final String`
`COMMON_ATTRIBUTE_VALUE_STRING`
A value from both providers.
`static final String`
`CONNECTOR_ATTRIBUTE_VALUE_REGEXP`
Regexp (as string).
`static final Pattern`
`CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN`
Regexp.
`static final StringAttributeValue`
`CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT`
Result from a regexp.
`static final StringAttributeValue`
`CONNECTOR_ATTRIBUTE_VALUE_RESULT`
A test attribute value.
`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`
The name of the connector we use as source.
`static final String`
`DEPENDS_ON_SECOND_ATTRIBUTE_NAME`
The name of another attribute we use as source.
`static final String`
`IDP_ENTITY_ID`
A standard IdP EntityID
`static final String`
`PRINCIPAL_ID`
A standard Principal Name
`static final StringAttributeValue[]`
`SECOND_ATTRIBUTE_VALUE_RESULTS`
Some test attributes.
`static final String[]`
`SECOND_ATTRIBUTE_VALUE_STRINGS`
Another attributes values.
`static final String`
`SP_ENTITY_ID`
A standard SP EntityID
`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)`
Build an appropriate `AttributeResolutionContext`.
`static ResolverAttributeDefinitionDependency`
`makeAttributeDefinitionDependency(String attributeId)`
Summon up appropriate `ResolverAttributeDefinitionDependency`.
`static ResolverDataConnectorDependency`
`makeDataConnectorDependency(String connectorId, String attributeId)`
Summon up appropriate `ResolverDataConnectorDependency`.
`static AttributeDefinition`
`populatedStaticAttribute()`
Create a static attribute with known values.
`static AttributeDefinition`
`populatedStaticAttribute(String attributeName, int attributeValuesCount)`
return an `AttributeDefinition` with static contents
`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 @NotEmpty 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 @NotEmpty 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 @NotEmpty public static final String DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR
The name of the connector we use as source.

See Also:
  - Constant Field Values

### DEPENDS_ON_SECOND_ATTRIBUTE_NAME

@Nonnull @NotEmpty 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 @NotEmpty public static final String[] SECOND_ATTRIBUTE_VALUE_STRINGS
Another attributes values.

### SECOND_ATTRIBUTE_VALUE_RESULTS

@Nonnull public static final StringAttributeValue[] SECOND_ATTRIBUTE_VALUE_RESULTS
Some test attributes.

### COMMON_ATTRIBUTE_VALUE_STRING

@Nonnull @NotEmpty 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 test attribute value.

### CONNECTOR_ATTRIBUTE_VALUE_STRING

@Nonnull @NotEmpty 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 test attribute value.

### ATTRIBUTE_ATTRIBUTE_VALUE_STRING

@Nonnull @NotEmpty 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 test attribute value.

### CONNECTOR_ATTRIBUTE_VALUE_REGEXP

@Nonnull @NotEmpty public static final String CONNECTOR_ATTRIBUTE_VALUE_REGEXP
Regexp (as string). 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
Regexp. for CONNECTOR_ATTRIBUTE_VALUE (for map and regexp testing).

### CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT

@Nonnull public static final StringAttributeValue CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT
Result from a regexp.

### TEST_PRINCIPAL

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

See Also:
  - Constant Field Values

### TEST_RELYING_PARTY

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

See Also:
  - Constant Field Values

### TEST_AUTHN_METHOD

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

See Also:
  - Constant Field Values

### IDP_ENTITY_ID

@Nonnull @NotEmpty public static final String IDP_ENTITY_ID
A standard IdP EntityID

See Also:
  - Constant Field Values

### PRINCIPAL_ID

@Nonnull @NotEmpty public static final String PRINCIPAL_ID
A standard Principal Name

See Also:
  - Constant Field Values

### SP_ENTITY_ID

@Nonnull @NotEmpty public static final String SP_ENTITY_ID
A standard SP EntityID

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
return an `AttributeDefinition` with static contents

Parameters:
  `attributeName` - the name
  `attributeValuesCount` - how many (of the fix values) to add
Returns:
  the definition
Throws:
  `ComponentInitializationException` - if intialization fails

### 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)

### createResolutionContext

@Nonnull public static AttributeResolutionContext createResolutionContext(String principal, String issuerID, String recipientId)
Build an appropriate `AttributeResolutionContext`.

Parameters:
  `principal` - the Principal
  `issuerID` - the issues
  `recipientId` - the recipient
Returns:
  the context

### makeAttributeDefinitionDependency

@Nonnull public static ResolverAttributeDefinitionDependency makeAttributeDefinitionDependency(@Nonnull String attributeId)
Summon up appropriate `ResolverAttributeDefinitionDependency`.

Parameters:
  `attributeId` - what to depend on
Returns:
  the dependency

### makeDataConnectorDependency

@Nonnull public static ResolverDataConnectorDependency makeDataConnectorDependency(@Nonnull String connectorId, @Nullable String attributeId)
Summon up appropriate `ResolverDataConnectorDependency`.

Parameters:
  `connectorId` - connector to depend on
  `attributeId` - attribute to depend on
Returns:
  the dependency