Search in sources :

Example 31 with ListSchemasRequest

use of com.amazonaws.athena.connector.lambda.metadata.ListSchemasRequest in project aws-athena-query-federation by awslabs.

the class DocDBMetadataHandlerTest method doListSchemaNames.

@Test
public void doListSchemaNames() {
    List<String> schemaNames = new ArrayList<>();
    schemaNames.add("schema1");
    schemaNames.add("schema2");
    schemaNames.add("schema3");
    when(mockClient.listDatabaseNames()).thenReturn(StubbingCursor.iterate(schemaNames));
    ListSchemasRequest req = new ListSchemasRequest(IDENTITY, QUERY_ID, DEFAULT_CATALOG);
    ListSchemasResponse res = handler.doListSchemaNames(allocator, req);
    logger.info("doListSchemas - {}", res.getSchemas());
    assertEquals(schemaNames, new ArrayList<>(res.getSchemas()));
}
Also used : ListSchemasRequest(com.amazonaws.athena.connector.lambda.metadata.ListSchemasRequest) ArrayList(java.util.ArrayList) Matchers.anyString(org.mockito.Matchers.anyString) ListSchemasResponse(com.amazonaws.athena.connector.lambda.metadata.ListSchemasResponse) Test(org.junit.Test)

Aggregations

ListSchemasRequest (com.amazonaws.athena.connector.lambda.metadata.ListSchemasRequest)31 Test (org.junit.Test)29 ListSchemasResponse (com.amazonaws.athena.connector.lambda.metadata.ListSchemasResponse)15 ArrayList (java.util.ArrayList)4 InvocationOnMock (org.mockito.invocation.InvocationOnMock)3 FederationRequest (com.amazonaws.athena.connector.lambda.request.FederationRequest)2 Database (com.amazonaws.services.glue.model.Database)2 GetDatabasesResult (com.amazonaws.services.glue.model.GetDatabasesResult)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 Matchers.anyString (org.mockito.Matchers.anyString)2 AmazonServiceException (com.amazonaws.AmazonServiceException)1 BlockAllocatorImpl (com.amazonaws.athena.connector.lambda.data.BlockAllocatorImpl)1 TypedSerDeTest (com.amazonaws.athena.connector.lambda.serde.TypedSerDeTest)1 GetDatabasesRequest (com.amazonaws.services.glue.model.GetDatabasesRequest)1 DescribeLogGroupsRequest (com.amazonaws.services.logs.model.DescribeLogGroupsRequest)1 DescribeLogGroupsResult (com.amazonaws.services.logs.model.DescribeLogGroupsResult)1 LogGroup (com.amazonaws.services.logs.model.LogGroup)1 Database (com.amazonaws.services.timestreamwrite.model.Database)1 ListDatabasesRequest (com.amazonaws.services.timestreamwrite.model.ListDatabasesRequest)1