You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/09/12 11:34:08 UTC

(shardingsphere) branch master updated: Refactor StandaloneContextManagerBuilderTest (#39814)

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

terrymanu 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 e5ed30f0b3a Refactor StandaloneContextManagerBuilderTest (#39814)
e5ed30f0b3a is described below

commit e5ed30f0b3a942eb4ee1dff5b4e0fbb7d168bb2b
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Sep 12 19:34:02 2026 +0800

    Refactor StandaloneContextManagerBuilderTest (#39814)
---
 .../standalone/StandaloneContextManagerBuilderTest.java      | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java
index 16e28701a3c..72ab32e62ab 100644
--- a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java
+++ b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilderTest.java
@@ -21,7 +21,6 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
 import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
 import org.apache.shardingsphere.infra.instance.metadata.jdbc.JDBCInstanceMetaData;
 import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
-import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
 import org.apache.shardingsphere.mode.manager.ContextManager;
 import org.apache.shardingsphere.mode.manager.builder.ContextManagerBuilder;
 import org.apache.shardingsphere.mode.manager.builder.ContextManagerBuilderParameter;
@@ -49,14 +48,11 @@ class StandaloneContextManagerBuilderTest {
     }
     
     @SuppressWarnings("resource")
-    void assertBuild(final ContextManagerBuilder builder) throws SQLException {
+    private void assertBuild(final ContextManagerBuilder builder) throws SQLException {
+        ModeConfiguration modeConfig = new ModeConfiguration("STANDALONE", new StandalonePersistRepositoryConfiguration("FIXTURE", new Properties()));
         InstanceMetaData instanceMetaData = new JDBCInstanceMetaData("foo", "foo_db");
-        ContextManager actual = builder.build(new ContextManagerBuilderParameter(createModeConfiguration(),
-                Collections.emptyMap(), Collections.emptyMap(), Collections.emptyList(), new Properties(), instanceMetaData), mock(EventBusContext.class));
+        ContextManager actual = builder.build(new ContextManagerBuilderParameter(
+                modeConfig, Collections.emptyMap(), Collections.emptyMap(), Collections.emptyList(), new Properties(), instanceMetaData), mock());
         assertThat(actual.getComputeNodeInstanceContext().getInstance().getMetaData(), is(instanceMetaData));
     }
-    
-    private ModeConfiguration createModeConfiguration() {
-        return new ModeConfiguration("STANDALONE", new StandalonePersistRepositoryConfiguration("FIXTURE", new Properties()));
-    }
 }