Class EnableResourceHandlerTestBuilder


  • public class EnableResourceHandlerTestBuilder
    extends com.snowflake.connectors.application.ingestion.enable.EnableResourceHandlerBuilder
    Test builder for the EnableResourceHandler.

    Allows for customization of the following handler components:

    • ConnectorErrorHelper
    • ResourceIngestionDefinitionRepository
    • IngestionProcessRepository
    • TransactionManager
    • Constructor Detail

      • EnableResourceHandlerTestBuilder

        public EnableResourceHandlerTestBuilder()
        Creates a new, empty EnableResourceHandlerTestBuilder.

        Properties of the new builder instance must be fully customized before a handler instance can be built.

      • EnableResourceHandlerTestBuilder

        public EnableResourceHandlerTestBuilder​(Session session)
        Creates a new EnableResourceHandlerTestBuilder.

        The properties of this builder are initialised with:

        • ConnectorErrorHelper built using buildDefault
        • a default implementation of ResourceIngestionDefinitionRepository, created for the VariantResource
        • a default implementation of IngestionProcessRepository
        Parameters:
        session - Snowpark session object
        Throws:
        NullPointerException - if the provided session object is null
    • Method Detail

      • withErrorHelper

        public EnableResourceHandlerTestBuilder withErrorHelper​(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)
        Sets the error helper used to build the handler instance.
        Overrides:
        withErrorHelper in class com.snowflake.connectors.application.ingestion.enable.EnableResourceHandlerBuilder
        Parameters:
        errorHelper - connector error helper
        Returns:
        this builder
      • withResourceIngestionDefinitionRepository

        public EnableResourceHandlerTestBuilder withResourceIngestionDefinitionRepository​(com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<com.snowflake.connectors.application.ingestion.definition.VariantResource> resourceIngestionDefinitionRepository)
        Sets the resource ingestion definition repository used to build the handler instance.
        Parameters:
        resourceIngestionDefinitionRepository - resource ingestion definition repository
        Returns:
        this builder
      • withIngestionProcessRepository

        public EnableResourceHandlerTestBuilder withIngestionProcessRepository​(com.snowflake.connectors.application.ingestion.process.IngestionProcessRepository ingestionProcessRepository)
        Sets the ingestion process repository used to build the handler instance.
        Parameters:
        ingestionProcessRepository - ingestion process repository
        Returns:
        this builder
      • withEnableResourceValidator

        public EnableResourceHandlerTestBuilder withEnableResourceValidator​(com.snowflake.connectors.application.ingestion.enable.EnableResourceValidator validator)
        Sets the EnableResourceValidator used to build the handler instance. It allows to add connector-specific logic which validates whether a resource can be enabled.
        Overrides:
        withEnableResourceValidator in class com.snowflake.connectors.application.ingestion.enable.EnableResourceHandlerBuilder
        Parameters:
        validator - custom callback implementation
        Returns:
        this builder
      • withPreEnableResourceCallback

        public EnableResourceHandlerTestBuilder withPreEnableResourceCallback​(com.snowflake.connectors.application.ingestion.enable.PreEnableResourceCallback callback)
        Sets the PreEnableResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked before a resource is enabled.
        Overrides:
        withPreEnableResourceCallback in class com.snowflake.connectors.application.ingestion.enable.EnableResourceHandlerBuilder
        Parameters:
        callback - custom callback implementation
        Returns:
        this builder
      • withPostEnableResourceCallback

        public EnableResourceHandlerTestBuilder withPostEnableResourceCallback​(com.snowflake.connectors.application.ingestion.enable.PostEnableResourceCallback callback)
        Sets the PostEnableResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked after a resource is enabled.
        Overrides:
        withPostEnableResourceCallback in class com.snowflake.connectors.application.ingestion.enable.EnableResourceHandlerBuilder
        Parameters:
        callback - custom callback implementation
        Returns:
        this builder
      • withTransactionManager

        public EnableResourceHandlerTestBuilder withTransactionManager​(com.snowflake.connectors.util.snowflake.TransactionManager transactionManager)
        Sets the transaction manager used to build the handler instance.
        Parameters:
        transactionManager - transaction manager
        Returns:
        this builder