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

zhaojinchao 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 7553e973451 Revise #19302 (#19314)
7553e973451 is described below

commit 7553e973451ac8d73928d03b5ca4348b5de3dc95
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jul 18 14:21:15 2022 +0800

    Revise #19302 (#19314)
---
 .../fixture/PersistRepositoryConfigurationFixture.java       | 10 +++++-----
 .../PersistRepositoryConfigurationYamlSwapperFixture.java    |  3 +--
 ...PersistRepositoryConfigurationYamlSwapperFactoryTest.java | 12 +++++-------
 ...ig.swapper.mode.PersistRepositoryConfigurationYamlSwapper |  2 +-
 4 files changed, 12 insertions(+), 15 deletions(-)

diff --git 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationFixture.java
 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationFixture.java
index 56e37016d11..469fa008800 100644
--- 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationFixture.java
+++ 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationFixture.java
@@ -21,15 +21,15 @@ import 
org.apache.shardingsphere.infra.config.mode.PersistRepositoryConfiguratio
 
 import java.util.Properties;
 
-public class PersistRepositoryConfigurationFixture implements 
PersistRepositoryConfiguration {
+public final class PersistRepositoryConfigurationFixture implements 
PersistRepositoryConfiguration {
     
     @Override
-    public String getType() {
-        return "FIXTURE";
+    public Properties getProps() {
+        return new Properties();
     }
     
     @Override
-    public Properties getProps() {
-        return new Properties();
+    public String getType() {
+        return "FIXTURE";
     }
 }
diff --git 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationYamlSwapperFixture.java
 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationYamlSwapperFixture.java
index 01e180c5364..483dd723861 100644
--- 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationYamlSwapperFixture.java
+++ 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationYamlSwapperFixture.java
@@ -20,7 +20,7 @@ package 
org.apache.shardingsphere.infra.yaml.config.swapper.fixture;
 import 
org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration;
 import 
org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper;
 
-public class PersistRepositoryConfigurationYamlSwapperFixture implements 
PersistRepositoryConfigurationYamlSwapper<PersistRepositoryConfigurationFixture>
 {
+public final class PersistRepositoryConfigurationYamlSwapperFixture implements 
PersistRepositoryConfigurationYamlSwapper<PersistRepositoryConfigurationFixture>
 {
     
     @Override
     public YamlPersistRepositoryConfiguration swapToYamlConfiguration(final 
PersistRepositoryConfigurationFixture data) {
@@ -39,5 +39,4 @@ public class PersistRepositoryConfigurationYamlSwapperFixture 
implements Persist
     public String getType() {
         return "Fixture";
     }
-    
 }
diff --git 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactoryTest.java
 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactoryTest.java
index 0b79ad1aa76..b399d1bbd5b 100644
--- 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactoryTest.java
+++ 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactoryTest.java
@@ -26,20 +26,18 @@ import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
-public class PersistRepositoryConfigurationYamlSwapperFactoryTest {
+public final class PersistRepositoryConfigurationYamlSwapperFactoryTest {
     
-    @SuppressWarnings("rawtypes")
     @Test
     public void assertGetInstance() {
-        PersistRepositoryConfigurationYamlSwapper swapper = 
PersistRepositoryConfigurationYamlSwapperFactory.getInstance("Fixture");
-        assertThat(swapper, 
instanceOf(PersistRepositoryConfigurationYamlSwapperFixture.class));
+        
assertThat(PersistRepositoryConfigurationYamlSwapperFactory.getInstance("Fixture"),
 instanceOf(PersistRepositoryConfigurationYamlSwapperFixture.class));
     }
     
     @SuppressWarnings("rawtypes")
     @Test
     public void assertFindInstance() {
-        Optional<PersistRepositoryConfigurationYamlSwapper> optional = 
PersistRepositoryConfigurationYamlSwapperFactory.findInstance("Fixture");
-        assertTrue(optional.isPresent());
-        
+        Optional<PersistRepositoryConfigurationYamlSwapper> actual = 
PersistRepositoryConfigurationYamlSwapperFactory.findInstance("Fixture");
+        assertTrue(actual.isPresent());
+        assertThat(actual.get(), 
instanceOf(PersistRepositoryConfigurationYamlSwapperFixture.class));
     }
 }
diff --git 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
index 74b8b3308c6..dbfc0939256 100644
--- 
a/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
+++ 
b/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
 
-org.apache.shardingsphere.infra.yaml.config.swapper.fixture.PersistRepositoryConfigurationYamlSwapperFixture
\ No newline at end of file
+org.apache.shardingsphere.infra.yaml.config.swapper.fixture.PersistRepositoryConfigurationYamlSwapperFixture

Reply via email to