Skip to content

Commit

Permalink
Remove useless GlobalRulePersistServiceFixtureYamlRuleConfiguration (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Sep 25, 2024
1 parent 2998b7e commit 997cfe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
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;
Expand Down Expand Up @@ -81,7 +81,7 @@ void assertPersistWithVersions() {
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"));
Expand All @@ -97,7 +97,7 @@ void assertPersistWithoutVersions() {
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));
Expand Down

This file was deleted.

0 comments on commit 997cfe1

Please sign in to comment.