Source:
public TestInformationSchemaMetadata() { MockConnectorFactory.Builder builder = new MockConnectorFactory.Builder(); MockConnectorFactory mockConnectorFactory = builder.withListSchemaNames(connectorSession -> ImmutableList.of("test_schema")) .withListTables((connectorSession, schemaNameOrNull) -> ImmutableList.of( new SchemaTableName("test_schema", "test_view"), new SchemaTableName("test_schema", "another_table"))) .withGetViews((connectorSession, prefix) -> { String viewJson = VIEW_DEFINITION_JSON_CODEC.toJson(new ViewDefinition("select 1", Optional.of("test_catalog"), Optional.of("test_schema"), ImmutableList.of(), Optional.empty())); SchemaTableName viewName = new SchemaTableName("test_schema", "test_view"); return ImmutableMap.of(viewName, new ConnectorViewDefinition(viewName, Optional.empty(), viewJson)); }) .withGetColumnHandles((connectorSession, tableHandle) -> { throw new UnsupportedOperationException(); }) .build(); Connector testConnector = mockConnectorFactory.create("test", ImmutableMap.of(), new TestingConnectorContext()); CatalogManager catalogManager = new CatalogManager(); String catalogName = "test_catalog"; ConnectorId connectorId = new ConnectorId(catalogName); catalogManager.registerCatalog(new Catalog( catalogName, connectorId, testConnector, createInformationSchemaConnectorId(connectorId), testConnector, createSystemTablesConnectorId(connectorId), testConnector)); transactionManager = createTestTransactionManager(catalogManager); metadata = new MetadataManager( new FeaturesConfig(), new TypeRegistry(), new BlockEncodingManager(new TypeRegistry()), new SessionPropertyManager(), new SchemaPropertyManager(), new TablePropertyManager(), new ColumnPropertyManager(), transactionManager); }

Target:
public TestInformationSchemaMetadata() { MockConnectorFactory.Builder builder = MockConnectorFactory.builder(); MockConnectorFactory mockConnectorFactory = builder.withListSchemaNames(connectorSession -> ImmutableList.of("test_schema")) .withListTables((connectorSession, schemaNameOrNull) -> ImmutableList.of( new SchemaTableName("test_schema", "test_view"), new SchemaTableName("test_schema", "another_table"))) .withGetViews((connectorSession, prefix) -> { String viewJson = VIEW_DEFINITION_JSON_CODEC.toJson(new ViewDefinition("select 1", Optional.of("test_catalog"), Optional.of("test_schema"), ImmutableList.of(), Optional.empty())); SchemaTableName viewName = new SchemaTableName("test_schema", "test_view"); return ImmutableMap.of(viewName, new ConnectorViewDefinition(viewName, Optional.empty(), viewJson)); }).build(); Connector testConnector = mockConnectorFactory.create("test", ImmutableMap.of(), new TestingConnectorContext()); CatalogManager catalogManager = new CatalogManager(); String catalogName = "test_catalog"; ConnectorId connectorId = new ConnectorId(catalogName); catalogManager.registerCatalog(new Catalog( catalogName, connectorId, testConnector, createInformationSchemaConnectorId(connectorId), testConnector, createSystemTablesConnectorId(connectorId), testConnector)); transactionManager = createTestTransactionManager(catalogManager); metadata = new MetadataManager( new FeaturesConfig(), new TypeRegistry(), new BlockEncodingManager(new TypeRegistry()), new SessionPropertyManager(), new SchemaPropertyManager(), new TablePropertyManager(), new ColumnPropertyManager(), transactionManager); }