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

jimin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new 87638977a8 test : added some UT (#7638)
87638977a8 is described below

commit 87638977a88b2896209d2e98f830aef82df2ef41
Author: legendpei <[email protected]>
AuthorDate: Wed Oct 15 14:12:38 2025 +0800

    test : added some UT (#7638)
---
 changes/en-us/2.x.md                               |   3 +
 changes/zh-cn/2.x.md                               |   2 +
 .../AbstractRemoteResourceBundleTest.java          | 132 +++++++++++++++++++++
 .../exception/ParseEndpointExceptionTest.java      |  86 ++++++++++++++
 .../org/apache/seata/common/io/FileLoaderTest.java |  38 ++++++
 .../common/loader/EnhancedServiceLoaderTest.java   |   6 +-
 .../apache/seata/common/store/LockModeTest.java    |  68 +++++++++++
 .../apache/seata/common/store/SessionModeTest.java |  67 +++++++++++
 .../apache/seata/common/store/StoreModeTest.java   |  68 +++++++++++
 .../seata/org.apache.seata.common.loader.Hello     |   3 +-
 .../services/org.apache.seata.common.loader.Hello  |   6 +-
 11 files changed, 474 insertions(+), 5 deletions(-)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index dd79eceff7..7e5811a8eb 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -79,6 +79,8 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7610](https://github.com/apache/incubator-seata/pull/7610)] Enable Nacos 
integration tests when nacosCaseEnabled is true
 - [[#7672](https://github.com/apache/incubator-seata/pull/7672)] Add unit 
tests for the `seata-common` module
 - [[#7679](https://github.com/apache/incubator-seata/pull/7679)] fix old 
version connect timeout
+- [[#7638](https://github.com/apache/incubator-seata/pull/7638)]Add unit tests 
for the `seata-common` module and remove a todo
+
 
 ### refactor:
 
@@ -115,5 +117,6 @@ Thanks to these contributors for their code commits. Please 
report an unintended
 - [jihun4452](https://github.com/jihun4452)
 - [psxjoy](https://github.com/psxjoy)
 - [dsomehan](https://github.com/dsomehan)
+- [LegendPei](https://github.com/LegendPei)
 
 Also, we receive many valuable issues, questions and advices from our 
community. Thanks for you all.
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 04979d80e4..6bf12ba6de 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -79,6 +79,7 @@
 - [[#7610](https://github.com/apache/incubator-seata/pull/7610)] 
当nacosCaseEnabled为true时启用nacos集成测试
 - [[#7672](https://github.com/apache/incubator-seata/pull/7672)] 增加 
`seata-common` 模块的测试用例
 - [[#7679](https://github.com/apache/incubator-seata/pull/7679)] 修复旧版本协议测试超时问题
+- [[#7638](https://github.com/apache/incubator-seata/pull/7638)] 增加了 
`seata-common` 模块的测试用例,删去了一个todo
 
 ### refactor:
 
@@ -115,6 +116,7 @@
 - [jihun4452](https://github.com/jihun4452)
 - [psxjoy](https://github.com/psxjoy)
 - [dsomehan](https://github.com/dsomehan)
+- [LegendPei](https://github.com/LegendPei)
 
 
 同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
diff --git 
a/common/src/test/java/org/apache/seata/common/exception/AbstractRemoteResourceBundleTest.java
 
b/common/src/test/java/org/apache/seata/common/exception/AbstractRemoteResourceBundleTest.java
new file mode 100644
index 0000000000..387a3bfeb4
--- /dev/null
+++ 
b/common/src/test/java/org/apache/seata/common/exception/AbstractRemoteResourceBundleTest.java
@@ -0,0 +1,132 @@
+/*
+ * 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.seata.common.exception;
+
+import org.jetbrains.annotations.NotNull;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.MissingResourceException;
+
+class AbstractRemoteResourceBundleTest {
+
+    private static class TestResourceBundle extends 
AbstractRemoteResourceBundle {
+
+        @Override
+        protected Object handleGetObject(@NotNull String key) {
+            return null;
+        }
+
+        @NotNull
+        @Override
+        public Enumeration<String> getKeys() {
+            return new Enumeration<String>() {
+                private final String[] keys = {"key1", "key2", "key3"};
+                private int index = 0;
+
+                @Override
+                public boolean hasMoreElements() {
+                    return index < keys.length;
+                }
+
+                @Override
+                public String nextElement() {
+                    if (index >= keys.length) {
+                        throw new IllegalStateException("No more elements");
+                    }
+                    return keys[index++];
+                }
+            };
+        }
+    }
+
+    @Test
+    void testGetString_valueIsNull() {
+        TestResourceBundle bundle = new TestResourceBundle();
+        Assertions.assertThrows(MissingResourceException.class, () -> 
bundle.getString("key1"));
+    }
+
+    @Test
+    void testGetString_keyNotFound() {
+        TestResourceBundle bundle = new TestResourceBundle();
+        Assertions.assertThrows(MissingResourceException.class, () -> 
bundle.getString("nonexistent"));
+    }
+
+    @Test
+    void testGetObject_valueIsNull() {
+        TestResourceBundle bundle = new TestResourceBundle();
+        Assertions.assertThrows(MissingResourceException.class, () -> 
bundle.getObject("key2"));
+    }
+
+    @Test
+    void testGetObject_keyNotFound() {
+        TestResourceBundle bundle = new TestResourceBundle();
+        Assertions.assertThrows(MissingResourceException.class, () -> 
bundle.getObject("missing"));
+    }
+
+    @Test
+    void testGetKeys_normal() {
+        TestResourceBundle bundle = new TestResourceBundle();
+        Enumeration<String> keys = bundle.getKeys();
+
+        Assertions.assertNotNull(keys);
+        Assertions.assertTrue(keys.hasMoreElements());
+
+        ArrayList<String> actual = new ArrayList<>();
+        while (keys.hasMoreElements()) {
+            actual.add(keys.nextElement());
+        }
+
+        Assertions.assertEquals(java.util.Arrays.asList("key1", "key2", 
"key3"), actual);
+    }
+
+    @Test
+    void testGetKeys_empty() {
+        AbstractRemoteResourceBundle emptyBundle = new 
AbstractRemoteResourceBundle() {
+            @Override
+            protected Object handleGetObject(@NotNull String key) {
+                return null;
+            }
+
+            @NotNull
+            @Override
+            public Enumeration<String> getKeys() {
+                return Collections.emptyEnumeration();
+            }
+        };
+
+        Enumeration<String> keys = emptyBundle.getKeys();
+        Assertions.assertNotNull(keys);
+        Assertions.assertFalse(keys.hasMoreElements());
+    }
+
+    @Test
+    void testContainsKey_keyAbsent() {
+        TestResourceBundle bundle = new TestResourceBundle();
+        Assertions.assertFalse(bundle.containsKey("key1"));
+    }
+
+    @Test
+    void testToString_default() {
+        TestResourceBundle bundle = new TestResourceBundle();
+        Assertions.assertNotNull(bundle.toString());
+    }
+}
diff --git 
a/common/src/test/java/org/apache/seata/common/exception/ParseEndpointExceptionTest.java
 
b/common/src/test/java/org/apache/seata/common/exception/ParseEndpointExceptionTest.java
new file mode 100644
index 0000000000..5181aa2583
--- /dev/null
+++ 
b/common/src/test/java/org/apache/seata/common/exception/ParseEndpointExceptionTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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.seata.common.exception;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+class ParseEndpointExceptionTest {
+
+    @Test
+    void testNoArgConstructor() {
+        ParseEndpointException e = new ParseEndpointException();
+        Assertions.assertNull(e.getMessage());
+        Assertions.assertNull(e.getCause());
+    }
+
+    @Test
+    void testMessageConstructor() {
+        String message = "Invalid endpoint format: tcp://localhost:8091";
+        ParseEndpointException e = new ParseEndpointException(message);
+        Assertions.assertEquals(message, e.getMessage());
+        Assertions.assertNull(e.getCause());
+    }
+
+    @Test
+    void testCauseConstructor() {
+        ParseEndpointException e = new ParseEndpointException();
+        Assertions.assertNull(e.getMessage());
+        Assertions.assertNull(e.getCause());
+    }
+
+    @Test
+    void testMessageAndCauseConstructor() {
+        String message = "Failed to parse endpoint";
+        Throwable cause = new IllegalArgumentException("missing host");
+        ParseEndpointException e = new ParseEndpointException(message, cause);
+        Assertions.assertEquals(message, e.getMessage());
+        Assertions.assertSame(cause, e.getCause());
+    }
+
+    @Test
+    void testAllArgsConstructor() {
+        String message = "endpoint malformed";
+        Throwable cause = new RuntimeException("network error");
+        boolean enableSuppression = true;
+        boolean writableStackTrace = false;
+
+        ParseEndpointException e = new ParseEndpointException(message, cause, 
enableSuppression, writableStackTrace);
+
+        Assertions.assertEquals(message, e.getMessage());
+        Assertions.assertSame(cause, e.getCause());
+
+        Assertions.assertEquals(0, e.getStackTrace().length);
+    }
+
+    @Test
+    void testToStringAndPrintStackTrace() {
+        ParseEndpointException e = new ParseEndpointException("test", new 
NullPointerException());
+        Assertions.assertNotNull(e.toString());
+
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        PrintStream ps = new PrintStream(out);
+        try {
+            e.printStackTrace(ps);
+            Assertions.assertTrue(out.size() > 0);
+        } catch (Exception ignored) {
+        }
+    }
+}
diff --git 
a/common/src/test/java/org/apache/seata/common/io/FileLoaderTest.java 
b/common/src/test/java/org/apache/seata/common/io/FileLoaderTest.java
index 7993cb40f3..9124034930 100644
--- a/common/src/test/java/org/apache/seata/common/io/FileLoaderTest.java
+++ b/common/src/test/java/org/apache/seata/common/io/FileLoaderTest.java
@@ -20,6 +20,9 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
 import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 
 public class FileLoaderTest {
 
@@ -39,4 +42,39 @@ public class FileLoaderTest {
     public void testLoadException() {
         Assertions.assertThrows(IllegalArgumentException.class, () -> 
FileLoader.load(null));
     }
+
+    @Test
+    public void testLoadWhenDirectPath() throws Exception {
+        Path tempFile = Paths.get("direct-test-file.txt");
+        Files.createFile(tempFile);
+
+        File result = FileLoader.load("direct-test-file.txt");
+
+        Assertions.assertNotNull(result);
+        Assertions.assertTrue(result.exists());
+
+        Files.deleteIfExists(tempFile);
+    }
+
+    @Test
+    public void testLoadWhenSpecial() throws Exception {
+        String encodedName = "测试%20文件.txt";
+        String decodedName = "测试 文件.txt";
+
+        Path tempFile = Paths.get(decodedName);
+        Files.createFile(tempFile);
+
+        File result = FileLoader.load(encodedName);
+
+        Assertions.assertNotNull(result);
+        Assertions.assertTrue(result.exists());
+
+        Files.deleteIfExists(tempFile);
+    }
+
+    @Test
+    public void testLoadWhenNull() {
+        File result = FileLoader.load("nonexistent/path.txt");
+        Assertions.assertNull(result);
+    }
 }
diff --git 
a/common/src/test/java/org/apache/seata/common/loader/EnhancedServiceLoaderTest.java
 
b/common/src/test/java/org/apache/seata/common/loader/EnhancedServiceLoaderTest.java
index 7997804874..63d44a698f 100644
--- 
a/common/src/test/java/org/apache/seata/common/loader/EnhancedServiceLoaderTest.java
+++ 
b/common/src/test/java/org/apache/seata/common/loader/EnhancedServiceLoaderTest.java
@@ -30,7 +30,6 @@ import static org.assertj.core.api.Assertions.assertThat;
  * The type Enhanced service loader test.
  */
 public class EnhancedServiceLoaderTest {
-
     /**
      * Test load by class and class loader.
      */
@@ -73,6 +72,8 @@ public class EnhancedServiceLoaderTest {
      */
     @Test
     public void testLoadByClassAndClassLoaderAndActivateName() {
+        EnhancedServiceLoader.unloadAll();
+
         Hello englishHello = EnhancedServiceLoader.load(
                 Hello.class, "EnglishHello", 
EnhancedServiceLoaderTest.class.getClassLoader());
         assertThat(englishHello.say()).isEqualTo("hello!");
@@ -178,8 +179,7 @@ public class EnhancedServiceLoaderTest {
         assertThat(serviceLoaders.get(Hello.class)).isNull();
     }
 
-    // FIXME: 2023/2/11 wait fix EnhancedServiceLoader.unload(Class<S> 
service, String activateName)
-    // @Test
+    @Test
     public void testUnloadByClassAndActivateName() throws 
NoSuchFieldException, IllegalAccessException {
         Hello englishHello = EnhancedServiceLoader.load(Hello.class, 
"EnglishHello");
         assertThat(englishHello.say()).isEqualTo("hello!");
diff --git 
a/common/src/test/java/org/apache/seata/common/store/LockModeTest.java 
b/common/src/test/java/org/apache/seata/common/store/LockModeTest.java
new file mode 100644
index 0000000000..cff12f3f48
--- /dev/null
+++ b/common/src/test/java/org/apache/seata/common/store/LockModeTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.seata.common.store;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class LockModeTest {
+    @Test
+    void testGetName() {
+        Assertions.assertEquals("file", LockMode.FILE.getName());
+        Assertions.assertEquals("db", LockMode.DB.getName());
+        Assertions.assertEquals("redis", LockMode.REDIS.getName());
+        Assertions.assertEquals("raft", LockMode.RAFT.getName());
+    }
+
+    @Test
+    void testGet() {
+        Assertions.assertEquals(LockMode.FILE, LockMode.get("file"));
+        Assertions.assertEquals(LockMode.FILE, LockMode.get("FILE"));
+        Assertions.assertEquals(LockMode.FILE, LockMode.get("FiLe"));
+        Assertions.assertEquals(LockMode.DB, LockMode.get("db"));
+        Assertions.assertEquals(LockMode.DB, LockMode.get("DB"));
+        Assertions.assertEquals(LockMode.REDIS, LockMode.get("redis"));
+        Assertions.assertEquals(LockMode.REDIS, LockMode.get("REDIS"));
+        Assertions.assertEquals(LockMode.RAFT, LockMode.get("raft"));
+        Assertions.assertEquals(LockMode.RAFT, LockMode.get("Raft"));
+    }
+
+    @Test
+    void testGetUnknown() {
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
LockMode.get("unknown"));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
LockMode.get(""));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
LockMode.get(null));
+    }
+
+    @Test
+    void testContainsValid() {
+        Assertions.assertTrue(LockMode.contains("file"));
+        Assertions.assertTrue(LockMode.contains("FILE"));
+        Assertions.assertTrue(LockMode.contains("FiLe"));
+        Assertions.assertTrue(LockMode.contains("db"));
+        Assertions.assertTrue(LockMode.contains("redis"));
+        Assertions.assertTrue(LockMode.contains("raft"));
+    }
+
+    @Test
+    void testContainsInvalid() {
+        Assertions.assertFalse(LockMode.contains("unknown"));
+        Assertions.assertFalse(LockMode.contains(""));
+        Assertions.assertFalse(LockMode.contains(null));
+    }
+}
diff --git 
a/common/src/test/java/org/apache/seata/common/store/SessionModeTest.java 
b/common/src/test/java/org/apache/seata/common/store/SessionModeTest.java
new file mode 100644
index 0000000000..d2386599ca
--- /dev/null
+++ b/common/src/test/java/org/apache/seata/common/store/SessionModeTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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.seata.common.store;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class SessionModeTest {
+    @Test
+    void testGetName() {
+        Assertions.assertEquals("file", SessionMode.FILE.getName());
+        Assertions.assertEquals("db", SessionMode.DB.getName());
+        Assertions.assertEquals("redis", SessionMode.REDIS.getName());
+        Assertions.assertEquals("raft", SessionMode.RAFT.getName());
+    }
+
+    @Test
+    void testGet() {
+        Assertions.assertEquals(SessionMode.FILE, SessionMode.get("file"));
+        Assertions.assertEquals(SessionMode.FILE, SessionMode.get("FILE"));
+        Assertions.assertEquals(SessionMode.FILE, SessionMode.get("FiLe"));
+        Assertions.assertEquals(SessionMode.DB, SessionMode.get("db"));
+        Assertions.assertEquals(SessionMode.DB, SessionMode.get("DB"));
+        Assertions.assertEquals(SessionMode.REDIS, SessionMode.get("redis"));
+        Assertions.assertEquals(SessionMode.REDIS, SessionMode.get("REDIS"));
+        Assertions.assertEquals(SessionMode.RAFT, SessionMode.get("raft"));
+        Assertions.assertEquals(SessionMode.RAFT, SessionMode.get("Raft"));
+    }
+
+    @Test
+    void testGetUnknown() {
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
SessionMode.get("unknown"));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
SessionMode.get(""));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
SessionMode.get(null));
+    }
+
+    @Test
+    void testContainsValid() {
+        Assertions.assertTrue(SessionMode.contains("file"));
+        Assertions.assertTrue(SessionMode.contains("FILE"));
+        Assertions.assertTrue(SessionMode.contains("FiLe"));
+        Assertions.assertTrue(SessionMode.contains("db"));
+        Assertions.assertTrue(SessionMode.contains("redis"));
+        Assertions.assertTrue(SessionMode.contains("raft"));
+    }
+
+    @Test
+    void testContainsInvalid() {
+        Assertions.assertFalse(SessionMode.contains("unknown"));
+        Assertions.assertFalse(SessionMode.contains(""));
+        Assertions.assertFalse(SessionMode.contains(null));
+    }
+}
diff --git 
a/common/src/test/java/org/apache/seata/common/store/StoreModeTest.java 
b/common/src/test/java/org/apache/seata/common/store/StoreModeTest.java
new file mode 100644
index 0000000000..11a69f184b
--- /dev/null
+++ b/common/src/test/java/org/apache/seata/common/store/StoreModeTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.seata.common.store;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class StoreModeTest {
+    @Test
+    void testGetName() {
+        Assertions.assertEquals("file", StoreMode.FILE.getName());
+        Assertions.assertEquals("db", StoreMode.DB.getName());
+        Assertions.assertEquals("redis", StoreMode.REDIS.getName());
+        Assertions.assertEquals("raft", StoreMode.RAFT.getName());
+    }
+
+    @Test
+    void testGet() {
+        Assertions.assertEquals(StoreMode.FILE, StoreMode.get("file"));
+        Assertions.assertEquals(StoreMode.FILE, StoreMode.get("FILE"));
+        Assertions.assertEquals(StoreMode.FILE, StoreMode.get("FiLe"));
+        Assertions.assertEquals(StoreMode.DB, StoreMode.get("db"));
+        Assertions.assertEquals(StoreMode.DB, StoreMode.get("DB"));
+        Assertions.assertEquals(StoreMode.REDIS, StoreMode.get("redis"));
+        Assertions.assertEquals(StoreMode.REDIS, StoreMode.get("REDIS"));
+        Assertions.assertEquals(StoreMode.RAFT, StoreMode.get("raft"));
+        Assertions.assertEquals(StoreMode.RAFT, StoreMode.get("Raft"));
+    }
+
+    @Test
+    void testGetUnknown() {
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
StoreMode.get("unknown"));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
StoreMode.get(""));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> 
StoreMode.get(null));
+    }
+
+    @Test
+    void testContainsValidMode() {
+        Assertions.assertTrue(StoreMode.contains("file"));
+        Assertions.assertTrue(StoreMode.contains("FILE"));
+        Assertions.assertTrue(StoreMode.contains("FiLe"));
+        Assertions.assertTrue(StoreMode.contains("db"));
+        Assertions.assertTrue(StoreMode.contains("redis"));
+        Assertions.assertTrue(StoreMode.contains("raft"));
+    }
+
+    @Test
+    void testContainsInvalid() {
+        Assertions.assertFalse(StoreMode.contains("unknown"));
+        Assertions.assertFalse(StoreMode.contains(""));
+        Assertions.assertFalse(StoreMode.contains(null));
+    }
+}
diff --git 
a/common/src/test/resources/META-INF/seata/org.apache.seata.common.loader.Hello 
b/common/src/test/resources/META-INF/seata/org.apache.seata.common.loader.Hello
index c2b5496aa7..c993602e8e 100644
--- 
a/common/src/test/resources/META-INF/seata/org.apache.seata.common.loader.Hello
+++ 
b/common/src/test/resources/META-INF/seata/org.apache.seata.common.loader.Hello
@@ -15,6 +15,7 @@
 # limitations under the License.
 #
 
-org.apache.seata.common.loader.FrenchHello
+org.apache.seata.common.loader.ChineseHello
 org.apache.seata.common.loader.EnglishHello
+org.apache.seata.common.loader.FrenchHello
 org.apache.seata.common.loader.LatinHello
\ No newline at end of file
diff --git 
a/common/src/test/resources/META-INF/services/org.apache.seata.common.loader.Hello
 
b/common/src/test/resources/META-INF/services/org.apache.seata.common.loader.Hello
index f865548c64..c993602e8e 100644
--- 
a/common/src/test/resources/META-INF/services/org.apache.seata.common.loader.Hello
+++ 
b/common/src/test/resources/META-INF/services/org.apache.seata.common.loader.Hello
@@ -14,4 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-org.apache.seata.common.loader.ChineseHello
\ No newline at end of file
+
+org.apache.seata.common.loader.ChineseHello
+org.apache.seata.common.loader.EnglishHello
+org.apache.seata.common.loader.FrenchHello
+org.apache.seata.common.loader.LatinHello
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to