You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/05/25 07:30:18 UTC

[shardingsphere] branch master updated: Refactor ClusterContextManagerCoordinatorTest (#17937)

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 28e1bdabe02 Refactor ClusterContextManagerCoordinatorTest (#17937)
28e1bdabe02 is described below

commit 28e1bdabe02c1c68c057a7b1e6aa7ca98647bce4
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Wed May 25 15:30:11 2022 +0800

    Refactor ClusterContextManagerCoordinatorTest (#17937)
---
 .../cluster/coordinator/ClusterContextManagerCoordinatorTest.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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/ClusterContextManagerCoordinatorTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
index af8eb728c7a..f6c70daadc9 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
@@ -194,10 +194,9 @@ public final class ClusterContextManagerCoordinatorTest {
     
     @Test
     public void assertSchemaAdd() {
-        when(contextManager.getMetaDataContexts().getDatabaseMetaData("db").getSchemas().get("schema_1")).thenReturn(null);
-        SchemaAddedEvent event = new SchemaAddedEvent("db", "schema_1");
-        coordinator.renew(event);
-        verify(contextManager.getMetaDataContexts().getDatabaseMetaData("db").getSchemas(), times(1)).put(argThat(argument -> argument.equals("schema_1")), any(ShardingSphereSchema.class));
+        when(contextManager.getMetaDataContexts().getDatabaseMetaData("db").getSchemas().get("foo_schema")).thenReturn(null);
+        coordinator.renew(new SchemaAddedEvent("db", "foo_schema"));
+        verify(contextManager.getMetaDataContexts().getDatabaseMetaData("db").getSchemas()).put(argThat(argument -> argument.equals("foo_schema")), any(ShardingSphereSchema.class));
     }
     
     @Test