Source:
<code>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)); }) <START> .withGetColumnHandles((connectorSession, tableHandle) -> { <END> 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); }</code><technical_language>This default behaviour in builder</technical_language>

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); }