use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.
the class HiveMuxMetadataHandlerTest method doGetTable.
@Test
public void doGetTable() throws Exception {
GetTableRequest getTableRequest = Mockito.mock(GetTableRequest.class);
Mockito.when(getTableRequest.getCatalogName()).thenReturn("metaHive");
this.jdbcMetadataHandler.doGetTable(this.allocator, getTableRequest);
Mockito.verify(this.hiveMetadataHandler, Mockito.times(1)).doGetTable(Mockito.eq(this.allocator), Mockito.eq(getTableRequest));
}
use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.
the class AwsCmdbMetadataHandlerTest method doGetTable.
@Test
public void doGetTable() {
GetTableRequest request = new GetTableRequest(identity, queryId, catalog, new TableName("schema1", "table1"));
when(mockTableProvider1.getTable(eq(blockAllocator), eq(request))).thenReturn(mock(GetTableResponse.class));
GetTableResponse response = handler.doGetTable(blockAllocator, request);
assertNotNull(response);
verify(mockTableProvider1, times(1)).getTable(eq(blockAllocator), eq(request));
}
use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.
the class ImpalaMuxMetadataHandlerTest method doGetTable.
@Test
public void doGetTable() {
GetTableRequest getTableRequest = Mockito.mock(GetTableRequest.class);
Mockito.when(getTableRequest.getCatalogName()).thenReturn("metaImpala");
this.jdbcMetadataHandler.doGetTable(this.allocator, getTableRequest);
Mockito.verify(this.impalaMetadataHandler, Mockito.times(1)).doGetTable(Mockito.eq(this.allocator), Mockito.eq(getTableRequest));
}
use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.
the class MetricsMetadataHandlerTest method doGetMetricsTable.
@Test
public void doGetMetricsTable() {
logger.info("doGetMetricsTable - enter");
GetTableRequest metricsTableReq = new GetTableRequest(identity, "queryId", "default", new TableName(defaultSchema, "metrics"));
GetTableResponse metricsTableRes = handler.doGetTable(allocator, metricsTableReq);
logger.info("doGetMetricsTable - {} {}", metricsTableRes.getTableName(), metricsTableRes.getSchema());
assertEquals(new TableName(defaultSchema, "metrics"), metricsTableRes.getTableName());
assertNotNull(metricsTableRes.getSchema());
assertEquals(6, metricsTableRes.getSchema().getFields().size());
logger.info("doGetMetricsTable - exit");
}
use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.
the class DataLakeGen2MuxMetadataHandlerTest method doGetTable.
@Test
public void doGetTable() {
GetTableRequest getTableRequest = Mockito.mock(GetTableRequest.class);
Mockito.when(getTableRequest.getCatalogName()).thenReturn("fakedatabase");
this.jdbcMetadataHandler.doGetTable(this.allocator, getTableRequest);
Mockito.verify(this.dataLakeGen2MetadataHandler, Mockito.times(1)).doGetTable(Mockito.eq(this.allocator), Mockito.eq(getTableRequest));
}
Aggregations