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

sunnianjun 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 c80c2d093ec Refactor AuthorityRuleTest (#29616)
c80c2d093ec is described below

commit c80c2d093ec61dbebc9731218e6df984843b092d
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jan 1 16:43:30 2024 +0800

    Refactor AuthorityRuleTest (#29616)
    
    * Remove AuthorityRegistry
    
    * Rename PrivilegeProvider
    
    * Refactor PrivilegeProviderFixture
    
    * Refactor AuthorityRuleTest
---
 .../shardingsphere/authority/rule/AuthorityRuleTest.java       | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/rule/AuthorityRuleTest.java
 
b/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/rule/AuthorityRuleTest.java
index 39186ae0373..a1a1a31e8bd 100644
--- 
a/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/rule/AuthorityRuleTest.java
+++ 
b/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/rule/AuthorityRuleTest.java
@@ -23,9 +23,9 @@ import org.apache.shardingsphere.infra.metadata.user.Grantee;
 import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
 import org.junit.jupiter.api.Test;
 
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.LinkedList;
 import java.util.Optional;
 import java.util.Properties;
 
@@ -56,10 +56,8 @@ class AuthorityRuleTest {
     }
     
     private AuthorityRule createAuthorityRule() {
-        Collection<ShardingSphereUser> users = new LinkedList<>();
-        users.add(new ShardingSphereUser("root", "root", "localhost"));
-        users.add(new ShardingSphereUser("admin", "123456", "localhost"));
-        AuthorityRuleConfiguration ruleConfig = new 
AuthorityRuleConfiguration(users, new AlgorithmConfiguration("FIXTURE", new 
Properties()), Collections.emptyMap(), null);
-        return new AuthorityRule(ruleConfig);
+        Collection<ShardingSphereUser> users = Arrays.asList(new 
ShardingSphereUser("root", "root", "localhost"), new 
ShardingSphereUser("admin", "123456", "localhost"));
+        AlgorithmConfiguration privilegeProvider = new 
AlgorithmConfiguration("FIXTURE", new Properties());
+        return new AuthorityRule(new AuthorityRuleConfiguration(users, 
privilegeProvider, Collections.emptyMap(), null));
     }
 }

Reply via email to