Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
superrain51
apollo
提交
aba905f3
apollo
项目概览
superrain51
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aba905f3
编写于
3月 25, 2016
作者:
Y
Yiming Liu
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #45 from lepdou/adminservice_discovery
config service test change default cluster name
上级
04eeea4f
c30b9eb5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
9 deletion
+10
-9
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/ConfigServiceTest.java
...va/com/ctrip/apollo/portal/service/ConfigServiceTest.java
+10
-9
未找到文件。
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/ConfigServiceTest.java
浏览文件 @
aba905f3
...
...
@@ -25,6 +25,7 @@ import org.springframework.test.util.ReflectionTestUtils;
import
org.springframework.web.client.RestTemplate
;
import
com.ctrip.apollo.Apollo.Env
;
import
com.ctrip.apollo.core.Constants
;
import
com.ctrip.apollo.core.dto.ClusterDTO
;
import
com.ctrip.apollo.core.dto.ConfigItemDTO
;
import
com.ctrip.apollo.core.dto.ReleaseSnapshotDTO
;
...
...
@@ -93,7 +94,7 @@ public class ConfigServiceTest {
VersionDTO
someVersion
=
assembleVersion
(
appId
,
"1.0"
,
releaseId
);
ReleaseSnapshotDTO
[]
releaseSnapShots
=
new
ReleaseSnapshotDTO
[
1
];
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
"default-cluster-name"
,
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
Constants
.
DEFAULT_CLUSTER_NAME
,
"{\"6666.foo\":\"demo1\", \"6666.bar\":\"demo2\"}"
);
restInvoke
(
serviceLocator
.
getAdminService
(
Env
.
DEV
)
+
"/configs/release/"
+
releaseId
,
...
...
@@ -118,7 +119,7 @@ public class ConfigServiceTest {
long
releaseId
=
11111
;
VersionDTO
someVersion
=
assembleVersion
(
appId
,
"1.0"
,
releaseId
);
ReleaseSnapshotDTO
[]
releaseSnapShots
=
new
ReleaseSnapshotDTO
[
1
];
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
"default-cluster-name"
,
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
Constants
.
DEFAULT_CLUSTER_NAME
,
"{\"6666.foo\":\"demo1\", \"6666.bar\":\"demo2\", \"5555.bar\":\"demo2\", \"22.bar\":\"demo2\"}"
);
restInvoke
(
serviceLocator
.
getAdminService
(
Env
.
DEV
)
+
"/configs/release/"
+
releaseId
,
...
...
@@ -143,7 +144,7 @@ public class ConfigServiceTest {
long
releaseId
=
11111
;
VersionDTO
someVersion
=
assembleVersion
(
appId
,
"1.0"
,
releaseId
);
ReleaseSnapshotDTO
[]
releaseSnapShots
=
new
ReleaseSnapshotDTO
[
2
];
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
"default-cluster-name"
,
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
Constants
.
DEFAULT_CLUSTER_NAME
,
"{\"6666.foo\":\"demo1\", \"6666.bar\":\"demo2\"}"
);
releaseSnapShots
[
1
]
=
assembleReleaseSnapShot
(
11112
,
"cluster1"
,
"{\"6666.foo\":\"demo1\", \"6666.bar\":\"demo2\"}"
);
...
...
@@ -203,7 +204,7 @@ public class ConfigServiceTest {
private
ReleaseSnapshotDTO
[]
assembleReleaseSnapShots
()
{
ReleaseSnapshotDTO
[]
releaseSnapShots
=
new
ReleaseSnapshotDTO
[
3
];
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
"default-cluster-name"
,
releaseSnapShots
[
0
]
=
assembleReleaseSnapShot
(
11111
,
Constants
.
DEFAULT_CLUSTER_NAME
,
"{\"6666.foo\":\"demo1\", \"6666.bar\":\"demo2\",\"3333.foo\":\"1008\",\"4444.bar\":\"99901\"}"
);
releaseSnapShots
[
1
]
=
assembleReleaseSnapShot
(
11111
,
"cluster1"
,
"{\"6666.foo\":\"demo1\"}"
);
releaseSnapShots
[
2
]
=
assembleReleaseSnapShot
(
11111
,
"cluster2"
,
"{\"6666.bar\":\"bar2222\"}"
);
...
...
@@ -221,7 +222,7 @@ public class ConfigServiceTest {
private
ClusterDTO
[]
assembleClusters
()
{
ClusterDTO
[]
clusters
=
new
ClusterDTO
[
2
];
clusters
[
0
]
=
assembleCluster
(
100
,
6666
,
"default-cluster-name"
);
clusters
[
0
]
=
assembleCluster
(
100
,
6666
,
Constants
.
DEFAULT_CLUSTER_NAME
);
clusters
[
1
]
=
assembleCluster
(
101
,
6666
,
"cluster1"
);
return
clusters
;
}
...
...
@@ -236,10 +237,10 @@ public class ConfigServiceTest {
private
ConfigItemDTO
[]
assembleConfigItems
()
{
ConfigItemDTO
[]
configItems
=
new
ConfigItemDTO
[
5
];
configItems
[
0
]
=
assembleConfigItem
(
100
,
"default-cluster-name"
,
6666
,
"6666.k1"
,
"6666.v1"
);
configItems
[
1
]
=
assembleConfigItem
(
100
,
"default-cluster-name"
,
6666
,
"6666.k2"
,
"6666.v2"
);
configItems
[
2
]
=
assembleConfigItem
(
100
,
"default-cluster-name"
,
6666
,
"6666.k3"
,
"6666.v3"
);
configItems
[
3
]
=
assembleConfigItem
(
100
,
"default-cluster-name"
,
5555
,
"5555.k1"
,
"5555.v1"
);
configItems
[
0
]
=
assembleConfigItem
(
100
,
Constants
.
DEFAULT_CLUSTER_NAME
,
6666
,
"6666.k1"
,
"6666.v1"
);
configItems
[
1
]
=
assembleConfigItem
(
100
,
Constants
.
DEFAULT_CLUSTER_NAME
,
6666
,
"6666.k2"
,
"6666.v2"
);
configItems
[
2
]
=
assembleConfigItem
(
100
,
Constants
.
DEFAULT_CLUSTER_NAME
,
6666
,
"6666.k3"
,
"6666.v3"
);
configItems
[
3
]
=
assembleConfigItem
(
100
,
Constants
.
DEFAULT_CLUSTER_NAME
,
5555
,
"5555.k1"
,
"5555.v1"
);
configItems
[
4
]
=
assembleConfigItem
(
101
,
"cluster1"
,
6666
,
"6666.k1"
,
"6666.v1"
);
return
configItems
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录