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 87a72c5  Fix unit test (#12580)
87a72c5 is described below

commit 87a72c51a7dcefd020364d3c30a247e92f77cc67
Author: Haoran Meng <[email protected]>
AuthorDate: Sun Sep 19 08:25:36 2021 +0800

    Fix unit test (#12580)
---
 .../status/compute/service/ComputeNodeStatusServiceTest.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/service/ComputeNodeStatusServiceTest.java
 
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/service/ComputeNodeStatusServi
 [...]
index cb72476..957c394 100644
--- 
a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/service/ComputeNodeStatusServiceTest.java
+++ 
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/service/ComputeNodeStatusServiceTest.java
@@ -17,7 +17,9 @@
 
 package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.service;
 
+import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.ClusterInstance;
 import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -31,9 +33,14 @@ public final class ComputeNodeStatusServiceTest {
     @Mock
     private ClusterPersistRepository repository;
     
+    @Before
+    public void setUp() {
+        ClusterInstance.getInstance().init(3307);
+    }
+    
     @Test
     public void assertRegisterOnline() {
         new ComputeNodeStatusService(repository).registerOnline();
-        
verify(repository).persistEphemeral("/status/compute_nodes/online/null", "");
+        verify(repository).persistEphemeral("/status/compute_nodes/online/" + 
ClusterInstance.getInstance().getId(), "");
     }
 }

Reply via email to