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.
  • 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:
    • 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:
    • DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR

      @Nonnull public static final String DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR
      a attribute connector to depend upon.
      See Also:
    • 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:
    • SECOND_ATTRIBUTE_VALUE_STRINGS

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

      @Nonnull public static final net.shibboleth.idp.attribute.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:
    • COMMON_ATTRIBUTE_VALUE_RESULT

      @Nonnull public static final net.shibboleth.idp.attribute.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:
    • CONNECTOR_ATTRIBUTE_VALUE_RESULT

      @Nonnull public static final net.shibboleth.idp.attribute.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:
    • ATTRIBUTE_ATTRIBUTE_VALUE_RESULT

      @Nonnull public static final net.shibboleth.idp.attribute.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:
    • CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN

      @Nonnull public static final Pattern CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN
    • CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT

      @Nonnull public static final net.shibboleth.idp.attribute.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:
    • TEST_RELYING_PARTY

      @Nonnull public static final String TEST_RELYING_PARTY
      Relying party name for Principal method tests
      See Also:
    • TEST_AUTHN_METHOD

      @Nonnull public static final String TEST_AUTHN_METHOD
      Authentication method for Principal method tests
      See Also:
    • IDP_ENTITY_ID

      @Nonnull public static final String IDP_ENTITY_ID
      "https://idp.example.org/idp".
      See Also:
    • PRINCIPAL_ID

      @Nonnull public static final String PRINCIPAL_ID
      "PETER_THE_PRINCIPAL".
      See Also:
    • SP_ENTITY_ID

      @Nonnull public static final String SP_ENTITY_ID
      "https://sp.example.org/sp".
      See Also:
  • Constructor Details

    • TestSources

      private TestSources()
      Constructor.
  • Method Details

    • populatedStaticConnector

      @Nonnull public static net.shibboleth.idp.attribute.resolver.DataConnector populatedStaticConnector(@Nonnull List<net.shibboleth.idp.attribute.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 net.shibboleth.idp.attribute.resolver.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 net.shibboleth.idp.attribute.resolver.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 net.shibboleth.idp.attribute.resolver.AttributeDefinition populatedStaticAttribute(@Nonnull String attributeName, int attributeValuesCount) throws ComponentInitializationException
      Throws:
      ComponentInitializationException
    • populatedStaticAttribute

      @Nonnull public static net.shibboleth.idp.attribute.resolver.AttributeDefinition populatedStaticAttribute(@Nonnull net.shibboleth.idp.attribute.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 net.shibboleth.idp.attribute.resolver.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

      public static net.shibboleth.idp.attribute.resolver.context.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 net.shibboleth.idp.attribute.resolver.ResolverAttributeDefinitionDependency makeAttributeDefinitionDependency(@Nonnull String attributeId)
      Make a ResolverAttributeDefinitionDependency.
      Parameters:
      attributeId - attributeId
      Returns:
      the dependency
    • makeDataConnectorDependency

      @Nonnull public static net.shibboleth.idp.attribute.resolver.ResolverDataConnectorDependency makeDataConnectorDependency(@Nonnull String connectorId, @Nullable String attributeId)
      Make a ResolverDataConnectorDependency.
      Parameters:
      connectorId - connectorId
      attributeId - attributeId
      Returns:
      the dependency