Search in sources :

Example 1 with PostGreSqlQueryStringBuilder

use of com.amazonaws.athena.connectors.postgresql.PostGreSqlQueryStringBuilder in project aws-athena-query-federation by awslabs.

the class RedshiftRecordHandlerTest 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 PostGreSqlQueryStringBuilder("\"");
    final DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", REDSHIFT_NAME, "redshift://jdbc:redshift://hostname/user=A&password=B");
    this.redshiftRecordHandler = new RedshiftRecordHandler(databaseConnectionConfig, amazonS3, secretsManager, athena, jdbcConnectionFactory, jdbcSplitQueryBuilder);
}
Also used : JdbcConnectionFactory(com.amazonaws.athena.connectors.jdbc.connection.JdbcConnectionFactory) AmazonS3(com.amazonaws.services.s3.AmazonS3) 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) PostGreSqlQueryStringBuilder(com.amazonaws.athena.connectors.postgresql.PostGreSqlQueryStringBuilder) 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 PostGreSqlQueryStringBuilder (com.amazonaws.athena.connectors.postgresql.PostGreSqlQueryStringBuilder)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