public static String getConfigBindingServiceAddrInfo() {\r
         String ret = null;\r
         String queryString = getConsulAddrInfo() + CONFIG_BINDING_SERVICE;\r
+        log.info("Query the CBS address using the URL: " + queryString);\r
         try {\r
             JSONObject addrJson = (JSONObject) JSONArray.fromObject(execQuery(queryString)).get(0);\r
             if (addrJson.has("ServiceAddress") && addrJson.has("ServicePort")) {\r
         } catch (Exception e) {\r
             log.warn(e.getMessage(), e);\r
         }\r
+        log.info("The CBS address is " + ret);\r
         return ret;\r
     }\r
 \r
         String url = getConfigBindingServiceAddrInfo() + "/service_component/" +serviceName;\r
         try {\r
             JSONObject jsonObject = JSONObject.fromObject(execQuery(url));\r
+            log.info("The origin configurations (" + url + ") returned by DCAE is: " + jsonObject.toString());\r
             if (jsonObject.has(serviceName)) {\r
                 ret = (String) jsonObject.getJSONArray(serviceName).get(0);\r
             }\r
     public static String[] getMsbAddrInfo() {\r
         String[] msbServerInfo = null;\r
 \r
-        String info = getServiceAddrInfoFromCBS(MSB_ADDR);\r
+        //String info = getServiceAddrInfoFromCBS(MSB_ADDR);\r
+        String info = getServiceAddrInfoFromCBS(getEnv(HOSTNAME));\r
+        log.info("Got the service information of \"" + getEnv(HOSTNAME) + "\" from CBS. The response is " + info + ".");\r
+        JSONObject infoObj = JSONObject.fromObject(info);\r
+        info = infoObj.has("msb.hostname") ? infoObj.getString("msb.hostname") : null;\r
         if (info != null){\r
             msbServerInfo = split(info);\r
         } else {\r
     public static String[] getServiceAddrInfo() {\r
         String[] serviceAddrInfo = null;\r
         String info = getServiceAddrInfoFromCBS(getEnv(HOSTNAME));\r
+        log.info("Got the service information of \"" + getEnv(HOSTNAME) + "\" from CBS. The response is " + info + ".");\r
         if (info != null){\r
             serviceAddrInfo = split(info);\r
         } else {\r
 
     @Test\r
     public void getMsbServerAddrTest() {\r
         System.setProperty(MSB_ADDR, "test:80");\r
+        System.setProperty(HOSTNAME, "rule-mgmt");\r
+        PowerMock.mockStaticPartial(MicroServiceConfig.class, "getServiceAddrInfoFromCBS", String.class);\r
+        EasyMock.expect(MicroServiceConfig.getServiceAddrInfoFromCBS(System.getProperty(HOSTNAME)))\r
+                .andReturn("{\"msb.hostname\": \"test:80\"}");\r
+        PowerMock.replayAll();\r
         assertThat("http://test:80", equalTo(getMsbServerAddr()));\r
+        PowerMock.verifyAll();\r
+        System.clearProperty(MicroServiceConfig.HOSTNAME);\r
         System.clearProperty(MicroServiceConfig.MSB_ADDR);\r
     }\r
 \r
     @Test\r
     public void getMsbServerIpTest() {\r
         System.setProperty(MSB_ADDR, "10.54.23.79:80");\r
+        System.setProperty(HOSTNAME, "rule-mgmt");\r
+        PowerMock.mockStaticPartial(MicroServiceConfig.class, "getServiceAddrInfoFromCBS", String.class);\r
+        EasyMock.expect(MicroServiceConfig.getServiceAddrInfoFromCBS(System.getProperty(HOSTNAME)))\r
+                .andReturn("{\"msb.hostname\": \"10.54.23.79:80\"}").times(2);\r
+        PowerMock.replayAll();\r
         assertThat("10.54.23.79", equalTo(getMsbAddrInfo()[0]));\r
         assertThat("80", equalTo(getMsbAddrInfo()[1]));\r
+        System.clearProperty(MicroServiceConfig.HOSTNAME);\r
         System.clearProperty(MSB_ADDR);\r
     }\r
 \r
     @Test\r
     public void getMsbAddrInfo_msb_registered() throws Exception {\r
         System.setProperty(MSB_ADDR, "10.74.5.8:1545");\r
-        PowerMock.mockStaticPartial(MicroServiceConfig.class, "execQuery", String.class);\r
-        PowerMock.expectPrivate(MicroServiceConfig.class, "execQuery", EasyMock.anyObject())\r
-                .andReturn("[{\"ServiceAddress\": \"127.0.0.2\", \"ServicePort\": \"8080\"}]");\r
-        PowerMock.expectPrivate(MicroServiceConfig.class, "execQuery", EasyMock.anyObject())\r
-                .andReturn("{\"" + MSB_ADDR + "\": \"[\\\"127.0.0.3:5432\\\"]\"}");\r
+        System.setProperty(HOSTNAME, "rule-mgmt");\r
+        PowerMock.mockStaticPartial(MicroServiceConfig.class, "getServiceAddrInfoFromCBS", String.class);\r
+        EasyMock.expect(MicroServiceConfig.getServiceAddrInfoFromCBS(System.getProperty(HOSTNAME)))\r
+                .andReturn("{\"msb.hostname\": \"127.0.0.3:5432\"}");\r
 \r
         PowerMock.replayAll();\r
         String[] msbInfo = getMsbAddrInfo();\r
         assertThat(msbInfo[0], equalTo("127.0.0.3"));\r
         assertThat(msbInfo[1], equalTo("5432"));\r
 \r
+        System.clearProperty(HOSTNAME);\r
         System.clearProperty(MSB_ADDR);\r
     }\r
 \r
     @Test\r
     public void getMsbAddrInfo_msb_not_registered() throws Exception {\r
         System.setProperty(MSB_ADDR, "10.74.5.8:1545");\r
-        PowerMock.mockStaticPartial(MicroServiceConfig.class, "execQuery", String.class);\r
-        PowerMock.expectPrivate(MicroServiceConfig.class, "execQuery", EasyMock.anyObject())\r
-                .andReturn("[{\"ServiceAddress\": \"127.0.0.2\", \"ServicePort\": \"8080\"}]");\r
-        PowerMock.expectPrivate(MicroServiceConfig.class, "execQuery", EasyMock.anyObject())\r
+        System.setProperty(HOSTNAME, "rule-mgmt");\r
+        PowerMock.mockStaticPartial(MicroServiceConfig.class, "getServiceAddrInfoFromCBS", String.class);\r
+        EasyMock.expect(MicroServiceConfig.getServiceAddrInfoFromCBS(System.getProperty(HOSTNAME)))\r
                 .andReturn("{}");\r
 \r
         PowerMock.replayAll();\r
         assertThat(msbInfo[0], equalTo("10.74.5.8"));\r
         assertThat(msbInfo[1], equalTo("1545"));\r
 \r
+        System.clearProperty(HOSTNAME);\r
         System.clearProperty(MSB_ADDR);\r
     }\r
 \r