YongGoose commented on code in PR #7345:
URL: https://github.com/apache/incubator-seata/pull/7345#discussion_r2103731407


##########
discovery/seata-discovery-core/src/test/java/org/apache/seata/discovery/registry/MultiRegistryFactoryTest.java:
##########


Review Comment:
   Since it’s been changed to a `TreeSet`, it might be good to add a few more 
test cases
   1. When the same `RegistryType` is provided with different casing (e.g., 
`File`, `FILE`), does it recognize them as the same?
       - This could be verified by **checking the size of registerTypeNames and 
the corresponding log output.**
   
   2. When more than one RegistryType is provided, does **the log output as 
expected**?
   3. When a value not defined in RegistryType is passed, is the appropriate 
exception thrown?



##########
discovery/seata-discovery-core/src/main/java/org/apache/seata/discovery/registry/RegistryFactory.java:
##########
@@ -45,8 +45,12 @@ public static RegistryService getInstance() {
     private static RegistryService buildRegistryService() {
         RegistryType registryType;
         String registryTypeName = 
ConfigurationFactory.CURRENT_FILE_INSTANCE.getConfig(
-            ConfigurationKeys.FILE_ROOT_REGISTRY + 
ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
-                + ConfigurationKeys.FILE_ROOT_TYPE);
+                ConfigurationKeys.FILE_ROOT_REGISTRY + 
ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR + ConfigurationKeys.FILE_ROOT_TYPE);
+
+        if (StringUtils.isBlank(registryTypeName)) {
+            registryTypeName = RegistryType.File.name();
+        }
+
         LOGGER.info("use registry center type: {}", registryTypeName);
         try {

Review Comment:
   This try-catch block could be removed, as it simply catches the exception 
and rethrows it without adding any additional handling.



-- 
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: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to