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 <[email protected]>
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

Reply via email to