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



##########
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";));

Review comment:
       done

##########
File path: 
deployment/src/test/java/org/apache/servicecomb/deployment/TestDeployment.java
##########
@@ -31,45 +31,9 @@ public void tearDown() {
 
   @Test
   public void testConfiguration() {
-    DefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
-    SystemBootstrapInfo info = 
Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_SERVICE_CENTER);
-    Assert.assertEquals(info.getAccessURL().get(0), "http://127.0.0.1:30100";);
-    info = 
Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
+    CustomDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
+    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo("TestCenter");
     Assert.assertEquals(info.getAccessURL().get(0), "http://lcalhost/custom";);

Review comment:
       done




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