diff --git a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java index 6748fc914ea7d..ea36dbd10dec2 100644 --- a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java +++ b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java @@ -74,7 +74,7 @@ class ShardingRuleStatementCheckerTest { private final ShardingRuleConfiguration shardingRuleConfig = createShardingRuleConfiguration(); - private final ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", createDataSource()); + private final ResourceMetaData resourceMetaData = new ResourceMetaData(createDataSource()); @BeforeEach void before() { @@ -84,7 +84,7 @@ void before() { } @Test - void assertCheckCreatSuccess() { + void assertCheckCreateSuccess() { Collection rules = new LinkedList<>(); rules.add(createCompleteAutoTableRule()); rules.add(createCompleteTableRule()); diff --git a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/AlterShardingTableRuleStatementUpdaterTest.java b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/AlterShardingTableRuleStatementUpdaterTest.java index 421ea0ead08cc..09d566e608d4e 100644 --- a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/AlterShardingTableRuleStatementUpdaterTest.java +++ b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/AlterShardingTableRuleStatementUpdaterTest.java @@ -63,7 +63,7 @@ class AlterShardingTableRuleStatementUpdaterTest { private final ShardingRuleConfiguration currentRuleConfig = createCurrentShardingRuleConfiguration(); - private final ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", createDataSource()); + private final ResourceMetaData resourceMetaData = new ResourceMetaData(createDataSource()); private final AlterShardingTableRuleStatementUpdater updater = new AlterShardingTableRuleStatementUpdater(); diff --git a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/CreateShardingTableRuleStatementUpdaterTest.java b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/CreateShardingTableRuleStatementUpdaterTest.java index 1a88ef4819ac2..982fe175bd8a9 100644 --- a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/CreateShardingTableRuleStatementUpdaterTest.java +++ b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/CreateShardingTableRuleStatementUpdaterTest.java @@ -86,7 +86,7 @@ class CreateShardingTableRuleStatementUpdaterTest { @BeforeEach void before() { when(database.getName()).thenReturn("schema"); - ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", createDataSource()); + ResourceMetaData resourceMetaData = new ResourceMetaData(createDataSource()); when(database.getResourceMetaData()).thenReturn(resourceMetaData); when(database.getRuleMetaData()).thenReturn(new RuleMetaData(Collections.singleton(new MockDataSourceContainedRule()))); } diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java index 9c6c5fec0393e..b8e3c5148483c 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultDatabaseMetaDataExecutorTest.java @@ -119,7 +119,7 @@ void assertExecuteWithPreparedStatement() throws SQLException { private ShardingSphereDatabase createDatabase(final Map expectedResultSetMap) throws SQLException { return new ShardingSphereDatabase("auth_db", TypedSPILoader.getService(DatabaseType.class, "FIXTURE"), - new ResourceMetaData("sharding_db", Collections.singletonMap("foo_ds", new MockedDataSource(mockConnection(expectedResultSetMap)))), + new ResourceMetaData(Collections.singletonMap("foo_ds", new MockedDataSource(mockConnection(expectedResultSetMap)))), mock(RuleMetaData.class), Collections.emptyMap()); } diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowRulesUsedStorageUnitExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowRulesUsedStorageUnitExecutorTest.java index 09422d779a417..b6057312da853 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowRulesUsedStorageUnitExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowRulesUsedStorageUnitExecutorTest.java @@ -94,7 +94,7 @@ private ShardingSphereDatabase mockDatabase() { RuleMetaData ruleMetaData = new RuleMetaData( Arrays.asList(mockShardingRule(), mockReadwriteSplittingRule(), mockEncryptRule(), mockShadowRule(), mockMaskRule())); when(result.getRuleMetaData()).thenReturn(ruleMetaData); - ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", Collections.singletonMap("foo_ds", new MockedDataSource())); + ResourceMetaData resourceMetaData = new ResourceMetaData(Collections.singletonMap("foo_ds", new MockedDataSource())); when(result.getResourceMetaData()).thenReturn(resourceMetaData); return result; } @@ -154,7 +154,7 @@ void assertGetEmptyRowData() { private ShardingSphereDatabase mockEmptyDatabase() { ShardingSphereDatabase result = mock(ShardingSphereDatabase.class); when(result.getRuleMetaData()).thenReturn(new RuleMetaData(Collections.emptyList())); - ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", Collections.singletonMap("empty_ds", new MockedDataSource())); + ResourceMetaData resourceMetaData = new ResourceMetaData(Collections.singletonMap("empty_ds", new MockedDataSource())); when(result.getResourceMetaData()).thenReturn(resourceMetaData); return result; } diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/storage/unit/ShowStorageUnitExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/storage/unit/ShowStorageUnitExecutorTest.java index 97fef2bfe9b85..4491dc5d76a8e 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/storage/unit/ShowStorageUnitExecutorTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/storage/unit/ShowStorageUnitExecutorTest.java @@ -61,7 +61,7 @@ class ShowStorageUnitExecutorTest { @BeforeEach void before() { - ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", createDataSources()); + ResourceMetaData resourceMetaData = new ResourceMetaData(createDataSources()); RuleMetaData metaData = new RuleMetaData(Collections.singleton(createShardingRule())); when(database.getResourceMetaData()).thenReturn(resourceMetaData); when(database.getRuleMetaData()).thenReturn(metaData); diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java index a482f350689ce..158205cec2131 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java @@ -264,7 +264,7 @@ void assertCreateWithOtherSelectStatementForNoResource() { @Test void assertCreateWithOtherSelectStatementForDatabaseName() { - ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", Collections.singletonMap("ds", new MockedDataSource())); + ResourceMetaData resourceMetaData = new ResourceMetaData(Collections.singletonMap("ds", new MockedDataSource())); ShardingSphereDatabase database = new ShardingSphereDatabase("db_0", databaseType, resourceMetaData, mock(RuleMetaData.class), Collections.emptyMap()); Map result = Collections.singletonMap("db_0", database); initProxyContext(result); @@ -282,7 +282,7 @@ void assertCreateWithOtherSelectStatementForDatabaseName() { @Test void assertCreateWithOtherSelectStatementForNullDatabaseName() { - ResourceMetaData resourceMetaData = new ResourceMetaData("sharding_db", Collections.singletonMap("ds_0", new MockedDataSource())); + ResourceMetaData resourceMetaData = new ResourceMetaData(Collections.singletonMap("ds_0", new MockedDataSource())); ShardingSphereDatabase database = new ShardingSphereDatabase("db_0", databaseType, resourceMetaData, mock(RuleMetaData.class), Collections.emptyMap()); Map result = Collections.singletonMap("db_0", database); initProxyContext(result); diff --git a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java index 008d1dfd9c177..79b4e1ff189c0 100644 --- a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java +++ b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/information/SelectInformationSchemataExecutorTest.java @@ -163,11 +163,11 @@ private ShardingSphereDatabase createDatabase(final String databaseName, final R } private ShardingSphereDatabase createDatabase(final String databaseName) { - return createDatabase(databaseName, new ResourceMetaData(databaseName, Collections.emptyMap())); + return createDatabase(databaseName, new ResourceMetaData(Collections.emptyMap())); } private ShardingSphereDatabase createDatabase(final Map expectedResultSetMap) throws SQLException { - return createDatabase("auth_db", new ResourceMetaData("auth_db", Collections.singletonMap("foo_ds", new MockedDataSource(mockConnection(expectedResultSetMap))))); + return createDatabase("auth_db", new ResourceMetaData(Collections.singletonMap("foo_ds", new MockedDataSource(mockConnection(expectedResultSetMap))))); } private Connection mockConnection(final Map expectedResultSetMap) throws SQLException { diff --git a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java index 72d6ca2f4c661..6b1a36ed78d3b 100644 --- a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java +++ b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutorTest.java @@ -210,7 +210,7 @@ private ContextManager mockContextManager() { ShardingSphereSchema schema = new ShardingSphereSchema(); schema.getTables().put("user", table); ShardingSphereDatabase database = new ShardingSphereDatabase("foo_db", TypedSPILoader.getService(DatabaseType.class, "MySQL"), - new ResourceMetaData("foo_db", Collections.emptyMap()), new RuleMetaData(Collections.emptyList()), Collections.singletonMap("foo_db", schema)); + new ResourceMetaData(Collections.emptyMap()), new RuleMetaData(Collections.emptyList()), Collections.singletonMap("foo_db", schema)); when(result.getMetaDataContexts().getMetaData().getDatabase("foo_db")).thenReturn(database); when(result.getMetaDataContexts().getMetaData().containsDatabase("foo_db")).thenReturn(true); return result; diff --git a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java index eea216efe80ab..fb5504f7933c6 100644 --- a/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java +++ b/proxy/frontend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java @@ -152,7 +152,7 @@ private MetaDataContexts mockMetaDataContexts() { ShardingSphereSchema schema = new ShardingSphereSchema(); schema.getTables().put("t", table); ShardingSphereDatabase database = new ShardingSphereDatabase("foo_db", TypedSPILoader.getService(DatabaseType.class, "MySQL"), - new ResourceMetaData("foo_db", Collections.emptyMap()), new RuleMetaData(Collections.emptyList()), Collections.singletonMap("foo_db", schema)); + new ResourceMetaData(Collections.emptyMap()), new RuleMetaData(Collections.emptyList()), Collections.singletonMap("foo_db", schema)); when(result.getMetaData().getDatabase("foo_db")).thenReturn(database); when(result.getMetaData().containsDatabase("foo_db")).thenReturn(true); return result; diff --git a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java index 53d5084982f9f..8efe4f38e288f 100644 --- a/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java +++ b/proxy/frontend/type/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutorTest.java @@ -198,7 +198,7 @@ private ContextManager mockContextManager() { schema.getTables().put("t_test", testTable); schema.getTables().put("sbtest1", sbTestTable); ShardingSphereDatabase database = new ShardingSphereDatabase("foo_db", TypedSPILoader.getService(DatabaseType.class, "PostgreSQL"), - new ResourceMetaData("foo_db", Collections.emptyMap()), new RuleMetaData(Collections.emptyList()), Collections.singletonMap("public", schema)); + new ResourceMetaData(Collections.emptyMap()), new RuleMetaData(Collections.emptyList()), Collections.singletonMap("public", schema)); when(result.getMetaDataContexts().getMetaData().getDatabase("foo_db")).thenReturn(database); when(result.getMetaDataContexts().getMetaData().containsDatabase("foo_db")).thenReturn(true); return result;