use of com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig 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);
}
use of com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig in project aws-athena-query-federation by awslabs.
the class TeradataMuxJdbcMetadataHandlerTest method setup.
@Before
public void setup() {
this.allocator = new BlockAllocatorImpl();
this.teradataMetadataHandler = Mockito.mock(TeradataMetadataHandler.class);
this.metadataHandlerMap = Collections.singletonMap("fakedatabase", this.teradataMetadataHandler);
this.secretsManager = Mockito.mock(AWSSecretsManager.class);
this.athena = Mockito.mock(AmazonAthena.class);
this.queryStatusChecker = Mockito.mock(QueryStatusChecker.class);
this.jdbcConnectionFactory = Mockito.mock(JdbcConnectionFactory.class);
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", "fakedatabase", "fakedatabase://jdbc:fakedatabase://hostname/${testSecret}", "testSecret");
this.jdbcMetadataHandler = new TeradataMuxMetadataHandler(this.secretsManager, this.athena, this.jdbcConnectionFactory, this.metadataHandlerMap, databaseConnectionConfig);
}
use of com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig in project aws-athena-query-federation by awslabs.
the class TeradataRecordHandlerTest 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 TeradataQueryStringBuilder("`");
final DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", TeradataConstants.TERADATA_NAME, "teradata://jdbc:teradata://115.113.87.100/TMODE=ANSI,CHARSET=UTF8,DATABASE=TEST,USER=DBC,PASSWORD=DBC");
this.teradataRecordHandler = new TeradataRecordHandler(databaseConnectionConfig, amazonS3, secretsManager, athena, jdbcConnectionFactory, jdbcSplitQueryBuilder);
}
use of com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig in project aws-athena-query-federation by awslabs.
the class SynapseMuxRecordHandlerTest method setup.
@Before
public void setup() {
this.synapseRecordHandler = Mockito.mock(SynapseRecordHandler.class);
this.recordHandlerMap = Collections.singletonMap(SynapseConstants.NAME, this.synapseRecordHandler);
this.amazonS3 = Mockito.mock(AmazonS3.class);
this.secretsManager = Mockito.mock(AWSSecretsManager.class);
this.athena = Mockito.mock(AmazonAthena.class);
this.queryStatusChecker = Mockito.mock(QueryStatusChecker.class);
this.jdbcConnectionFactory = Mockito.mock(JdbcConnectionFactory.class);
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", SynapseConstants.NAME, "synapse://jdbc:sqlserver://hostname;${testSecret}", "testSecret");
this.jdbcRecordHandler = new SynapseMuxRecordHandler(this.amazonS3, this.secretsManager, this.athena, this.jdbcConnectionFactory, databaseConnectionConfig, this.recordHandlerMap);
}
use of com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig in project aws-athena-query-federation by awslabs.
the class SqlServerMuxRecordHandlerTest method setup.
@Before
public void setup() {
this.sqlServerRecordHandler = Mockito.mock(SqlServerRecordHandler.class);
this.recordHandlerMap = Collections.singletonMap(SqlServerConstants.NAME, this.sqlServerRecordHandler);
this.amazonS3 = Mockito.mock(AmazonS3.class);
this.secretsManager = Mockito.mock(AWSSecretsManager.class);
this.athena = Mockito.mock(AmazonAthena.class);
this.queryStatusChecker = Mockito.mock(QueryStatusChecker.class);
this.jdbcConnectionFactory = Mockito.mock(JdbcConnectionFactory.class);
DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", SqlServerConstants.NAME, "sqlserver://jdbc:sqlserver://hostname;${testSecret}", "testSecret");
this.jdbcRecordHandler = new SqlServerMuxRecordHandler(this.amazonS3, this.secretsManager, this.athena, this.jdbcConnectionFactory, databaseConnectionConfig, this.recordHandlerMap);
}
Aggregations