This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 e2eb4ee6ff6 Fix sonar issues (#33037)
e2eb4ee6ff6 is described below
commit e2eb4ee6ff6a2b0d35e842385d2449f2d1eaadc3
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Sep 28 19:25:46 2024 +0800
Fix sonar issues (#33037)
* Fix sonar issues
* Fix sonar issues
---
.../infra/yaml/schema/swapper/YamlSchemaSwapperTest.java | 2 +-
.../persist/service/config/global/PropertiesPersistServiceTest.java | 4 ++--
.../apache/shardingsphere/test/it/yaml/YamlRuleConfigurationIT.java | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/infra/common/src/test/java/org/apache/shardingsphere/infra/yaml/schema/swapper/YamlSchemaSwapperTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/yaml/schema/swapper/YamlSchemaSwapperTest.java
index b1b01552215..b39d7828f85 100644
---
a/infra/common/src/test/java/org/apache/shardingsphere/infra/yaml/schema/swapper/YamlSchemaSwapperTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/yaml/schema/swapper/YamlSchemaSwapperTest.java
@@ -112,6 +112,6 @@ class YamlSchemaSwapperTest {
@SneakyThrows({URISyntaxException.class, IOException.class})
private String readYAML(final String yamlFile) {
- return
Files.readAllLines(Paths.get(ClassLoader.getSystemResource(yamlFile).toURI())).stream().map(each
-> each + System.lineSeparator()).collect(Collectors.joining());
+ return
Files.readAllLines(Paths.get(ClassLoader.getSystemResource(yamlFile).toURI())).stream().collect(Collectors.joining(System.lineSeparator()));
}
}
diff --git
a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistServiceTest.java
b/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistServiceTest.java
index c165d2ef2b2..fb7c5a491b1 100644
---
a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistServiceTest.java
+++
b/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistServiceTest.java
@@ -68,7 +68,7 @@ class PropertiesPersistServiceTest {
}
@Test
- void persistWithEmptyActiveVersion() {
+ void assertPersistWithEmptyActiveVersion() {
when(repository.query("/props/active_version")).thenReturn("");
persistService.persist(PropertiesBuilder.build(new Property("k",
"v")));
verify(repository).persist("/props/versions/0", "k: v" +
System.lineSeparator());
@@ -77,7 +77,7 @@ class PropertiesPersistServiceTest {
}
@Test
- void persistWithActiveVersion() {
+ void assertPersistWithActiveVersion() {
when(repository.getChildrenKeys("/props/versions")).thenReturn(Collections.singletonList("10"));
persistService.persist(PropertiesBuilder.build(new Property("k",
"v")));
verify(repository).persist("/props/versions/11", "k: v" +
System.lineSeparator());
diff --git
a/test/it/yaml/src/main/java/org/apache/shardingsphere/test/it/yaml/YamlRuleConfigurationIT.java
b/test/it/yaml/src/main/java/org/apache/shardingsphere/test/it/yaml/YamlRuleConfigurationIT.java
index 0c9cb6a645f..2d3f12ec437 100644
---
a/test/it/yaml/src/main/java/org/apache/shardingsphere/test/it/yaml/YamlRuleConfigurationIT.java
+++
b/test/it/yaml/src/main/java/org/apache/shardingsphere/test/it/yaml/YamlRuleConfigurationIT.java
@@ -49,7 +49,7 @@ public abstract class YamlRuleConfigurationIT {
@SuppressWarnings("rawtypes")
private final YamlRuleConfigurationSwapper swapper;
- public YamlRuleConfigurationIT(final String yamlFile, final
RuleConfiguration expectedRuleConfig) {
+ protected YamlRuleConfigurationIT(final String yamlFile, final
RuleConfiguration expectedRuleConfig) {
this.yamlFile = yamlFile;
this.expectedRuleConfig = expectedRuleConfig;
swapper =
OrderedSPILoader.getServices(YamlRuleConfigurationSwapper.class,
Collections.singleton(expectedRuleConfig)).get(expectedRuleConfig);
@@ -90,7 +90,7 @@ public abstract class YamlRuleConfigurationIT {
}
// TODO should remove the method when yaml rule swapper fixed by map's key
- protected boolean assertYamlConfiguration(final YamlRuleConfiguration
actual) {
+ protected boolean assertYamlConfiguration(@SuppressWarnings("unused")
final YamlRuleConfiguration actual) {
return false;
}
}