### Question:
ElasticsearchMetadataHandler extends GlueMetadataHandler { @Override public ListSchemasResponse doListSchemaNames(BlockAllocator allocator, ListSchemasRequest request) { logger.debug("doListSchemaNames: enter - " + request); return new ListSchemasResponse(request.getCatalogName(), domainMap.keySet()); } ElasticsearchMetadataHandler(); @VisibleForTesting protected  ElasticsearchMetadataHandler(AWSGlue awsGlue,
                                           EncryptionKeyFactory keyFactory,
                                           AWSSecretsManager awsSecretsManager,
                                           AmazonAthena athena,
                                           String spillBucket,
                                           String spillPrefix,
                                           ElasticsearchDomainMapProvider domainMapProvider,
                                           AwsRestHighLevelClientFactory clientFactory,
                                           long queryTimeout); @Override ListSchemasResponse doListSchemaNames(BlockAllocator allocator, ListSchemasRequest request); @Override ListTablesResponse doListTables(BlockAllocator allocator, ListTablesRequest request); @Override GetTableResponse doGetTable(BlockAllocator allocator, GetTableRequest request); @Override void getPartitions(BlockWriter blockWriter, GetTableLayoutRequest request, QueryStatusChecker queryStatusChecker); @Override GetSplitsResponse doGetSplits(BlockAllocator allocator, GetSplitsRequest request);  }### Answer:
@Test public void doListSchemaNames() { logger.info("doListSchemaNames - enter"); ListSchemasResponse mockDomains = new ListSchemasResponse("elasticsearch", ImmutableList.of("domain2", "domain3", "domain1")); when(domainMapProvider.getDomainMap(null)).thenReturn(ImmutableMap.of("domain1", "endpoint1", "domain2", "endpoint2","domain3", "endpoint3")); handler = new ElasticsearchMetadataHandler(awsGlue, new LocalKeyFactory(), awsSecretsManager, amazonAthena, "spill-bucket", "spill-prefix", domainMapProvider, clientFactory, 10); ListSchemasRequest req = new ListSchemasRequest(fakeIdentity(), "queryId", "elasticsearch"); ListSchemasResponse realDomains = handler.doListSchemaNames(allocator, req); logger.info("doListSchemaNames - {}", realDomains.getSchemas()); assertFalse("Real domain list has no domain names!", realDomains.getSchemas().isEmpty()); assertTrue("Real and mocked domain responses have different domains!", domainsEqual(realDomains.getSchemas(), mockDomains.getSchemas())); logger.info("doListSchemaNames - exit"); }