### Question:
DynamoDBMetadataHandler extends GlueMetadataHandler { @Override public ListSchemasResponse doListSchemaNames(BlockAllocator allocator, ListSchemasRequest request) throws Exception { Set<String> combinedSchemas = new LinkedHashSet<>(); if (glueClient != null) { try { combinedSchemas.addAll(super.doListSchemaNames(allocator, request, DB_FILTER).getSchemas()); } catch (RuntimeException e) { logger.warn("doListSchemaNames: Unable to retrieve schemas from AWSGlue.", e); } } combinedSchemas.add(DEFAULT_SCHEMA); return new ListSchemasResponse(request.getCatalogName(), combinedSchemas); } DynamoDBMetadataHandler(); @VisibleForTesting  DynamoDBMetadataHandler(EncryptionKeyFactory keyFactory,
            AWSSecretsManager secretsManager,
            AmazonAthena athena,
            String spillBucket,
            String spillPrefix,
            AmazonDynamoDB ddbClient,
            AWSGlue glueClient); @Override ListSchemasResponse doListSchemaNames(BlockAllocator allocator, ListSchemasRequest request); @Override ListTablesResponse doListTables(BlockAllocator allocator, ListTablesRequest request); @Override GetTableResponse doGetTable(BlockAllocator allocator, GetTableRequest request); @Override void enhancePartitionSchema(SchemaBuilder partitionSchemaBuilder, GetTableLayoutRequest request); @Override void getPartitions(BlockWriter blockWriter, GetTableLayoutRequest request, QueryStatusChecker queryStatusChecker); @Override GetSplitsResponse doGetSplits(BlockAllocator allocator, GetSplitsRequest request);  }### Answer:
@Test public void doListSchemaNamesGlueError() throws Exception { when(glueClient.getDatabases(any())).thenThrow(new AmazonServiceException("")); ListSchemasRequest req = new ListSchemasRequest(TEST_IDENTITY, TEST_QUERY_ID, TEST_CATALOG_NAME); ListSchemasResponse res = handler.doListSchemaNames(allocator, req); logger.info("doListSchemas - {}", res.getSchemas()); assertThat(new ArrayList<>(res.getSchemas()), equalTo(Collections.singletonList(DEFAULT_SCHEMA))); }
@Test public void doListSchemaNamesGlue() throws Exception { GetDatabasesResult result = new GetDatabasesResult().withDatabaseList( new Database().withName(DEFAULT_SCHEMA), new Database().withName("ddb").withLocationUri(DYNAMO_DB_FLAG), new Database().withName("s3").withLocationUri("blah")); when(glueClient.getDatabases(any())).thenReturn(result); ListSchemasRequest req = new ListSchemasRequest(TEST_IDENTITY, TEST_QUERY_ID, TEST_CATALOG_NAME); ListSchemasResponse res = handler.doListSchemaNames(allocator, req); logger.info("doListSchemas - {}", res.getSchemas()); assertThat(res.getSchemas().size(), equalTo(2)); assertThat(res.getSchemas().contains("default"), is(true)); assertThat(res.getSchemas().contains("ddb"), is(true)); }