Class CreateResourceHandlerTestBuilder
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.create.CreateResourceHandlerBuilder
-
- com.snowflake.connectors.application.ingestion.create.CreateResourceHandlerTestBuilder
-
public class CreateResourceHandlerTestBuilder extends com.snowflake.connectors.application.ingestion.create.CreateResourceHandlerBuilder
Test builder for theCreateResourceHandler
.Allows for customization of the following handler components:
ConnectorErrorHelper
ResourceIngestionDefinitionRepository
IngestionProcessRepository
TransactionManager
-
-
Constructor Summary
Constructors Constructor Description CreateResourceHandlerTestBuilder()
Creates a new, emptyCreateResourceHandlerTestBuilder
.CreateResourceHandlerTestBuilder(Session session)
Creates a newCreateResourceHandlerTestBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateResourceHandlerTestBuilder
withCreateResourceValidator(com.snowflake.connectors.application.ingestion.create.CreateResourceValidator validator)
Sets the CreateResourceValidator used to build the handler instance.CreateResourceHandlerTestBuilder
withErrorHelper(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.CreateResourceHandlerTestBuilder
withIngestionProcessRepository(com.snowflake.connectors.application.ingestion.process.IngestionProcessRepository ingestionProcessRepository)
Sets the ingestion process repository used to build the handler instance.CreateResourceHandlerTestBuilder
withPostCreateResourceCallback(com.snowflake.connectors.application.ingestion.create.PostCreateResourceCallback callback)
Sets the PostCreateResourceCallback used to build the handler instance.CreateResourceHandlerTestBuilder
withPreCreateResourceCallback(com.snowflake.connectors.application.ingestion.create.PreCreateResourceCallback callback)
Sets the PreCreateResourceCallback used to build the handler instance.CreateResourceHandlerTestBuilder
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.CreateResourceHandlerTestBuilder
withTransactionManager(com.snowflake.connectors.util.snowflake.TransactionManager transactionManager)
Sets the transaction manager used to build the handler instance.
-
-
-
Constructor Detail
-
CreateResourceHandlerTestBuilder
public CreateResourceHandlerTestBuilder()
Creates a new, emptyCreateResourceHandlerTestBuilder
.Properties of the new builder instance must be fully customized before a handler instance can be built.
-
CreateResourceHandlerTestBuilder
public CreateResourceHandlerTestBuilder(Session session)
Creates a newCreateResourceHandlerTestBuilder
.The properties of this builder are initialised with:
ConnectorErrorHelper
built usingbuildDefault
- a default implementation of
ResourceIngestionDefinitionRepository
, created for theVariantResource
- a default implementation of
IngestionProcessRepository
- Parameters:
session
- Snowpark session object- Throws:
NullPointerException
- if the provided session object is null
-
-
Method Detail
-
withErrorHelper
public CreateResourceHandlerTestBuilder withErrorHelper(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.- Overrides:
withErrorHelper
in classcom.snowflake.connectors.application.ingestion.create.CreateResourceHandlerBuilder
- Parameters:
errorHelper
- connector error helper- Returns:
- this builder
-
withResourceIngestionDefinitionRepository
public CreateResourceHandlerTestBuilder 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
-
withCreateResourceValidator
public CreateResourceHandlerTestBuilder withCreateResourceValidator(com.snowflake.connectors.application.ingestion.create.CreateResourceValidator validator)
Sets the CreateResourceValidator used to build the handler instance. It allows to add connector-specific logic which validates whether a resource can be created.- Overrides:
withCreateResourceValidator
in classcom.snowflake.connectors.application.ingestion.create.CreateResourceHandlerBuilder
- Parameters:
validator
- custom callback implementation- Returns:
- this builder
-
withPreCreateResourceCallback
public CreateResourceHandlerTestBuilder withPreCreateResourceCallback(com.snowflake.connectors.application.ingestion.create.PreCreateResourceCallback callback)
Sets the PreCreateResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked before a resource is created.- Overrides:
withPreCreateResourceCallback
in classcom.snowflake.connectors.application.ingestion.create.CreateResourceHandlerBuilder
- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
withPostCreateResourceCallback
public CreateResourceHandlerTestBuilder withPostCreateResourceCallback(com.snowflake.connectors.application.ingestion.create.PostCreateResourceCallback callback)
Sets the PostCreateResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked after a resource is created.- Overrides:
withPostCreateResourceCallback
in classcom.snowflake.connectors.application.ingestion.create.CreateResourceHandlerBuilder
- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
withIngestionProcessRepository
public CreateResourceHandlerTestBuilder 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
-
withTransactionManager
public CreateResourceHandlerTestBuilder 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
-
-