Search in sources :

Example 1 with SnowflakeQueryStringBuilder

use of com.amazonaws.athena.connectors.snowflake.SnowflakeQueryStringBuilder in project aws-athena-query-federation by awslabs.

the class SnowflakeRecordHandlerTest method setup.

@Before
public void setup() {
    this.amazonS3 = Mockito.mock(AmazonS3.class);
    this.secretsManager = Mockito.mock(AWSSecretsManager.class);
    this.athena = Mockito.mock(AmazonAthena.class);
    this.connection = Mockito.mock(Connection.class);
    this.jdbcConnectionFactory = Mockito.mock(JdbcConnectionFactory.class);
    Mockito.when(this.jdbcConnectionFactory.getConnection(Mockito.mock(JdbcCredentialProvider.class))).thenReturn(this.connection);
    jdbcSplitQueryBuilder = new SnowflakeQueryStringBuilder("`");
    final DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", SnowflakeConstants.SNOWFLAKE_NAME, "snowflake://jdbc:snowflake://hostname/?warehouse=warehousename&db=dbname&schema=schemaname&user=xxx&password=xxx");
    this.snowflakeRecordHandler = new SnowflakeRecordHandler(databaseConnectionConfig, amazonS3, secretsManager, athena, jdbcConnectionFactory, jdbcSplitQueryBuilder);
}
Also used : JdbcConnectionFactory(com.amazonaws.athena.connectors.jdbc.connection.JdbcConnectionFactory) SnowflakeQueryStringBuilder(com.amazonaws.athena.connectors.snowflake.SnowflakeQueryStringBuilder) AmazonS3(com.amazonaws.services.s3.AmazonS3) SnowflakeRecordHandler(com.amazonaws.athena.connectors.snowflake.SnowflakeRecordHandler) AWSSecretsManager(com.amazonaws.services.secretsmanager.AWSSecretsManager) Connection(java.sql.Connection) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) JdbcCredentialProvider(com.amazonaws.athena.connectors.jdbc.connection.JdbcCredentialProvider) AmazonAthena(com.amazonaws.services.athena.AmazonAthena) Before(org.junit.Before)

Aggregations

DatabaseConnectionConfig (com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig)1 JdbcConnectionFactory (com.amazonaws.athena.connectors.jdbc.connection.JdbcConnectionFactory)1 JdbcCredentialProvider (com.amazonaws.athena.connectors.jdbc.connection.JdbcCredentialProvider)1 SnowflakeQueryStringBuilder (com.amazonaws.athena.connectors.snowflake.SnowflakeQueryStringBuilder)1 SnowflakeRecordHandler (com.amazonaws.athena.connectors.snowflake.SnowflakeRecordHandler)1 AmazonAthena (com.amazonaws.services.athena.AmazonAthena)1 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 AWSSecretsManager (com.amazonaws.services.secretsmanager.AWSSecretsManager)1 Connection (java.sql.Connection)1 Before (org.junit.Before)1