提交 9fe11a24 编写于 作者: L lepdou

Merge pull request #208 from nobodyiam/namespace-field-rename

rename field namespace to namespaceName since namespace is a reserved…
......@@ -242,7 +242,7 @@ public class ConfigIntegrationTest extends BaseIntegrationTest {
ContextHandler configHandler = mockConfigServerHandler(HttpServletResponse.SC_OK, apolloConfig);
ContextHandler pollHandler =
mockPollNotificationHandler(pollTimeoutInMS, HttpServletResponse.SC_OK,
new ApolloConfigNotification(apolloConfig.getNamespace()), false);
new ApolloConfigNotification(apolloConfig.getNamespaceName()), false);
startServerWithHandlers(configHandler, pollHandler);
......
......@@ -88,7 +88,7 @@ public class ConfigControllerTest {
verify(configService, times(1)).findRelease(someAppId, someClusterName, defaultNamespaceName);
assertEquals(someAppId, result.getAppId());
assertEquals(someClusterName, result.getCluster());
assertEquals(defaultNamespaceName, result.getNamespace());
assertEquals(defaultNamespaceName, result.getNamespaceName());
assertEquals(someServerSideNewReleaseKey, result.getReleaseKey());
}
......@@ -151,7 +151,7 @@ public class ConfigControllerTest {
assertEquals(someServerSideReleaseKey, result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someClusterName, result.getCluster());
assertEquals(someAppOwnNamespaceName, result.getNamespace());
assertEquals(someAppOwnNamespaceName, result.getNamespaceName());
assertEquals("foo", result.getConfigurations().get("apollo.bar"));
}
......@@ -180,7 +180,7 @@ public class ConfigControllerTest {
assertEquals(someServerSideReleaseKey, result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someClusterName, result.getCluster());
assertEquals(somePublicNamespaceName, result.getNamespace());
assertEquals(somePublicNamespaceName, result.getNamespaceName());
assertEquals("foo", result.getConfigurations().get("apollo.public.bar"));
}
......@@ -212,7 +212,7 @@ public class ConfigControllerTest {
assertEquals(someServerSideReleaseKey, result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someClusterName, result.getCluster());
assertEquals(somePublicNamespaceName, result.getNamespace());
assertEquals(somePublicNamespaceName, result.getNamespaceName());
assertEquals("foo", result.getConfigurations().get("apollo.public.bar"));
}
......@@ -249,7 +249,7 @@ public class ConfigControllerTest {
result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someClusterName, result.getCluster());
assertEquals(somePublicNamespaceName, result.getNamespace());
assertEquals(somePublicNamespaceName, result.getNamespaceName());
assertEquals("foo-override", result.getConfigurations().get("apollo.public.foo"));
assertEquals("bar", result.getConfigurations().get("apollo.public.bar"));
}
......
......@@ -122,7 +122,7 @@ public class NotificationControllerTest {
ApolloConfigNotification notification = response.getBody();
assertEquals(HttpStatus.OK, response.getStatusCode());
assertEquals(defaultNamespace, notification.getNamespace());
assertEquals(defaultNamespace, notification.getNamespaceName());
}
@Test
......@@ -149,7 +149,7 @@ public class NotificationControllerTest {
ApolloConfigNotification notification = response.getBody();
assertEquals(HttpStatus.OK, response.getStatusCode());
assertEquals(somePublicNamespace, notification.getNamespace());
assertEquals(somePublicNamespace, notification.getNamespaceName());
}
......
......@@ -103,7 +103,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals("TEST-RELEASE-KEY4", result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someCluster, result.getCluster());
assertEquals(somePublicNamespace, result.getNamespace());
assertEquals(somePublicNamespace, result.getNamespaceName());
assertEquals("someDC-v1", result.getConfigurations().get("k1"));
assertEquals("someDC-v2", result.getConfigurations().get("k2"));
}
......@@ -121,7 +121,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals("TEST-RELEASE-KEY5" + ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR + "TEST-RELEASE-KEY4", result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someDefaultCluster, result.getCluster());
assertEquals(somePublicNamespace, result.getNamespace());
assertEquals(somePublicNamespace, result.getNamespaceName());
assertEquals("override-v1", result.getConfigurations().get("k1"));
assertEquals("someDC-v2", result.getConfigurations().get("k2"));
}
......@@ -140,7 +140,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals("TEST-RELEASE-KEY3", result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someCluster, result.getCluster());
assertEquals(somePublicNamespace, result.getNamespace());
assertEquals(somePublicNamespace, result.getNamespaceName());
assertEquals("default-v1", result.getConfigurations().get("k1"));
assertEquals("default-v2", result.getConfigurations().get("k2"));
}
......@@ -159,7 +159,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals("TEST-RELEASE-KEY5" + ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR + "TEST-RELEASE-KEY3", result.getReleaseKey());
assertEquals(someAppId, result.getAppId());
assertEquals(someDefaultCluster, result.getCluster());
assertEquals(somePublicNamespace, result.getNamespace());
assertEquals(somePublicNamespace, result.getNamespaceName());
assertEquals("override-v1", result.getConfigurations().get("k1"));
assertEquals("default-v2", result.getConfigurations().get("k2"));
......
......@@ -59,7 +59,7 @@ public class NotificationControllerIntegrationTest extends AbstractBaseIntegrati
ApolloConfigNotification notification = result.getBody();
assertEquals(HttpStatus.OK, result.getStatusCode());
assertEquals(defaultNamespace, notification.getNamespace());
assertEquals(defaultNamespace, notification.getNamespaceName());
}
@Test(timeout = 5000L)
......@@ -81,7 +81,7 @@ public class NotificationControllerIntegrationTest extends AbstractBaseIntegrati
ApolloConfigNotification notification = result.getBody();
assertEquals(HttpStatus.OK, result.getStatusCode());
assertEquals(somePublicNamespace, notification.getNamespace());
assertEquals(somePublicNamespace, notification.getNamespaceName());
}
@Test(timeout = 5000L)
......@@ -104,7 +104,7 @@ public class NotificationControllerIntegrationTest extends AbstractBaseIntegrati
ApolloConfigNotification notification = result.getBody();
assertEquals(HttpStatus.OK, result.getStatusCode());
assertEquals(somePublicNamespace, notification.getNamespace());
assertEquals(somePublicNamespace, notification.getNamespaceName());
}
private String assembleKey(String appId, String cluster, String namespace) {
......
......@@ -13,7 +13,7 @@ public class ApolloConfig {
private String cluster;
private String namespace;
private String namespaceName;
private Map<String, String> configurations;
......@@ -24,11 +24,11 @@ public class ApolloConfig {
public ApolloConfig(String appId,
String cluster,
String namespace,
String namespaceName,
String releaseKey) {
this.appId = appId;
this.cluster = cluster;
this.namespace = namespace;
this.namespaceName = namespaceName;
this.releaseKey = releaseKey;
}
......@@ -40,8 +40,8 @@ public class ApolloConfig {
return cluster;
}
public String getNamespace() {
return namespace;
public String getNamespaceName() {
return namespaceName;
}
public String getReleaseKey() {
......@@ -60,8 +60,8 @@ public class ApolloConfig {
this.cluster = cluster;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
public void setNamespaceName(String namespaceName) {
this.namespaceName = namespaceName;
}
public void setReleaseKey(String releaseKey) {
......@@ -78,7 +78,7 @@ public class ApolloConfig {
.omitNullValues()
.add("appId", appId)
.add("cluster", cluster)
.add("namespace", namespace)
.add("namespaceName", namespaceName)
.add("releaseKey", releaseKey)
.add("configurations", configurations)
.toString();
......
......@@ -4,21 +4,21 @@ package com.ctrip.apollo.core.dto;
* @author Jason Song(song_s@ctrip.com)
*/
public class ApolloConfigNotification {
private String namespace;
private String namespaceName;
//for json converter
public ApolloConfigNotification() {
}
public ApolloConfigNotification(String namespace) {
this.namespace = namespace;
public ApolloConfigNotification(String namespaceName) {
this.namespaceName = namespaceName;
}
public String getNamespace() {
return namespace;
public String getNamespaceName() {
return namespaceName;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
public void setNamespaceName(String namespaceName) {
this.namespaceName = namespaceName;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册