Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
f6ef8198
Commit
f6ef8198
authored
Jun 07, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4ee4598c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
6 deletions
+22
-6
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/AppControllerTest.java
...ork/apollo/adminservice/controller/AppControllerTest.java
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalSettings.java
...ava/com/ctrip/framework/apollo/portal/PortalSettings.java
+3
-3
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/API.java
.../main/java/com/ctrip/framework/apollo/portal/api/API.java
+1
-2
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/ConfigServiceTest.java
.../com/ctrip/framework/apollo/portal/ConfigServiceTest.java
+17
-0
No files found.
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/AppControllerTest.java
View file @
f6ef8198
...
@@ -109,7 +109,7 @@ public class AppControllerTest extends AbstractControllerTest {
...
@@ -109,7 +109,7 @@ public class AppControllerTest extends AbstractControllerTest {
App
app
=
BeanUtils
.
transfrom
(
App
.
class
,
dto
);
App
app
=
BeanUtils
.
transfrom
(
App
.
class
,
dto
);
app
=
appRepository
.
save
(
app
);
app
=
appRepository
.
save
(
app
);
restTemplate
.
delete
(
getBaseAppUrl
()
+
dto
.
getAppId
()
);
restTemplate
.
delete
(
"http://localhost:{port}/apps/{appId}?operator={operator}"
,
port
,
app
.
getAppId
(),
"test"
);
App
deletedApp
=
appRepository
.
findOne
(
app
.
getId
());
App
deletedApp
=
appRepository
.
findOne
(
app
.
getId
());
Assert
.
assertNull
(
deletedApp
);
Assert
.
assertNull
(
deletedApp
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalSettings.java
View file @
f6ef8198
...
@@ -73,9 +73,9 @@ public class PortalSettings {
...
@@ -73,9 +73,9 @@ public class PortalSettings {
healthCheckService
=
Executors
.
newScheduledThreadPool
(
1
);
healthCheckService
=
Executors
.
newScheduledThreadPool
(
1
);
//
healthCheckService
healthCheckService
//
.scheduleWithFixedDelay(new HealthCheckTask(applicationContext), 1000, HEALTH_CHECK_INTERVAL,
.
scheduleWithFixedDelay
(
new
HealthCheckTask
(
applicationContext
),
1000
,
HEALTH_CHECK_INTERVAL
,
//
TimeUnit.MILLISECONDS);
TimeUnit
.
MILLISECONDS
);
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/API.java
View file @
f6ef8198
...
@@ -25,7 +25,6 @@ public class API {
...
@@ -25,7 +25,6 @@ public class API {
}
}
public
String
getAdminServiceHost
(
Env
env
)
{
public
String
getAdminServiceHost
(
Env
env
)
{
return
"http://localhost:8090"
;
return
serviceLocator
.
getServiceAddress
(
env
).
getHomepageUrl
();
// return serviceLocator.getServiceAddress(env).getHomepageUrl();
}
}
}
}
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/ConfigServiceTest.java
View file @
f6ef8198
...
@@ -6,6 +6,8 @@ import com.ctrip.framework.apollo.core.dto.ItemDTO;
...
@@ -6,6 +6,8 @@ import com.ctrip.framework.apollo.core.dto.ItemDTO;
import
com.ctrip.framework.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.auth.UserInfoHolder
;
import
com.ctrip.framework.apollo.portal.entity.po.UserInfo
;
import
com.ctrip.framework.apollo.portal.entity.vo.ItemDiffs
;
import
com.ctrip.framework.apollo.portal.entity.vo.ItemDiffs
;
import
com.ctrip.framework.apollo.portal.entity.vo.NamespaceIdentifer
;
import
com.ctrip.framework.apollo.portal.entity.vo.NamespaceIdentifer
;
import
com.ctrip.framework.apollo.portal.entity.form.NamespaceTextModel
;
import
com.ctrip.framework.apollo.portal.entity.form.NamespaceTextModel
;
...
@@ -37,6 +39,8 @@ public class ConfigServiceTest {
...
@@ -37,6 +39,8 @@ public class ConfigServiceTest {
private
AdminServiceAPI
.
ItemAPI
itemAPI
;
private
AdminServiceAPI
.
ItemAPI
itemAPI
;
@Mock
@Mock
private
PropertyResolver
resolver
;
private
PropertyResolver
resolver
;
@Mock
private
UserInfoHolder
userInfoHolder
;
@InjectMocks
@InjectMocks
private
PortalConfigService
configService
;
private
PortalConfigService
configService
;
...
@@ -64,6 +68,11 @@ public class ConfigServiceTest {
...
@@ -64,6 +68,11 @@ public class ConfigServiceTest {
when
(
itemAPI
.
findItems
(
appId
,
Env
.
DEV
,
clusterName
,
namespaceName
)).
thenReturn
(
itemDTOs
);
when
(
itemAPI
.
findItems
(
appId
,
Env
.
DEV
,
clusterName
,
namespaceName
)).
thenReturn
(
itemDTOs
);
when
(
resolver
.
resolve
(
0
,
model
.
getConfigText
(),
itemDTOs
)).
thenReturn
(
changeSets
);
when
(
resolver
.
resolve
(
0
,
model
.
getConfigText
(),
itemDTOs
)).
thenReturn
(
changeSets
);
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setUsername
(
"test"
);
when
(
userInfoHolder
.
getUser
()).
thenReturn
(
userInfo
);
try
{
try
{
configService
.
updateConfigItemByText
(
model
);
configService
.
updateConfigItemByText
(
model
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
@@ -95,6 +104,10 @@ public class ConfigServiceTest {
...
@@ -95,6 +104,10 @@ public class ConfigServiceTest {
when
(
namespaceAPI
.
loadNamespace
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
namespaceDTO
);
when
(
namespaceAPI
.
loadNamespace
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
namespaceDTO
);
when
(
itemAPI
.
findItems
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
null
);
when
(
itemAPI
.
findItems
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
null
);
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setUsername
(
"test"
);
when
(
userInfoHolder
.
getUser
()).
thenReturn
(
userInfo
);
List
<
ItemDiffs
>
itemDiffses
=
configService
.
compare
(
namespaceIdentifers
,
sourceItems
);
List
<
ItemDiffs
>
itemDiffses
=
configService
.
compare
(
namespaceIdentifers
,
sourceItems
);
assertEquals
(
1
,
itemDiffses
.
size
());
assertEquals
(
1
,
itemDiffses
.
size
());
...
@@ -132,6 +145,10 @@ public class ConfigServiceTest {
...
@@ -132,6 +145,10 @@ public class ConfigServiceTest {
when
(
namespaceAPI
.
loadNamespace
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
namespaceDTO
);
when
(
namespaceAPI
.
loadNamespace
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
namespaceDTO
);
when
(
itemAPI
.
findItems
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
targetItems
);
when
(
itemAPI
.
findItems
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
)).
thenReturn
(
targetItems
);
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setUsername
(
"test"
);
when
(
userInfoHolder
.
getUser
()).
thenReturn
(
userInfo
);
List
<
ItemDiffs
>
itemDiffses
=
configService
.
compare
(
namespaceIdentifers
,
sourceItems
);
List
<
ItemDiffs
>
itemDiffses
=
configService
.
compare
(
namespaceIdentifers
,
sourceItems
);
assertEquals
(
1
,
itemDiffses
.
size
());
assertEquals
(
1
,
itemDiffses
.
size
());
...
...
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