use of com.amazonaws.athena.connector.lambda.security.LocalKeyFactory in project aws-athena-query-federation by awslabs.
the class TPCDSMetadataHandlerTest method setUp.
@Before
public void setUp() throws Exception {
handler = new TPCDSMetadataHandler(new LocalKeyFactory(), mockSecretsManager, mockAthena, "spillBucket", "spillPrefix");
allocator = new BlockAllocatorImpl();
}
use of com.amazonaws.athena.connector.lambda.security.LocalKeyFactory in project aws-athena-query-federation by awslabs.
the class VerticaMetadataHandlerTest method setUp.
@Before
public void setUp() throws SQLException {
this.verticaConnectionFactory = Mockito.mock(VerticaConnectionFactory.class);
this.verticaSchemaUtils = Mockito.mock(VerticaSchemaUtils.class);
this.queryFactory = Mockito.mock(QueryFactory.class);
this.verticaExportQueryBuilder = Mockito.mock(VerticaExportQueryBuilder.class);
this.connection = Mockito.mock(Connection.class, Mockito.RETURNS_DEEP_STUBS);
this.secretsManager = Mockito.mock(AWSSecretsManager.class);
this.athena = Mockito.mock(AmazonAthena.class);
this.federatedIdentity = Mockito.mock(FederatedIdentity.class);
this.databaseMetaData = Mockito.mock(DatabaseMetaData.class);
this.tableName = Mockito.mock(TableName.class);
this.schema = Mockito.mock(Schema.class);
this.constraints = Mockito.mock(Constraints.class);
this.schemaBuilder = Mockito.mock(SchemaBuilder.class);
this.blockWriter = Mockito.mock(BlockWriter.class);
this.queryStatusChecker = Mockito.mock(QueryStatusChecker.class);
this.amazonS3 = Mockito.mock(AmazonS3.class);
Mockito.when(this.secretsManager.getSecretValue(Mockito.eq(new GetSecretValueRequest().withSecretId("testSecret")))).thenReturn(new GetSecretValueResult().withSecretString("{\"username\": \"testUser\", \"password\": \"testPassword\"}"));
Mockito.when(this.verticaConnectionFactory.getOrCreateConn(anyString())).thenReturn(connection);
Mockito.when(connection.getMetaData()).thenReturn(databaseMetaData);
Mockito.when(amazonS3.getRegion()).thenReturn(Region.US_West_2);
this.verticaMetadataHandler = new VerticaMetadataHandler(new LocalKeyFactory(), verticaConnectionFactory, secretsManager, athena, "spill-bucket", "spill-prefix", verticaSchemaUtils, amazonS3);
this.allocator = new BlockAllocatorImpl();
this.databaseMetaData = this.connection.getMetaData();
verticaMetadataHandlerMocked = Mockito.spy(this.verticaMetadataHandler);
}
use of com.amazonaws.athena.connector.lambda.security.LocalKeyFactory in project aws-athena-query-federation by awslabs.
the class CloudwatchMetadataHandlerTest method setUp.
@Before
public void setUp() throws Exception {
when(mockAwsLogs.describeLogStreams(any(DescribeLogStreamsRequest.class))).thenAnswer((InvocationOnMock invocationOnMock) -> {
return new DescribeLogStreamsResult().withLogStreams(new LogStream().withLogStreamName("table-9"), new LogStream().withLogStreamName("table-10"));
});
when(mockAwsLogs.describeLogGroups(any(DescribeLogGroupsRequest.class))).thenAnswer((InvocationOnMock invocationOnMock) -> {
return new DescribeLogGroupsResult().withLogGroups(new LogGroup().withLogGroupName("schema-1"), new LogGroup().withLogGroupName("schema-20"));
});
handler = new CloudwatchMetadataHandler(mockAwsLogs, new LocalKeyFactory(), mockSecretsManager, mockAthena, "spillBucket", "spillPrefix");
allocator = new BlockAllocatorImpl();
}
use of com.amazonaws.athena.connector.lambda.security.LocalKeyFactory in project aws-athena-query-federation by awslabs.
the class DocDBMetadataHandlerTest method setUp.
@Before
public void setUp() throws Exception {
logger.info("{}: enter", testName.getMethodName());
when(connectionFactory.getOrCreateConn(anyString())).thenReturn(mockClient);
handler = new DocDBMetadataHandler(awsGlue, connectionFactory, new LocalKeyFactory(), secretsManager, mockAthena, "spillBucket", "spillPrefix");
allocator = new BlockAllocatorImpl();
}
use of com.amazonaws.athena.connector.lambda.security.LocalKeyFactory in project aws-athena-query-federation by awslabs.
the class DynamoDBMetadataHandlerTest method setup.
@Before
public void setup() {
logger.info("{}: enter", testName.getMethodName());
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
allocator = new BlockAllocatorImpl();
handler = new DynamoDBMetadataHandler(new LocalKeyFactory(), secretsManager, athena, "spillBucket", "spillPrefix", ddbClient, glueClient);
}
Aggregations