ShardingSphereDatabaseMetaData extends AdaptedDatabaseMetaData { @Override public ResultSet getTables(final String catalog, final String schemaPattern, final String tableNamePattern, final String[] types) throws SQLException { return createDatabaseMetaDataResultSet(getDatabaseMetaData().getTables(getActualCatalog(catalog), getActualSchema(schemaPattern), getActualTableNamePattern(tableNamePattern), types)); } ShardingSphereDatabaseMetaData(final AbstractConnectionAdapter connection); @Override Connection getConnection(); @Override ResultSet getSuperTypes(final String catalog, final String schemaPattern, final String typeNamePattern); @Override ResultSet getSuperTables(final String catalog, final String schemaPattern, final String tableNamePattern); @Override ResultSet getAttributes(final String catalog, final String schemaPattern, final String typeNamePattern, final String attributeNamePattern); @Override ResultSet getProcedures(final String catalog, final String schemaPattern, final String procedureNamePattern); @Override ResultSet getProcedureColumns(final String catalog, final String schemaPattern, final String procedureNamePattern, final String columnNamePattern); @Override ResultSet getTables(final String catalog, final String schemaPattern, final String tableNamePattern, final String[] types); @Override ResultSet getSchemas(); @Override ResultSet getSchemas(final String catalog, final String schemaPattern); @Override ResultSet getCatalogs(); @Override ResultSet getTableTypes(); @Override ResultSet getColumns(final String catalog, final String schemaPattern, final String tableNamePattern, final String columnNamePattern); @Override ResultSet getColumnPrivileges(final String catalog, final String schema, final String table, final String columnNamePattern); @Override ResultSet getTablePrivileges(final String catalog, final String schemaPattern, final String tableNamePattern); @Override ResultSet getBestRowIdentifier(final String catalog, final String schema, final String table, final int scope, final boolean nullable); @Override ResultSet getVersionColumns(final String catalog, final String schema, final String table); @Override ResultSet getPrimaryKeys(final String catalog, final String schema, final String table); @Override ResultSet getImportedKeys(final String catalog, final String schema, final String table); @Override ResultSet getExportedKeys(final String catalog, final String schema, final String table); @Override ResultSet getCrossReference(final String parentCatalog,
                                       final String parentSchema, final String parentTable, final String foreignCatalog, final String foreignSchema, final String foreignTable); @Override ResultSet getTypeInfo(); @Override ResultSet getIndexInfo(final String catalog, final String schema, final String table, final boolean unique, final boolean approximate); @Override ResultSet getUDTs(final String catalog, final String schemaPattern, final String typeNamePattern, final int[] types); @Override ResultSet getClientInfoProperties(); @Override ResultSet getFunctions(final String catalog, final String schemaPattern, final String functionNamePattern); @Override ResultSet getFunctionColumns(final String catalog, final String schemaPattern, final String functionNamePattern, final String columnNamePattern); @Override ResultSet getPseudoColumns(final String catalog, final String schemaPattern, final String tableNamePattern, final String columnNamePattern);  }
@Test public void assertGetTables() throws SQLException { when(databaseMetaData.getTables("test", null, "%" + TABLE_NAME + "%", null)).thenReturn(resultSet); assertThat(shardingSphereDatabaseMetaData.getTables("test", null, TABLE_NAME, null), instanceOf(DatabaseMetaDataResultSet.class)); }