Class TestSources
java.lang.Object
net.shibboleth.idp.attribute.resolver.testing.TestSources
Basic data sources for testing the attribute generators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classHelper class.private static classHelper class. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttributeValueA test attribute value.static final StringA value from the attribute.static final StringAttributeValueA test attribute value.static final StringA value from both providers.static final StringRegexp (as string).static final PatternRegexp.static final StringAttributeValueResult from a regexp.static final StringAttributeValueA test attribute value.static final StringA value from the connector.static final StringThe name of the attribute we use as source.static final StringThe name of the connector we use as source.static final StringThe name of another attribute we use as source.static final StringA standard IdP EntityIDstatic final StringA standard Principal Namestatic final StringAttributeValue[]Some test attributes.static final String[]Another attributes values.static final StringA standard SP EntityIDstatic final StringThe name we use in this test for the static connector.static final StringAuthentication method for Principal method testsstatic final StringPrincipal name for Principal method testsstatic final StringRelying party name for Principal method tests -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeResolutionContextcreateResolutionContext(String principal, String issuerID, String recipientId) Build an appropriateAttributeResolutionContext.makeAttributeDefinitionDependency(String attributeId) Summon up appropriateResolverAttributeDefinitionDependency.makeDataConnectorDependency(String connectorId, String attributeId) Summon up appropriateResolverDataConnectorDependency.static AttributeDefinitionCreate a static attribute with known values.static AttributeDefinitionpopulatedStaticAttribute(String attributeName, int attributeValuesCount) return anAttributeDefinitionwith static contentsstatic AttributeDefinitionpopulatedStaticAttribute(IdPAttribute attribute) Create a static attribute with known attribute.static DataConnectorCreate a static connector with known attributes and values.static DataConnectorpopulatedStaticConnector(List<IdPAttribute> attributes) Create a static connector with provided attributes and values.
-
Field Details
-
STATIC_CONNECTOR_NAME
The name we use in this test for the static connector.- See Also:
-
DEPENDS_ON_ATTRIBUTE_NAME_ATTR
The name of the attribute we use as source.- See Also:
-
DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR
The name of the connector we use as source.- See Also:
-
DEPENDS_ON_SECOND_ATTRIBUTE_NAME
The name of another attribute we use as source.- See Also:
-
SECOND_ATTRIBUTE_VALUE_STRINGS
Another attributes values. -
SECOND_ATTRIBUTE_VALUE_RESULTS
Some test attributes. -
COMMON_ATTRIBUTE_VALUE_STRING
A value from both providers.- See Also:
-
COMMON_ATTRIBUTE_VALUE_RESULT
A test attribute value. -
CONNECTOR_ATTRIBUTE_VALUE_STRING
A value from the connector.- See Also:
-
CONNECTOR_ATTRIBUTE_VALUE_RESULT
A test attribute value. -
ATTRIBUTE_ATTRIBUTE_VALUE_STRING
A value from the attribute.- See Also:
-
ATTRIBUTE_ATTRIBUTE_VALUE_RESULT
A test attribute value. -
CONNECTOR_ATTRIBUTE_VALUE_REGEXP
Regexp (as string). for CONNECTOR_ATTRIBUTE_VALUE (for map and regexp testing).- See Also:
-
CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN
Regexp. for CONNECTOR_ATTRIBUTE_VALUE (for map and regexp testing). -
CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT
Result from a regexp. -
TEST_PRINCIPAL
Principal name for Principal method tests- See Also:
-
TEST_RELYING_PARTY
Relying party name for Principal method tests- See Also:
-
TEST_AUTHN_METHOD
Authentication method for Principal method tests- See Also:
-
IDP_ENTITY_ID
A standard IdP EntityID- See Also:
-
PRINCIPAL_ID
A standard Principal Name- See Also:
-
SP_ENTITY_ID
A standard SP EntityID- See Also:
-
-
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 ComponentInitializationExceptionCreate 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 ComponentInitializationExceptionCreate 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 anAttributeDefinitionwith static contents- Parameters:
attributeName- the nameattributeValuesCount- 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 appropriateAttributeResolutionContext.- Parameters:
principal- the PrincipalissuerID- the issuesrecipientId- the recipient- Returns:
- the context
-
makeAttributeDefinitionDependency
@Nonnull public static ResolverAttributeDefinitionDependency makeAttributeDefinitionDependency(@Nonnull String attributeId) Summon up appropriateResolverAttributeDefinitionDependency.- Parameters:
attributeId- what to depend on- Returns:
- the dependency
-
makeDataConnectorDependency
@Nonnull public static ResolverDataConnectorDependency makeDataConnectorDependency(@Nonnull String connectorId, @Nullable String attributeId) Summon up appropriateResolverDataConnectorDependency.- Parameters:
connectorId- connector to depend onattributeId- attribute to depend on- Returns:
- the dependency
-