You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2024/09/25 17:10:52 UTC

(shardingsphere) branch master updated: Remove useless GlobalRulePersistServiceFixtureYamlRuleConfiguration (#33004)

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 997cfe1320c Remove useless GlobalRulePersistServiceFixtureYamlRuleConfiguration (#33004)
997cfe1320c is described below

commit 997cfe1320c970080c7ed4c0961189605a2f9428
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Sep 26 01:10:45 2024 +0800

    Remove useless GlobalRulePersistServiceFixtureYamlRuleConfiguration (#33004)
---
 .../global/GlobalRulePersistServiceTest.java       |  6 ++---
 ...PersistServiceFixtureYamlRuleConfiguration.java | 31 ----------------------
 2 files changed, 3 insertions(+), 34 deletions(-)

diff --git a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistServiceTest.java b/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistServiceTest.java
index 91f3f27a316..6e80fa22d48 100644
--- a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistServiceTest.java
+++ b/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistServiceTest.java
@@ -21,8 +21,8 @@ import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
 import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPILoader;
 import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration;
 import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
+import org.apache.shardingsphere.metadata.persist.fixture.YamlRuleConfigurationFixture;
 import org.apache.shardingsphere.metadata.persist.service.config.RepositoryTuplePersistService;
-import org.apache.shardingsphere.metadata.persist.service.config.global.fixture.GlobalRulePersistServiceFixtureYamlRuleConfiguration;
 import org.apache.shardingsphere.metadata.persist.service.version.MetaDataVersionPersistService;
 import org.apache.shardingsphere.mode.spi.PersistRepository;
 import org.apache.shardingsphere.test.mock.AutoMockExtension;
@@ -81,7 +81,7 @@ class GlobalRulePersistServiceTest {
         RuleConfiguration ruleConfig = mock(RuleConfiguration.class);
         YamlRuleConfigurationSwapper swapper = mock(YamlRuleConfigurationSwapper.class);
         when(OrderedSPILoader.getServices(YamlRuleConfigurationSwapper.class, Collections.singleton(ruleConfig))).thenReturn(Collections.singletonMap(ruleConfig, swapper));
-        YamlRuleConfiguration yamlRuleConfig = new GlobalRulePersistServiceFixtureYamlRuleConfiguration();
+        YamlRuleConfiguration yamlRuleConfig = new YamlRuleConfigurationFixture();
         when(swapper.swapToYamlConfiguration(ruleConfig)).thenReturn(yamlRuleConfig);
         when(repository.query("/rules/fixture/active_version")).thenReturn("10");
         when(repository.getChildrenKeys("/rules/fixture/versions")).thenReturn(Collections.singletonList("10"));
@@ -97,7 +97,7 @@ class GlobalRulePersistServiceTest {
         RuleConfiguration ruleConfig = mock(RuleConfiguration.class);
         YamlRuleConfigurationSwapper swapper = mock(YamlRuleConfigurationSwapper.class);
         when(OrderedSPILoader.getServices(YamlRuleConfigurationSwapper.class, Collections.singleton(ruleConfig))).thenReturn(Collections.singletonMap(ruleConfig, swapper));
-        YamlRuleConfiguration yamlRuleConfig = new GlobalRulePersistServiceFixtureYamlRuleConfiguration();
+        YamlRuleConfiguration yamlRuleConfig = new YamlRuleConfigurationFixture();
         when(swapper.swapToYamlConfiguration(ruleConfig)).thenReturn(yamlRuleConfig);
         when(repository.getChildrenKeys("/rules/fixture/versions")).thenReturn(Collections.emptyList());
         globalRulePersistService.persist(Collections.singleton(ruleConfig));
diff --git a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/fixture/GlobalRulePersistServiceFixtureYamlRuleConfiguration.java b/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/fixture/GlobalRulePersistServiceFixtureYamlRuleConfiguration.java
deleted file mode 100644
index 3c53b6054f7..00000000000
--- a/kernel/metadata/core/src/test/java/org/apache/shardingsphere/metadata/persist/service/config/global/fixture/GlobalRulePersistServiceFixtureYamlRuleConfiguration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.metadata.persist.service.config.global.fixture;
-
-import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration;
-import org.apache.shardingsphere.mode.tuple.annotation.RepositoryTupleEntity;
-
-@RepositoryTupleEntity(value = "fixture", leaf = true)
-public final class GlobalRulePersistServiceFixtureYamlRuleConfiguration implements YamlRuleConfiguration {
-    
-    @Override
-    public Class<? extends RuleConfiguration> getRuleConfigurationType() {
-        return null;
-    }
-}