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 2022/10/06 16:09:19 UTC

[shardingsphere] branch master updated: Adding test to YamlTransactionRuleConfigurationSwapper (#21360)

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 d31300dacfc Adding test to YamlTransactionRuleConfigurationSwapper (#21360)
d31300dacfc is described below

commit d31300dacfc1df3ac90a71a8bca1a3a6f4ac88f4
Author: Gabriel Cunha <cu...@gmail.com>
AuthorDate: Thu Oct 6 13:09:10 2022 -0300

    Adding test to YamlTransactionRuleConfigurationSwapper (#21360)
    
    * Adding test to YamlTransactionRuleConfigurationSwapper
    
    * Adding license
---
 ...amlTransactionRuleConfigurationSwapperTest.java | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/yaml/swapper/YamlTransactionRuleConfigurationSwapperTest.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/yaml/swapper/YamlTransactionRuleConfigurationSwapperTest.java
new file mode 100644
index 00000000000..e66b5b3b9d9
--- /dev/null
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/yaml/swapper/YamlTransactionRuleConfigurationSwapperTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.transaction.yaml.swapper;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Properties;
+import org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
+import org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration;
+import org.junit.Test;
+
+public class YamlTransactionRuleConfigurationSwapperTest {
+    
+    private final YamlTransactionRuleConfigurationSwapper swapper = new YamlTransactionRuleConfigurationSwapper();
+    
+    @Test
+    public void assertSwapToYamlConfiguration() {
+        Properties props = new Properties();
+        TransactionRuleConfiguration yamlTransactionRuleConfig = new TransactionRuleConfiguration("default", "provider", props);
+        YamlTransactionRuleConfiguration actual = swapper.swapToYamlConfiguration(yamlTransactionRuleConfig);
+        assertEquals(props, actual.getProps());
+        assertEquals("provider", actual.getProviderType());
+        assertEquals("default", actual.getDefaultType());
+    }
+    
+}