amirdeljouyi commented on code in PR #8151:
URL: https://github.com/apache/incubator-seata/pull/8151#discussion_r3610893110


##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -124,93 +127,93 @@ void testDiffDefaultValue() {
     }
 
     @Test
-    void testGetConfigWithTimeout() {
+    void testGetConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.key", "default-value", 1000);
         Assertions.assertNotNull(value);
     }
 
     @Test
-    void testGetIntWithTimeout() {
+    void testGetIntWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         int value = fileConfig.getInt("test.int.key", 100, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetBooleanWithTimeout() {
+    void testGetBooleanWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean value = fileConfig.getBoolean("test.boolean.key", true, 1000);
-        Assertions.assertTrue(value || !value);
+        assertTrue(value || !value);
     }
 
     @Test
-    void testGetLongWithTimeout() {
+    void testGetLongWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         long value = fileConfig.getLong("test.long.key", 1000L, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetShortWithTimeout() {
+    void testGetShortWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         short value = fileConfig.getShort("test.short.key", (short) 10, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testPutConfig() {
+    void testPutConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigWithTimeout() {
+    void testPutConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value", 
1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -124,93 +127,93 @@ void testDiffDefaultValue() {
     }
 
     @Test
-    void testGetConfigWithTimeout() {
+    void testGetConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.key", "default-value", 1000);
         Assertions.assertNotNull(value);
     }
 
     @Test
-    void testGetIntWithTimeout() {
+    void testGetIntWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         int value = fileConfig.getInt("test.int.key", 100, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetBooleanWithTimeout() {
+    void testGetBooleanWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean value = fileConfig.getBoolean("test.boolean.key", true, 1000);
-        Assertions.assertTrue(value || !value);
+        assertTrue(value || !value);
     }
 
     @Test
-    void testGetLongWithTimeout() {
+    void testGetLongWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         long value = fileConfig.getLong("test.long.key", 1000L, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetShortWithTimeout() {
+    void testGetShortWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         short value = fileConfig.getShort("test.short.key", (short) 10, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testPutConfig() {
+    void testPutConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -124,93 +127,93 @@ void testDiffDefaultValue() {
     }
 
     @Test
-    void testGetConfigWithTimeout() {
+    void testGetConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.key", "default-value", 1000);
         Assertions.assertNotNull(value);
     }
 
     @Test
-    void testGetIntWithTimeout() {
+    void testGetIntWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         int value = fileConfig.getInt("test.int.key", 100, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetBooleanWithTimeout() {
+    void testGetBooleanWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean value = fileConfig.getBoolean("test.boolean.key", true, 1000);
-        Assertions.assertTrue(value || !value);
+        assertTrue(value || !value);
     }
 
     @Test
-    void testGetLongWithTimeout() {
+    void testGetLongWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         long value = fileConfig.getLong("test.long.key", 1000L, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetShortWithTimeout() {
+    void testGetShortWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         short value = fileConfig.getShort("test.short.key", (short) 10, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testPutConfig() {
+    void testPutConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigWithTimeout() {
+    void testPutConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value", 
1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigIfAbsent() {
+    void testPutConfigIfAbsent() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfigIfAbsent("test.absent.key", 
"test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigIfAbsentWithTimeout() {
+    void testPutConfigIfAbsentWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfigIfAbsent("test.absent.key", 
"test-value", 1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testRemoveConfig() {
+    void testRemoveConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         fileConfig.putConfig("test.remove.key", "test-value");
         boolean result = fileConfig.removeConfig("test.remove.key");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -471,4 +471,48 @@ void testGetConfigFromEnvironmentVariable() {
         String path = fileConfig.getConfigFromSys("PATH");
         Assertions.assertNotNull(path);
     }
+
+    @Test
+    void shouldDelegateFileBackedReadsThroughConfigurationFactory() {
+        String dataId = "service.disableGlobalTransaction";
+        String previousValue = System.getProperty(dataId);
+        try {
+            System.clearProperty(dataId);
+            ConfigurationFactory.reload();
+            Configuration fileConfig = ConfigurationFactory.getInstance();
+
+            Assertions.assertEquals("127.0.0.1:8091", 
fileConfig.getConfig("service.default.grouplist"));
+            Assertions.assertFalse(fileConfig.getBoolean(dataId));
+        } finally {
+            if (previousValue == null) {
+                System.clearProperty(dataId);
+            } else {
+                System.setProperty(dataId, previousValue);
+            }
+            ConfigurationFactory.reload();
+        }
+    }
+
+    @Test
+    void 
shouldReturnDefaultsForMissingConfigurationThroughConfigurationFactory() {
+        Configuration fileConfig = ConfigurationFactory.getInstance();
+
+        Assertions.assertNull(fileConfig.getConfig("adopted.missing.key"));
+        Assertions.assertEquals("fallback", 
fileConfig.getLatestConfig("adopted.missing.key", "fallback", 1000L));
+        Assertions.assertEquals(39, fileConfig.getInt("adopted.missing.int", 
39));
+        Assertions.assertEquals((short) 2, 
fileConfig.getShort("adopted.missing.short", (short) 2));
+    }
+
+    @Test
+    void shouldReportMutationOperationOutcomeThroughConfigurationFactory() {
+        Configuration fileConfig = ConfigurationFactory.getInstance();
+
+        Assertions.assertTrue(fileConfig.putConfig("adopted.put.key", "value", 
1000L));
+        
Assertions.assertTrue(fileConfig.putConfigIfAbsent("adopted.put-if-absent.key", 
"value", 1000L));
+        Assertions.assertTrue(fileConfig.removeConfig("adopted.remove.key", 
1000L));

Review Comment:
   Updated the successful-operation timeout to 5 seconds and kept the negative 
timeout cases.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -435,40 +438,71 @@ void testMultipleConfigOperations() {
     }
 
     @Test
-    void testPutAndGetConfig() {
+    void testPutAndGetConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean putResult = fileConfig.putConfig("test.put.get", "put-value");
-        Assertions.assertTrue(putResult || !putResult);
+        assertTrue(putResult || !putResult);
     }
 
     @Test
-    void testPutConfigIfAbsentWhenKeyExists() {
+    void testPutConfigIfAbsentWhenKeyExists() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         System.setProperty("test.put.if.absent", "existing-value");
         boolean result = fileConfig.putConfigIfAbsent("test.put.if.absent", 
"new-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testRemoveExistingConfig() {
+    void testRemoveExistingConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         System.setProperty("test.remove.existing", "value");
         boolean result = fileConfig.removeConfig("test.remove.existing");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -124,93 +127,93 @@ void testDiffDefaultValue() {
     }
 
     @Test
-    void testGetConfigWithTimeout() {
+    void testGetConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.key", "default-value", 1000);
         Assertions.assertNotNull(value);
     }
 
     @Test
-    void testGetIntWithTimeout() {
+    void testGetIntWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         int value = fileConfig.getInt("test.int.key", 100, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetBooleanWithTimeout() {
+    void testGetBooleanWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean value = fileConfig.getBoolean("test.boolean.key", true, 1000);
-        Assertions.assertTrue(value || !value);
+        assertTrue(value || !value);
     }
 
     @Test
-    void testGetLongWithTimeout() {
+    void testGetLongWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         long value = fileConfig.getLong("test.long.key", 1000L, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetShortWithTimeout() {
+    void testGetShortWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         short value = fileConfig.getShort("test.short.key", (short) 10, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testPutConfig() {
+    void testPutConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigWithTimeout() {
+    void testPutConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value", 
1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigIfAbsent() {
+    void testPutConfigIfAbsent() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfigIfAbsent("test.absent.key", 
"test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -124,93 +127,93 @@ void testDiffDefaultValue() {
     }
 
     @Test
-    void testGetConfigWithTimeout() {
+    void testGetConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.key", "default-value", 1000);
         Assertions.assertNotNull(value);
     }
 
     @Test
-    void testGetIntWithTimeout() {
+    void testGetIntWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         int value = fileConfig.getInt("test.int.key", 100, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetBooleanWithTimeout() {
+    void testGetBooleanWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean value = fileConfig.getBoolean("test.boolean.key", true, 1000);
-        Assertions.assertTrue(value || !value);
+        assertTrue(value || !value);
     }
 
     @Test
-    void testGetLongWithTimeout() {
+    void testGetLongWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         long value = fileConfig.getLong("test.long.key", 1000L, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetShortWithTimeout() {
+    void testGetShortWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         short value = fileConfig.getShort("test.short.key", (short) 10, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testPutConfig() {
+    void testPutConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigWithTimeout() {
+    void testPutConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value", 
1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigIfAbsent() {
+    void testPutConfigIfAbsent() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfigIfAbsent("test.absent.key", 
"test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigIfAbsentWithTimeout() {
+    void testPutConfigIfAbsentWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfigIfAbsent("test.absent.key", 
"test-value", 1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -471,4 +471,48 @@ void testGetConfigFromEnvironmentVariable() {
         String path = fileConfig.getConfigFromSys("PATH");
         Assertions.assertNotNull(path);
     }
+
+    @Test
+    void shouldDelegateFileBackedReadsThroughConfigurationFactory() {
+        String dataId = "service.disableGlobalTransaction";
+        String previousValue = System.getProperty(dataId);
+        try {
+            System.clearProperty(dataId);
+            ConfigurationFactory.reload();
+            Configuration fileConfig = ConfigurationFactory.getInstance();
+
+            Assertions.assertEquals("127.0.0.1:8091", 
fileConfig.getConfig("service.default.grouplist"));
+            Assertions.assertFalse(fileConfig.getBoolean(dataId));
+        } finally {
+            if (previousValue == null) {
+                System.clearProperty(dataId);
+            } else {
+                System.setProperty(dataId, previousValue);
+            }
+            ConfigurationFactory.reload();
+        }

Review Comment:
   Updated to clear and restore both system properties before reloading the 
factory.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -435,40 +438,71 @@ void testMultipleConfigOperations() {
     }
 
     @Test
-    void testPutAndGetConfig() {
+    void testPutAndGetConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean putResult = fileConfig.putConfig("test.put.get", "put-value");
-        Assertions.assertTrue(putResult || !putResult);
+        assertTrue(putResult || !putResult);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -124,93 +127,93 @@ void testDiffDefaultValue() {
     }
 
     @Test
-    void testGetConfigWithTimeout() {
+    void testGetConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.key", "default-value", 1000);
         Assertions.assertNotNull(value);
     }
 
     @Test
-    void testGetIntWithTimeout() {
+    void testGetIntWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         int value = fileConfig.getInt("test.int.key", 100, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetBooleanWithTimeout() {
+    void testGetBooleanWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean value = fileConfig.getBoolean("test.boolean.key", true, 1000);
-        Assertions.assertTrue(value || !value);
+        assertTrue(value || !value);

Review Comment:
   Updated to assert the expected default directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -435,40 +438,71 @@ void testMultipleConfigOperations() {
     }
 
     @Test
-    void testPutAndGetConfig() {
+    void testPutAndGetConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean putResult = fileConfig.putConfig("test.put.get", "put-value");
-        Assertions.assertTrue(putResult || !putResult);
+        assertTrue(putResult || !putResult);
     }
 
     @Test
-    void testPutConfigIfAbsentWhenKeyExists() {
+    void testPutConfigIfAbsentWhenKeyExists() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         System.setProperty("test.put.if.absent", "existing-value");
         boolean result = fileConfig.putConfigIfAbsent("test.put.if.absent", 
"new-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -435,40 +438,71 @@ void testMultipleConfigOperations() {
     }
 
     @Test
-    void testPutAndGetConfig() {
+    void testPutAndGetConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean putResult = fileConfig.putConfig("test.put.get", "put-value");
-        Assertions.assertTrue(putResult || !putResult);
+        assertTrue(putResult || !putResult);
     }
 
     @Test
-    void testPutConfigIfAbsentWhenKeyExists() {
+    void testPutConfigIfAbsentWhenKeyExists() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         System.setProperty("test.put.if.absent", "existing-value");
         boolean result = fileConfig.putConfigIfAbsent("test.put.if.absent", 
"new-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testRemoveExistingConfig() {
+    void testRemoveExistingConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         System.setProperty("test.remove.existing", "value");
         boolean result = fileConfig.removeConfig("test.remove.existing");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testGetConfigFromSystemProperty() {
+    void testGetConfigFromSystemProperty() throws Exception {
         System.setProperty("test.sys.prop", "sys-prop-value");
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.sys.prop");
         Assertions.assertEquals("sys-prop-value", value);
     }
 
     @Test
-    void testGetConfigFromEnvironmentVariable() {
+    void testGetConfigFromEnvironmentVariable() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String path = fileConfig.getConfigFromSys("PATH");
         Assertions.assertNotNull(path);
     }
+
+    @Test
+    void shouldDelegateFileBackedReadsThroughConfigurationFactory() {
+        Configuration fileConfig = ConfigurationFactory.getInstance();
+
+        Assertions.assertEquals("127.0.0.1:8091", 
fileConfig.getConfig("service.default.grouplist"));
+        assertFalse(fileConfig.getBoolean("service.disableGlobalTransaction"));
+    }

Review Comment:
   Updated to clear and restore the relevant system properties before reloading 
the factory.



##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -124,93 +127,93 @@ void testDiffDefaultValue() {
     }
 
     @Test
-    void testGetConfigWithTimeout() {
+    void testGetConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         String value = fileConfig.getConfig("test.key", "default-value", 1000);
         Assertions.assertNotNull(value);
     }
 
     @Test
-    void testGetIntWithTimeout() {
+    void testGetIntWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         int value = fileConfig.getInt("test.int.key", 100, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetBooleanWithTimeout() {
+    void testGetBooleanWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean value = fileConfig.getBoolean("test.boolean.key", true, 1000);
-        Assertions.assertTrue(value || !value);
+        assertTrue(value || !value);
     }
 
     @Test
-    void testGetLongWithTimeout() {
+    void testGetLongWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         long value = fileConfig.getLong("test.long.key", 1000L, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testGetShortWithTimeout() {
+    void testGetShortWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         short value = fileConfig.getShort("test.short.key", (short) 10, 1000);
-        Assertions.assertTrue(value >= 0);
+        assertTrue(value >= 0);
     }
 
     @Test
-    void testPutConfig() {
+    void testPutConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigWithTimeout() {
+    void testPutConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfig("test.put.key", "test-value", 
1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigIfAbsent() {
+    void testPutConfigIfAbsent() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfigIfAbsent("test.absent.key", 
"test-value");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testPutConfigIfAbsentWithTimeout() {
+    void testPutConfigIfAbsentWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         boolean result = fileConfig.putConfigIfAbsent("test.absent.key", 
"test-value", 1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testRemoveConfig() {
+    void testRemoveConfig() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         fileConfig.putConfig("test.remove.key", "test-value");
         boolean result = fileConfig.removeConfig("test.remove.key");
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);
     }
 
     @Test
-    void testRemoveConfigWithTimeout() {
+    void testRemoveConfigWithTimeout() throws Exception {
         Configuration fileConfig = ConfigurationFactory.getInstance();
         fileConfig.putConfig("test.remove.key", "test-value");
         boolean result = fileConfig.removeConfig("test.remove.key", 1000);
-        Assertions.assertTrue(result || !result);
+        assertTrue(result || !result);

Review Comment:
   Updated to assert the expected outcome directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to