This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a315728e8a Simplify GlobalRuleBuilder.build interface parameters. 
(#23080)
1a315728e8a is described below

commit 1a315728e8a0d6315557b4b71881c05e089ca9c9
Author: zhaojinchao <[email protected]>
AuthorDate: Sat Dec 24 20:14:35 2022 +0800

    Simplify GlobalRuleBuilder.build interface parameters. (#23080)
    
    * Simplify GlobalRuleBuilder.build interface parameters.
    
    * Fix checkstyle
    
    * Fix checkstyle
---
 .../rule/builder/global/GlobalRuleBuilder.java     |  4 +--
 .../rule/builder/global/GlobalRulesBuilder.java    |  6 ++---
 .../builder/fixture/FixtureGlobalRuleBuilder.java  |  4 +--
 .../builder/global/GlobalRulesBuilderTest.java     | 29 ++--------------------
 .../rule/builder/AuthorityRuleBuilder.java         |  4 +--
 .../pipeline/cdc/rule/builder/CDCRuleBuilder.java  |  4 +--
 .../parser/rule/builder/SQLParserRuleBuilder.java  |  4 +--
 .../rule/builder/SQLParserRuleBuilderTest.java     |  7 +-----
 .../rule/builder/SQLFederationRuleBuilder.java     |  4 +--
 .../rule/builder/SQLTranslatorRuleBuilder.java     |  4 +--
 .../traffic/rule/builder/TrafficRuleBuilder.java   |  4 +--
 .../rule/builder/TransactionRuleBuilder.java       |  4 +--
 .../rule/builder/TransactionRuleBuilderTest.java   | 12 +--------
 .../mode/manager/ContextManager.java               |  6 ++---
 .../mode/metadata/MetaDataContextsFactory.java     |  2 +-
 .../mode/metadata/MetaDataContextsFactoryTest.java |  2 +-
 .../frontend/mysql/MySQLFrontendEngineTest.java    |  3 +--
 .../MySQLAuthenticationHandlerTest.java            |  3 +--
 .../OpenGaussAuthenticationEngineTest.java         |  3 +--
 .../OpenGaussAuthenticationHandlerTest.java        |  3 +--
 .../PostgreSQLAuthenticationEngineTest.java        |  3 +--
 .../PostgreSQLAuthenticationHandlerTest.java       |  3 +--
 22 files changed, 26 insertions(+), 92 deletions(-)

diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRuleBuilder.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRuleBuilder.java
index 475eaff103e..da581e2ea0c 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRuleBuilder.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRuleBuilder.java
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.infra.rule.builder.global;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.RuleBuilder;
 import org.apache.shardingsphere.infra.rule.identifier.scope.GlobalRule;
@@ -40,9 +39,8 @@ public interface GlobalRuleBuilder<T extends 
RuleConfiguration> extends RuleBuil
      *
      * @param ruleConfig rule configuration
      * @param databases databases
-     * @param instanceContext instance context
      * @param props props
      * @return global rule
      */
-    GlobalRule build(T ruleConfig, Map<String, ShardingSphereDatabase> 
databases, InstanceContext instanceContext, ConfigurationProperties props);
+    GlobalRule build(T ruleConfig, Map<String, ShardingSphereDatabase> 
databases, ConfigurationProperties props);
 }
diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilder.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilder.java
index 09f1d996e1a..961b7aada91 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilder.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilder.java
@@ -21,7 +21,6 @@ import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
 
@@ -43,16 +42,15 @@ public final class GlobalRulesBuilder {
      *
      * @param globalRuleConfigs global rule configurations
      * @param databases databases
-     * @param instanceContext instance context
      * @param props props
      * @return built rules
      */
     @SuppressWarnings({"unchecked", "rawtypes"})
     public static Collection<ShardingSphereRule> buildRules(final 
Collection<RuleConfiguration> globalRuleConfigs, final Map<String, 
ShardingSphereDatabase> databases,
-                                                            final 
InstanceContext instanceContext, final ConfigurationProperties props) {
+                                                            final 
ConfigurationProperties props) {
         Collection<ShardingSphereRule> result = new LinkedList<>();
         for (Entry<RuleConfiguration, GlobalRuleBuilder> entry : 
getRuleBuilderMap(globalRuleConfigs).entrySet()) {
-            result.add(entry.getValue().build(entry.getKey(), databases, 
instanceContext, props));
+            result.add(entry.getValue().build(entry.getKey(), databases, 
props));
         }
         return result;
     }
diff --git 
a/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureGlobalRuleBuilder.java
 
b/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureGlobalRuleBuilder.java
index 888cc9f458d..95743d650a3 100644
--- 
a/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureGlobalRuleBuilder.java
+++ 
b/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureGlobalRuleBuilder.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.infra.rule.builder.fixture;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 
@@ -27,8 +26,7 @@ import java.util.Map;
 public final class FixtureGlobalRuleBuilder implements 
GlobalRuleBuilder<FixtureGlobalRuleConfiguration> {
     
     @Override
-    public FixtureGlobalRule build(final FixtureGlobalRuleConfiguration 
ruleConfig, final Map<String, ShardingSphereDatabase> databases, final 
InstanceContext instanceContext,
-                                   final ConfigurationProperties props) {
+    public FixtureGlobalRule build(final FixtureGlobalRuleConfiguration 
ruleConfig, final Map<String, ShardingSphereDatabase> databases, final 
ConfigurationProperties props) {
         return new FixtureGlobalRule();
     }
     
diff --git 
a/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
 
b/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
index 7f3cdb5ad28..4561c39aedb 100644
--- 
a/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
+++ 
b/infra/common/src/test/java/org/apache/shardingsphere/infra/rule/builder/global/GlobalRulesBuilderTest.java
@@ -17,64 +17,39 @@
 
 package org.apache.shardingsphere.infra.rule.builder.global;
 
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
-import org.apache.shardingsphere.infra.instance.ComputeNodeInstance;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
-import 
org.apache.shardingsphere.infra.instance.metadata.jdbc.JDBCInstanceMetaData;
-import org.apache.shardingsphere.infra.instance.mode.ModeContextManager;
-import org.apache.shardingsphere.infra.instance.workerid.WorkerIdGenerator;
-import org.apache.shardingsphere.infra.lock.LockContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
 import org.apache.shardingsphere.infra.rule.builder.fixture.FixtureGlobalRule;
 import 
org.apache.shardingsphere.infra.rule.builder.fixture.FixtureGlobalRuleConfiguration;
-import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
 import org.junit.Test;
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Properties;
-import java.util.UUID;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
 
 public final class GlobalRulesBuilderTest {
     
     @Test
     public void assertBuildRules() {
         Collection<ShardingSphereRule> shardingSphereRules = GlobalRulesBuilder
-                .buildRules(Collections.singletonList(new 
FixtureGlobalRuleConfiguration()), Collections.singletonMap("logic_db", 
buildDatabase()), buildInstanceContext(),
-                        mock(ConfigurationProperties.class));
+                .buildRules(Collections.singletonList(new 
FixtureGlobalRuleConfiguration()), Collections.singletonMap("logic_db", 
buildDatabase()), mock(ConfigurationProperties.class));
         assertThat(shardingSphereRules.size(), is(1));
     }
     
     @Test
     public void assertBuildRulesClassType() {
         Collection<ShardingSphereRule> shardingSphereRules = GlobalRulesBuilder
-                .buildRules(Collections.singletonList(new 
FixtureGlobalRuleConfiguration()), Collections.singletonMap("logic_db", 
buildDatabase()), buildInstanceContext(),
-                        mock(ConfigurationProperties.class));
+                .buildRules(Collections.singletonList(new 
FixtureGlobalRuleConfiguration()), Collections.singletonMap("logic_db", 
buildDatabase()), mock(ConfigurationProperties.class));
         assertTrue(shardingSphereRules.toArray()[0] instanceof 
FixtureGlobalRule);
     }
     
     private ShardingSphereDatabase buildDatabase() {
         return ShardingSphereDatabase.create("logic_db", new 
MySQLDatabaseType());
     }
-    
-    private InstanceContext buildInstanceContext() {
-        ComputeNodeInstance computeNodeInstance = new ComputeNodeInstance(new 
JDBCInstanceMetaData(UUID.randomUUID().toString()));
-        ModeConfiguration modeConfig = new ModeConfiguration("Standalone", 
null);
-        return new InstanceContext(computeNodeInstance, 
createWorkerIdGenerator(), modeConfig, mock(ModeContextManager.class), 
mock(LockContext.class), new EventBusContext());
-    }
-    
-    private WorkerIdGenerator createWorkerIdGenerator() {
-        WorkerIdGenerator result = mock(WorkerIdGenerator.class);
-        when(result.generate(new Properties())).thenReturn(0);
-        return result;
-    }
 }
diff --git 
a/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java
 
b/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java
index 646776ef885..b6209ef7e3c 100644
--- 
a/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java
+++ 
b/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java
@@ -21,7 +21,6 @@ import 
org.apache.shardingsphere.authority.config.AuthorityRuleConfiguration;
 import org.apache.shardingsphere.authority.constant.AuthorityOrder;
 import org.apache.shardingsphere.authority.rule.AuthorityRule;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 
@@ -33,8 +32,7 @@ import java.util.Map;
 public final class AuthorityRuleBuilder implements 
GlobalRuleBuilder<AuthorityRuleConfiguration> {
     
     @Override
-    public AuthorityRule build(final AuthorityRuleConfiguration ruleConfig, 
final Map<String, ShardingSphereDatabase> databases, final InstanceContext 
instanceContext,
-                               final ConfigurationProperties props) {
+    public AuthorityRule build(final AuthorityRuleConfiguration ruleConfig, 
final Map<String, ShardingSphereDatabase> databases, final 
ConfigurationProperties props) {
         return new AuthorityRule(ruleConfig, databases);
     }
     
diff --git 
a/kernel/data-pipeline/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/rule/builder/CDCRuleBuilder.java
 
b/kernel/data-pipeline/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/rule/builder/CDCRuleBuilder.java
index d4f38ea5b48..a6325ae0534 100644
--- 
a/kernel/data-pipeline/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/rule/builder/CDCRuleBuilder.java
+++ 
b/kernel/data-pipeline/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/rule/builder/CDCRuleBuilder.java
@@ -21,7 +21,6 @@ import 
org.apache.shardingsphere.data.pipeline.cdc.config.CDCRuleConfiguration;
 import org.apache.shardingsphere.data.pipeline.cdc.constant.CDCOrder;
 import org.apache.shardingsphere.data.pipeline.cdc.rule.CDCRule;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 
@@ -33,8 +32,7 @@ import java.util.Map;
 public final class CDCRuleBuilder implements 
GlobalRuleBuilder<CDCRuleConfiguration> {
     
     @Override
-    public CDCRule build(final CDCRuleConfiguration ruleConfig, final 
Map<String, ShardingSphereDatabase> databases, final InstanceContext 
instanceContext,
-                         final ConfigurationProperties props) {
+    public CDCRule build(final CDCRuleConfiguration ruleConfig, final 
Map<String, ShardingSphereDatabase> databases, final ConfigurationProperties 
props) {
         return new CDCRule(ruleConfig.isEnabled(), ruleConfig.getPort());
     }
     
diff --git 
a/kernel/parser/core/src/main/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilder.java
 
b/kernel/parser/core/src/main/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilder.java
index d86b40f5de3..b02b0e2c167 100644
--- 
a/kernel/parser/core/src/main/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilder.java
+++ 
b/kernel/parser/core/src/main/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilder.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.parser.rule.builder;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 import org.apache.shardingsphere.parser.config.SQLParserRuleConfiguration;
@@ -33,8 +32,7 @@ import java.util.Map;
 public final class SQLParserRuleBuilder implements 
GlobalRuleBuilder<SQLParserRuleConfiguration> {
     
     @Override
-    public SQLParserRule build(final SQLParserRuleConfiguration ruleConfig, 
final Map<String, ShardingSphereDatabase> databases, final InstanceContext 
instanceContext,
-                               final ConfigurationProperties props) {
+    public SQLParserRule build(final SQLParserRuleConfiguration ruleConfig, 
final Map<String, ShardingSphereDatabase> databases, final 
ConfigurationProperties props) {
         return new SQLParserRule(ruleConfig);
     }
     
diff --git 
a/kernel/parser/core/src/test/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilderTest.java
 
b/kernel/parser/core/src/test/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilderTest.java
index 35d31ed253e..5fa450d8a20 100644
--- 
a/kernel/parser/core/src/test/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilderTest.java
+++ 
b/kernel/parser/core/src/test/java/org/apache/shardingsphere/parser/rule/builder/SQLParserRuleBuilderTest.java
@@ -18,13 +18,11 @@
 package org.apache.shardingsphere.parser.rule.builder;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import org.apache.shardingsphere.parser.config.SQLParserRuleConfiguration;
 import org.apache.shardingsphere.parser.constant.SQLParserOrder;
 import org.apache.shardingsphere.parser.rule.SQLParserRule;
 import org.apache.shardingsphere.sql.parser.api.CacheOption;
 import org.junit.Test;
-import org.mockito.Mock;
 
 import java.util.HashMap;
 import java.util.Properties;
@@ -35,13 +33,10 @@ import static org.junit.Assert.assertTrue;
 
 public final class SQLParserRuleBuilderTest {
     
-    @Mock
-    private InstanceContext instanceContext;
-    
     @Test
     public void assertBuild() {
         SQLParserRuleConfiguration ruleConfig = new 
SQLParserRuleConfiguration(true, new CacheOption(2, 5), new CacheOption(4, 7));
-        SQLParserRule actualResult = new 
SQLParserRuleBuilder().build(ruleConfig, new HashMap<>(), instanceContext, new 
ConfigurationProperties(new Properties()));
+        SQLParserRule actualResult = new 
SQLParserRuleBuilder().build(ruleConfig, new HashMap<>(), new 
ConfigurationProperties(new Properties()));
         assertThat(actualResult.getConfiguration(), is(ruleConfig));
         assertTrue(actualResult.isSqlCommentParseEnabled());
         assertThat(actualResult.getSqlStatementCache().getInitialCapacity(), 
is(4));
diff --git 
a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/builder/SQLFederationRuleBuilder.java
 
b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/builder/SQLFederationRuleBuilder.java
index 38d4ea70e09..b7e3fd90a13 100644
--- 
a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/builder/SQLFederationRuleBuilder.java
+++ 
b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/builder/SQLFederationRuleBuilder.java
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.sqlfederation.rule.builder;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 import org.apache.shardingsphere.infra.rule.identifier.scope.GlobalRule;
@@ -35,8 +34,7 @@ import java.util.Map;
 public final class SQLFederationRuleBuilder implements 
GlobalRuleBuilder<SQLFederationRuleConfiguration> {
     
     @Override
-    public GlobalRule build(final SQLFederationRuleConfiguration ruleConfig, 
final Map<String, ShardingSphereDatabase> databases, final InstanceContext 
instanceContext,
-                            final ConfigurationProperties props) {
+    public GlobalRule build(final SQLFederationRuleConfiguration ruleConfig, 
final Map<String, ShardingSphereDatabase> databases, final 
ConfigurationProperties props) {
         
ruleConfig.setSqlFederationType(props.getValue(ConfigurationPropertyKey.SQL_FEDERATION_TYPE));
         return new SQLFederationRule(ruleConfig);
     }
diff --git 
a/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/rule/builder/SQLTranslatorRuleBuilder.java
 
b/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/rule/builder/SQLTranslatorRuleBuilder.java
index b3537a060ef..a98b2a60eba 100644
--- 
a/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/rule/builder/SQLTranslatorRuleBuilder.java
+++ 
b/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/rule/builder/SQLTranslatorRuleBuilder.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.sqltranslator.rule.builder;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 import 
org.apache.shardingsphere.sqltranslator.api.config.SQLTranslatorRuleConfiguration;
@@ -33,8 +32,7 @@ import java.util.Map;
 public final class SQLTranslatorRuleBuilder implements 
GlobalRuleBuilder<SQLTranslatorRuleConfiguration> {
     
     @Override
-    public SQLTranslatorRule build(final SQLTranslatorRuleConfiguration 
ruleConfig, final Map<String, ShardingSphereDatabase> databases, final 
InstanceContext instanceContext,
-                                   final ConfigurationProperties props) {
+    public SQLTranslatorRule build(final SQLTranslatorRuleConfiguration 
ruleConfig, final Map<String, ShardingSphereDatabase> databases, final 
ConfigurationProperties props) {
         return new SQLTranslatorRule(ruleConfig);
     }
     
diff --git 
a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/rule/builder/TrafficRuleBuilder.java
 
b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/rule/builder/TrafficRuleBuilder.java
index 4125f61be09..ce6b724ca8f 100644
--- 
a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/rule/builder/TrafficRuleBuilder.java
+++ 
b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/rule/builder/TrafficRuleBuilder.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.traffic.rule.builder;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 import org.apache.shardingsphere.infra.rule.identifier.scope.GlobalRule;
@@ -34,8 +33,7 @@ import java.util.Map;
 public final class TrafficRuleBuilder implements 
GlobalRuleBuilder<TrafficRuleConfiguration> {
     
     @Override
-    public GlobalRule build(final TrafficRuleConfiguration ruleConfig, final 
Map<String, ShardingSphereDatabase> databases, final InstanceContext 
instanceContext,
-                            final ConfigurationProperties props) {
+    public GlobalRule build(final TrafficRuleConfiguration ruleConfig, final 
Map<String, ShardingSphereDatabase> databases, final ConfigurationProperties 
props) {
         return new TrafficRule(ruleConfig);
     }
     
diff --git 
a/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilder.java
 
b/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilder.java
index 2cac5cc0509..1871a5f3ac3 100644
--- 
a/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilder.java
+++ 
b/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilder.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.transaction.rule.builder;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.rule.builder.global.GlobalRuleBuilder;
 import 
org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
@@ -33,8 +32,7 @@ import java.util.Map;
 public final class TransactionRuleBuilder implements 
GlobalRuleBuilder<TransactionRuleConfiguration> {
     
     @Override
-    public TransactionRule build(final TransactionRuleConfiguration 
ruleConfig, final Map<String, ShardingSphereDatabase> databases, final 
InstanceContext instanceContext,
-                                 final ConfigurationProperties props) {
+    public TransactionRule build(final TransactionRuleConfiguration 
ruleConfig, final Map<String, ShardingSphereDatabase> databases, final 
ConfigurationProperties props) {
         return new TransactionRule(ruleConfig, databases);
     }
     
diff --git 
a/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilderTest.java
 
b/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilderTest.java
index 0b1c3422402..b534f7bb1d7 100644
--- 
a/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilderTest.java
+++ 
b/kernel/transaction/core/src/test/java/org/apache/shardingsphere/transaction/rule/builder/TransactionRuleBuilderTest.java
@@ -17,21 +17,13 @@
 
 package org.apache.shardingsphere.transaction.rule.builder;
 
-import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.database.DefaultDatabase;
-import org.apache.shardingsphere.infra.instance.ComputeNodeInstance;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
-import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
-import org.apache.shardingsphere.infra.instance.mode.ModeContextManager;
-import org.apache.shardingsphere.infra.instance.workerid.WorkerIdGenerator;
-import org.apache.shardingsphere.infra.lock.LockContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import 
org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
 import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
-import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
 import org.apache.shardingsphere.test.fixture.jdbc.MockedDataSource;
 import 
org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
 import org.apache.shardingsphere.transaction.rule.TransactionRule;
@@ -55,9 +47,7 @@ public final class TransactionRuleBuilderTest {
         TransactionRuleConfiguration ruleConfig = new 
TransactionRuleConfiguration("LOCAL", "provider", new Properties());
         ShardingSphereDatabase database = new 
ShardingSphereDatabase("logic_db", null, new 
ShardingSphereResourceMetaData("db", createDataSourceMap()),
                 new 
ShardingSphereRuleMetaData(Collections.singletonList(mock(ShardingSphereRule.class))),
 Collections.singletonMap("test", mock(ShardingSphereSchema.class)));
-        InstanceContext instanceContext = new InstanceContext(new 
ComputeNodeInstance(mock(InstanceMetaData.class)), 
mock(WorkerIdGenerator.class),
-                new ModeConfiguration("Standalone", null), 
mock(ModeContextManager.class), mock(LockContext.class), new EventBusContext());
-        TransactionRule rule = new TransactionRuleBuilder().build(ruleConfig, 
Collections.singletonMap(DefaultDatabase.LOGIC_NAME, database), 
instanceContext, mock(ConfigurationProperties.class));
+        TransactionRule rule = new TransactionRuleBuilder().build(ruleConfig, 
Collections.singletonMap(DefaultDatabase.LOGIC_NAME, database), 
mock(ConfigurationProperties.class));
         assertNotNull(rule.getConfiguration());
         
assertThat(rule.getDatabases().get("logic_db").getResourceMetaData().getDataSources().size(),
 is(2));
     }
diff --git 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
index dee2e3fb15d..98c998d1727 100644
--- 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
+++ 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
@@ -345,7 +345,7 @@ public final class ContextManager implements AutoCloseable {
         Map<String, ShardingSphereDatabase> changedDatabases = 
createChangedDatabases(databaseName, switchingResource, ruleConfigs);
         ConfigurationProperties props = 
metaDataContexts.getMetaData().getProps();
         ShardingSphereRuleMetaData changedGlobalMetaData = new 
ShardingSphereRuleMetaData(
-                
GlobalRulesBuilder.buildRules(metaDataContexts.getMetaData().getGlobalRuleMetaData().getConfigurations(),
 changedDatabases, instanceContext, props));
+                
GlobalRulesBuilder.buildRules(metaDataContexts.getMetaData().getGlobalRuleMetaData().getConfigurations(),
 changedDatabases, props));
         return newMetaDataContexts(new 
ShardingSphereMetaData(changedDatabases, changedGlobalMetaData, props));
     }
     
@@ -354,7 +354,7 @@ public final class ContextManager implements AutoCloseable {
         Map<String, ShardingSphereDatabase> changedDatabases = 
createChangedDatabases(databaseName, switchingResource, 
metaDataPersistService.getDatabaseRulePersistService().load(databaseName));
         ConfigurationProperties props = new 
ConfigurationProperties(metaDataPersistService.getPropsService().load());
         ShardingSphereRuleMetaData changedGlobalMetaData = new 
ShardingSphereRuleMetaData(
-                
GlobalRulesBuilder.buildRules(metaDataPersistService.getGlobalRuleService().load(),
 changedDatabases, instanceContext, props));
+                
GlobalRulesBuilder.buildRules(metaDataPersistService.getGlobalRuleService().load(),
 changedDatabases, props));
         return newMetaDataContexts(new 
ShardingSphereMetaData(changedDatabases, changedGlobalMetaData, props));
     }
     
@@ -423,7 +423,7 @@ public final class ContextManager implements AutoCloseable {
         Collection<ResourceHeldRule> staleResourceHeldRules = 
metaDataContexts.getMetaData().getGlobalRuleMetaData().findRules(ResourceHeldRule.class);
         staleResourceHeldRules.forEach(ResourceHeldRule::closeStaleResource);
         ShardingSphereRuleMetaData toBeChangedGlobalRuleMetaData = new 
ShardingSphereRuleMetaData(
-                GlobalRulesBuilder.buildRules(ruleConfigs, 
metaDataContexts.getMetaData().getDatabases(), instanceContext, 
metaDataContexts.getMetaData().getProps()));
+                GlobalRulesBuilder.buildRules(ruleConfigs, 
metaDataContexts.getMetaData().getDatabases(), 
metaDataContexts.getMetaData().getProps()));
         ShardingSphereMetaData toBeChangedMetaData = new 
ShardingSphereMetaData(
                 metaDataContexts.getMetaData().getDatabases(), 
toBeChangedGlobalRuleMetaData, metaDataContexts.getMetaData().getProps());
         metaDataContexts = newMetaDataContexts(toBeChangedMetaData);
diff --git 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
index 6c604d72b0d..2d374b40d3e 100644
--- 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
+++ 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
@@ -89,7 +89,7 @@ public final class MetaDataContextsFactory {
         ConfigurationProperties props = new 
ConfigurationProperties(persistService.getPropsService().load());
         Map<String, ShardingSphereDatabase> databases = 
ShardingSphereDatabasesFactory.create(effectiveDatabaseConfigs, props, 
instanceContext);
         databases.putAll(reloadDatabases(databases, persistService));
-        ShardingSphereRuleMetaData globalMetaData = new 
ShardingSphereRuleMetaData(GlobalRulesBuilder.buildRules(globalRuleConfigs, 
databases, instanceContext, props));
+        ShardingSphereRuleMetaData globalMetaData = new 
ShardingSphereRuleMetaData(GlobalRulesBuilder.buildRules(globalRuleConfigs, 
databases, props));
         return new MetaDataContexts(persistService, new 
ShardingSphereMetaData(databases, globalMetaData, props));
     }
     
diff --git 
a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactoryTest.java
 
b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactoryTest.java
index 73a1fab8b9b..27959bc9cf8 100644
--- 
a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactoryTest.java
+++ 
b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactoryTest.java
@@ -111,7 +111,7 @@ public final class MetaDataContextsFactoryTest {
     
     private void mockGlobalRulesBuilder() {
         globalRulesBuilder = mockStatic(GlobalRulesBuilder.class);
-        globalRulesBuilder.when(() -> 
GlobalRulesBuilder.buildRules(anyCollection(), anyMap(), 
any(InstanceContext.class), 
any(ConfigurationProperties.class))).thenReturn(rules);
+        globalRulesBuilder.when(() -> 
GlobalRulesBuilder.buildRules(anyCollection(), anyMap(), 
any(ConfigurationProperties.class))).thenReturn(rules);
     }
     
     private DatabaseRulePersistService mockDatabaseRulePersistService() {
diff --git 
a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
 
b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
index a6ba5353788..b3344b05f56 100644
--- 
a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
+++ 
b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
@@ -34,7 +34,6 @@ import 
org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
 import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import 
org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
@@ -187,7 +186,7 @@ public final class MySQLFrontendEngineTest extends 
ProxyContextRestorer {
     
     private ShardingSphereRuleMetaData buildGlobalRuleMetaData(final 
ShardingSphereUser user) {
         AuthorityRuleConfiguration ruleConfig = new 
AuthorityRuleConfiguration(Collections.singletonList(user), new 
AlgorithmConfiguration("ALL_PERMITTED", new Properties()));
-        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(InstanceContext.class), 
mock(ConfigurationProperties.class));
+        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(ConfigurationProperties.class));
         return new ShardingSphereRuleMetaData(Collections.singletonList(rule));
     }
 }
diff --git 
a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
 
b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
index 30030add1b3..d5f14283873 100644
--- 
a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
+++ 
b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
@@ -28,7 +28,6 @@ import 
org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLAuthPlu
 import org.apache.shardingsphere.dialect.mysql.vendor.MySQLVendorError;
 import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import 
org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
@@ -151,7 +150,7 @@ public final class MySQLAuthenticationHandlerTest extends 
ProxyContextRestorer {
     
     private ShardingSphereRuleMetaData buildGlobalRuleMetaData(final 
ShardingSphereUser user, final boolean isNeedSuper) throws 
ReflectiveOperationException {
         AuthorityRuleConfiguration ruleConfig = new 
AuthorityRuleConfiguration(Collections.singletonList(user), new 
AlgorithmConfiguration("ALL_PERMITTED", new Properties()));
-        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(InstanceContext.class), 
mock(ConfigurationProperties.class));
+        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(ConfigurationProperties.class));
         if (!isNeedSuper) {
             AuthorityRegistry authorityRegistry = 
mock(AuthorityRegistry.class);
             
when(authorityRegistry.findPrivileges(user.getGrantee())).thenReturn(Optional.empty());
diff --git 
a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java
 
b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java
index 0ac148d807c..b64e475ed7d 100644
--- 
a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java
+++ 
b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java
@@ -35,7 +35,6 @@ import 
org.apache.shardingsphere.dialect.postgresql.exception.authority.InvalidP
 import 
org.apache.shardingsphere.dialect.postgresql.exception.protocol.ProtocolViolationException;
 import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
 import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
@@ -171,7 +170,7 @@ public final class OpenGaussAuthenticationEngineTest 
extends ProxyContextRestore
     
     private ShardingSphereRuleMetaData buildGlobalRuleMetaData(final 
ShardingSphereUser user) {
         AuthorityRuleConfiguration ruleConfig = new 
AuthorityRuleConfiguration(Collections.singletonList(user), new 
AlgorithmConfiguration("ALL_PERMITTED", new Properties()));
-        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(InstanceContext.class), 
mock(ConfigurationProperties.class));
+        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(ConfigurationProperties.class));
         return new ShardingSphereRuleMetaData(Collections.singletonList(rule));
     }
     
diff --git 
a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationHandlerTest.java
 
b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationHandlerTest.java
index 545e6d737e0..ed63d336076 100644
--- 
a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationHandlerTest.java
+++ 
b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationHandlerTest.java
@@ -32,7 +32,6 @@ import 
org.apache.shardingsphere.dialect.postgresql.exception.authority.UnknownU
 import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.database.DefaultDatabase;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import 
org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData;
@@ -142,7 +141,7 @@ public final class OpenGaussAuthenticationHandlerTest 
extends ProxyContextRestor
     
     private ShardingSphereRuleMetaData buildGlobalRuleMetaData(final 
ShardingSphereUser user) {
         AuthorityRuleConfiguration ruleConfig = new 
AuthorityRuleConfiguration(Collections.singletonList(user), new 
AlgorithmConfiguration("ALL_PERMITTED", new Properties()));
-        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(InstanceContext.class), 
mock(ConfigurationProperties.class));
+        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(ConfigurationProperties.class));
         return new ShardingSphereRuleMetaData(Collections.singleton(rule));
     }
     
diff --git 
a/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
 
b/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
index bf6907a8387..2f54ae9bdd5 100644
--- 
a/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
+++ 
b/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
@@ -35,7 +35,6 @@ import 
org.apache.shardingsphere.dialect.postgresql.exception.authority.InvalidP
 import 
org.apache.shardingsphere.dialect.postgresql.exception.protocol.ProtocolViolationException;
 import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
 import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
@@ -178,7 +177,7 @@ public final class PostgreSQLAuthenticationEngineTest 
extends ProxyContextRestor
     
     private ShardingSphereRuleMetaData buildGlobalRuleMetaData(final 
ShardingSphereUser user) {
         AuthorityRuleConfiguration ruleConfig = new 
AuthorityRuleConfiguration(Collections.singletonList(user), new 
AlgorithmConfiguration("ALL_PERMITTED", new Properties()));
-        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(InstanceContext.class), 
mock(ConfigurationProperties.class));
+        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(ConfigurationProperties.class));
         return new ShardingSphereRuleMetaData(Collections.singleton(rule));
     }
     
diff --git 
a/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationHandlerTest.java
 
b/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationHandlerTest.java
index b63bbaaf5f0..8262507cbbe 100644
--- 
a/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationHandlerTest.java
+++ 
b/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationHandlerTest.java
@@ -32,7 +32,6 @@ import 
org.apache.shardingsphere.dialect.postgresql.exception.authority.UnknownU
 import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.database.DefaultDatabase;
-import org.apache.shardingsphere.infra.instance.InstanceContext;
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import 
org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData;
@@ -149,7 +148,7 @@ public final class PostgreSQLAuthenticationHandlerTest 
extends ProxyContextResto
     
     private ShardingSphereRuleMetaData buildGlobalRuleMetaData(final 
ShardingSphereUser user) {
         AuthorityRuleConfiguration ruleConfig = new 
AuthorityRuleConfiguration(Collections.singletonList(user), new 
AlgorithmConfiguration("ALL_PERMITTED", new Properties()));
-        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(InstanceContext.class), 
mock(ConfigurationProperties.class));
+        AuthorityRule rule = new AuthorityRuleBuilder().build(ruleConfig, 
Collections.emptyMap(), mock(ConfigurationProperties.class));
         return new ShardingSphereRuleMetaData(Collections.singleton(rule));
     }
     


Reply via email to