Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
aba905f3
Commit
aba905f3
authored
Mar 25, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #45 from lepdou/adminservice_discovery
config service test change default cluster name
parents
04eeea4f
c30b9eb5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
ConfigServiceTest.java
...va/com/ctrip/apollo/portal/service/ConfigServiceTest.java
+10
-9
No files found.
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/ConfigServiceTest.java
View file @
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment