AngLi2 commented on a change in pull request #2358:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737416



##########
File path: 
deployment/src/test/java/org/apache/servicecomb/deployment/CustomDeploymentProvider.java
##########
@@ -17,23 +17,32 @@
 
 package org.apache.servicecomb.deployment;
 
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+
 import java.util.Arrays;
 
 public class CustomDeploymentProvider implements DeploymentProvider {
+  private static AbstractConfiguration configuration = 
ConfigUtil.createLocalConfig();
+
   @Override
   public int getOrder() {
     return 0;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER:
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList("http://lcalhost/custom";));
-        return cc;
-      default:
-        return null;
+    if (systemKey.contentEquals("TestCenter")) {
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList("http://lcalhost/custom";));
+      return cc;
     }
+    return null;

Review comment:
       ```java
   if (!systemKey.contentEquals("TestCenter")) {
     return null;
   }
   xxx
   xxx
   ```
   seems to be better




-- 
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.

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


Reply via email to