|
@@ -59,7 +59,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryConfigWithDefaultClusterAndDefaultNamespaceOK() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, ConfigConsts.CLUSTER_NAME_DEFAULT, ConfigConsts.NAMESPACE_APPLICATION);
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -73,7 +73,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryConfigWithDefaultClusterAndDefaultNamespaceAndIncorrectCase() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, ConfigConsts.CLUSTER_NAME_DEFAULT,
|
|
|
ConfigConsts.NAMESPACE_APPLICATION.toUpperCase());
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -97,7 +97,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
stop.set(true);
|
|
|
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, ConfigConsts.CLUSTER_NAME_DEFAULT, ConfigConsts.NAMESPACE_APPLICATION, someClientIp);
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -120,7 +120,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
stop.set(true);
|
|
|
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, ConfigConsts.CLUSTER_NAME_DEFAULT,
|
|
|
ConfigConsts.NAMESPACE_APPLICATION.toUpperCase(), someClientIp);
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -135,7 +135,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryConfigFileWithDefaultClusterAndDefaultNamespaceOK() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, ConfigConsts.CLUSTER_NAME_DEFAULT, ConfigConsts.NAMESPACE_APPLICATION + ".properties");
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -149,7 +149,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryConfigWithNamespaceOK() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someCluster, someNamespace);
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -163,7 +163,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryConfigFileWithNamespaceOK() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, ConfigConsts.CLUSTER_NAME_DEFAULT, someNamespace + ".xml");
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -180,7 +180,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
HttpStatusCodeException httpException = null;
|
|
|
try {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someCluster, someNamespaceNotExists);
|
|
|
} catch (HttpStatusCodeException ex) {
|
|
|
httpException = ex;
|
|
@@ -195,7 +195,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
public void testQueryConfigNotModified() throws Exception {
|
|
|
String releaseKey = "TEST-RELEASE-KEY2";
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?releaseKey={releaseKey}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?releaseKey={releaseKey}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someCluster, someNamespace, releaseKey);
|
|
|
|
|
@@ -216,7 +216,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
stop.set(true);
|
|
|
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someCluster, somePublicNamespace, someClientIp);
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -231,7 +231,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryPublicConfigWithDataCenterFoundAndNoOverride() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someCluster, somePublicNamespace, someDC);
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -250,7 +250,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryPublicConfigWithDataCenterFoundAndOverride() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someDefaultCluster, somePublicNamespace, someDC);
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -271,7 +271,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryPublicConfigWithIncorrectCaseAndDataCenterFoundAndOverride() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someDefaultCluster, somePublicNamespace.toUpperCase(), someDC);
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -289,7 +289,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
public void testQueryPublicConfigWithDataCenterNotFoundAndNoOverride() throws Exception {
|
|
|
String someDCNotFound = "someDCNotFound";
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someCluster, somePublicNamespace, someDCNotFound);
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -309,7 +309,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
public void testQueryPublicConfigWithDataCenterNotFoundAndOverride() throws Exception {
|
|
|
String someDCNotFound = "someDCNotFound";
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someDefaultCluster, somePublicNamespace, someDCNotFound);
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -339,7 +339,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
stop.set(true);
|
|
|
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someDefaultCluster, somePublicNamespace, someClientIp);
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -366,7 +366,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
stop.set(true);
|
|
|
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?ip={clientIp}", ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, someDefaultCluster, somePublicNamespace.toUpperCase(), someClientIp);
|
|
|
ApolloConfig result = response.getBody();
|
|
|
|
|
@@ -384,7 +384,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
public void testQueryPrivateConfigFileWithPublicNamespaceExists() throws Exception {
|
|
|
String namespaceName = "anotherNamespace";
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), someAppId, ConfigConsts.CLUSTER_NAME_DEFAULT, namespaceName);
|
|
|
ApolloConfig result = response.getBody();
|
|
@@ -403,7 +403,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
HttpStatusCodeException httpException = null;
|
|
|
try {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}", ApolloConfig.class,
|
|
|
getHostUrl(), ConfigConsts.NO_APPID_PLACEHOLDER, someCluster, ConfigConsts.NAMESPACE_APPLICATION);
|
|
|
} catch (HttpStatusCodeException ex) {
|
|
|
httpException = ex;
|
|
@@ -417,7 +417,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
|
|
|
@Sql(scripts = "/integration-test/cleanup.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
|
|
|
public void testQueryPublicConfigForNoAppIdPlaceHolder() throws Exception {
|
|
|
ResponseEntity<ApolloConfig> response = restTemplate
|
|
|
- .getForEntity("{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
+ .getForEntity("http://{baseurl}/configs/{appId}/{clusterName}/{namespace}?dataCenter={dateCenter}",
|
|
|
ApolloConfig.class,
|
|
|
getHostUrl(), ConfigConsts.NO_APPID_PLACEHOLDER, someCluster, somePublicNamespace, someDC);
|
|
|
ApolloConfig result = response.getBody();
|