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
5359d441
Commit
5359d441
authored
Jun 21, 2016
by
Jason Song
Committed by
GitHub
Jun 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #280 from lepdou/0620_27
多处细节优化
parents
b9813f17
f98b344c
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
181 additions
and
155 deletions
+181
-155
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/AppController.java
...rip/framework/apollo/portal/controller/AppController.java
+1
-1
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
...com/ctrip/framework/apollo/portal/service/AppService.java
+2
-6
apollo-portal/src/main/resources/static/app.html
apollo-portal/src/main/resources/static/app.html
+9
-10
apollo-portal/src/main/resources/static/config.html
apollo-portal/src/main/resources/static/config.html
+2
-2
apollo-portal/src/main/resources/static/scripts/controller/CreateAppController.js
...esources/static/scripts/controller/CreateAppController.js
+12
-2
apollo-portal/src/main/resources/static/scripts/controller/app/ConfigNamespaceController.js
...tatic/scripts/controller/app/ConfigNamespaceController.js
+11
-0
apollo-portal/src/main/resources/static/scripts/controller/role/AppRoleController.js
...urces/static/scripts/controller/role/AppRoleController.js
+62
-57
apollo-portal/src/main/resources/static/scripts/controller/role/NamespaceRoleController.js
...static/scripts/controller/role/NamespaceRoleController.js
+81
-75
apollo-portal/src/main/resources/static/styles/common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+0
-1
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/ServiceExceptionTest.java
...m/ctrip/framework/apollo/portal/ServiceExceptionTest.java
+1
-1
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/AppController.java
View file @
5359d441
...
@@ -77,7 +77,7 @@ public class AppController {
...
@@ -77,7 +77,7 @@ public class AppController {
}
}
appService
.
enrichUserInfo
(
app
);
appService
.
enrichUserInfo
(
app
);
App
createdApp
=
appService
.
create
OrUpdateAppInLocal
(
app
);
App
createdApp
=
appService
.
create
(
app
);
publisher
.
publishEvent
(
new
AppCreationEvent
(
createdApp
));
publisher
.
publishEvent
(
new
AppCreationEvent
(
createdApp
));
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
View file @
5359d441
...
@@ -22,7 +22,6 @@ import com.ctrip.framework.apollo.core.exception.BadRequestException;
...
@@ -22,7 +22,6 @@ import com.ctrip.framework.apollo.core.exception.BadRequestException;
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.auth.UserInfoHolder
;
import
com.ctrip.framework.apollo.portal.entity.vo.EnvClusterInfo
;
import
com.ctrip.framework.apollo.portal.entity.vo.EnvClusterInfo
;
import
com.ctrip.framework.apollo.portal.listener.AppCreationEvent
;
import
com.ctrip.framework.apollo.portal.repository.AppRepository
;
import
com.ctrip.framework.apollo.portal.repository.AppRepository
;
@Service
@Service
...
@@ -45,8 +44,6 @@ public class AppService {
...
@@ -45,8 +44,6 @@ public class AppService {
@Autowired
@Autowired
private
AppRepository
appRepository
;
private
AppRepository
appRepository
;
@Autowired
private
ApplicationEventPublisher
publisher
;
public
List
<
App
>
findAll
()
{
public
List
<
App
>
findAll
()
{
Iterable
<
App
>
apps
=
appRepository
.
findAll
();
Iterable
<
App
>
apps
=
appRepository
.
findAll
();
...
@@ -87,13 +84,12 @@ public class AppService {
...
@@ -87,13 +84,12 @@ public class AppService {
@Transactional
@Transactional
public
App
create
OrUpdateAppInLocal
(
App
app
)
{
public
App
create
(
App
app
)
{
String
appId
=
app
.
getAppId
();
String
appId
=
app
.
getAppId
();
App
managedApp
=
appRepository
.
findByAppId
(
appId
);
App
managedApp
=
appRepository
.
findByAppId
(
appId
);
if
(
managedApp
!=
null
)
{
if
(
managedApp
!=
null
)
{
BeanUtils
.
copyEntityProperties
(
app
,
managedApp
);
throw
new
BadRequestException
(
String
.
format
(
"app id %s already exists!"
,
app
.
getAppId
()));
return
appRepository
.
save
(
managedApp
);
}
else
{
}
else
{
App
createdApp
=
appRepository
.
save
(
app
);
App
createdApp
=
appRepository
.
save
(
app
);
namespaceService
.
createDefaultAppNamespace
(
appId
);
namespaceService
.
createDefaultAppNamespace
(
appId
);
...
...
apollo-portal/src/main/resources/static/app.html
View file @
5359d441
...
@@ -35,32 +35,31 @@
...
@@ -35,32 +35,31 @@
<label
class=
"col-sm-2 control-label"
><apollorequiredfiled></apollorequiredfiled>
应用AppId
</label>
<label
class=
"col-sm-2 control-label"
><apollorequiredfiled></apollorequiredfiled>
应用AppId
</label>
<div
class=
"col-sm-3"
>
<div
class=
"col-sm-3"
>
<input
type=
"text"
class=
"form-control"
name=
"appAppId"
ng-model=
"app.appId"
<input
type=
"text"
class=
"form-control"
name=
"appAppId"
ng-model=
"app.appId"
required
>
required
>
<small>
(CMS上申请的App Id)
</small>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><apollorequiredfiled></apollorequiredfiled>
应用名称
</label>
<label
class=
"col-sm-2 control-label"
><apollorequiredfiled></apollorequiredfiled>
应用名称
</label>
<div
class=
"col-sm-5"
>
<div
class=
"col-sm-5"
>
<input
type=
"text"
class=
"form-control"
name=
"appName"
ng-model=
"app.name"
required
>
<input
type=
"text"
class=
"form-control"
name=
"appName"
ng-model=
"app.name"
required
>
<small>
(建议格式 xx-yy-zz 例:apollo-server)
</small>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><apollorequiredfiled></apollorequiredfiled>
应用负责人
</label>
<label
class=
"col-sm-2 control-label"
><apollorequiredfiled></apollorequiredfiled>
应用负责人
</label>
<div
class=
"col-sm-3"
>
<div
class=
"col-sm-6"
>
<div
class=
"input-group"
>
<input
type=
"text"
class=
"form-control"
name=
"appOwner"
ng-model=
"app.ownerName"
required
>
<input
type=
"text"
class=
"form-control"
name=
"appOwner"
ng-model=
"app.ownerName"
required
>
<div
class=
"input-group-addon"
ng-bind=
"emailPostfix"
></div>
</div>
</div>
</div>
<small>
(负责人具有项目管理的最高权限,比如分配配置的修改权,发布权等)
</small>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><apollorequiredfiled></apollorequiredfiled>
邮箱地址
</label>
<div
class=
"col-sm-4"
>
<input
type=
"email"
class=
"form-control"
ng-model=
"app.ownerEmail"
required
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<button
type=
"submit"
class=
"btn btn-
default"
>
创建
</button>
<button
type=
"submit"
class=
"btn btn-
primary"
>
提交
</button>
</div>
</div>
</div>
</div>
</form>
</form>
...
...
apollo-portal/src/main/resources/static/config.html
View file @
5359d441
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
><img
src=
"img/user_manage.png"
class=
"i-20"
></div>
<div
class=
"col-md-2"
><img
src=
"img/user_manage.png"
class=
"i-20"
></div>
<div
class=
"col-md-10 hidden-xs"
>
<div
class=
"col-md-10 hidden-xs"
>
<p
class=
"btn-title"
>
项目
管理员
</p>
<p
class=
"btn-title"
>
项目
负责人
</p>
</div>
</div>
</div>
</div>
</a>
</a>
...
@@ -365,7 +365,7 @@
...
@@ -365,7 +365,7 @@
apollo-detail=
"'确定要删除配置吗?'"
apollo-confirm=
"deleteItem"
></apolloconfirmdialog>
apollo-detail=
"'确定要删除配置吗?'"
apollo-confirm=
"deleteItem"
></apolloconfirmdialog>
<apolloconfirmdialog
apollo-dialog-id=
"'releaseNoPermissionDialog'"
apollo-title=
"'发布'"
<apolloconfirmdialog
apollo-dialog-id=
"'releaseNoPermissionDialog'"
apollo-title=
"'发布'"
apollo-detail=
"'您没有发布权限哦~'"
apollo-detail=
"'您没有发布权限哦~
请找 ' + masterUsers + ' 分配权限
'"
apollo-show-cancel-btn=
"false"
></apolloconfirmdialog>
apollo-show-cancel-btn=
"false"
></apolloconfirmdialog>
<!--create release modal-->
<!--create release modal-->
...
...
apollo-portal/src/main/resources/static/scripts/controller/CreateAppController.js
View file @
5359d441
create_app_module
.
controller
(
'
CreateAppController
'
,
[
'
$scope
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
'
OrganizationService
'
,
create_app_module
.
controller
(
'
CreateAppController
'
,
[
'
$scope
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
UserService
'
,
'
AppUtil
'
,
'
OrganizationService
'
,
function
(
$scope
,
$window
,
toastr
,
AppService
,
AppUtil
,
OrganizationService
)
{
function
(
$scope
,
$window
,
toastr
,
AppService
,
UserService
,
AppUtil
,
OrganizationService
)
{
OrganizationService
.
find_organizations
().
then
(
function
(
result
)
{
OrganizationService
.
find_organizations
().
then
(
function
(
result
)
{
var
organizations
=
[];
var
organizations
=
[];
...
@@ -19,6 +19,15 @@ create_app_module.controller('CreateAppController', ['$scope', '$window', 'toast
...
@@ -19,6 +19,15 @@ create_app_module.controller('CreateAppController', ['$scope', '$window', 'toast
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
load organizations error
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
load organizations error
"
);
});
});
$scope
.
app
=
{};
UserService
.
load_user
().
then
(
function
(
result
)
{
$scope
.
app
.
ownerName
=
result
.
userId
;
},
function
(
result
)
{
});
$scope
.
emailPostfix
=
"
@ctrip.com
"
;
$scope
.
create
=
function
()
{
$scope
.
create
=
function
()
{
var
selectedOrg
=
$
(
'
#organization
'
).
select2
(
'
data
'
)[
0
];
var
selectedOrg
=
$
(
'
#organization
'
).
select2
(
'
data
'
)[
0
];
...
@@ -29,6 +38,7 @@ create_app_module.controller('CreateAppController', ['$scope', '$window', 'toast
...
@@ -29,6 +38,7 @@ create_app_module.controller('CreateAppController', ['$scope', '$window', 'toast
$scope
.
app
.
orgId
=
selectedOrg
.
id
;
$scope
.
app
.
orgId
=
selectedOrg
.
id
;
$scope
.
app
.
orgName
=
selectedOrg
.
name
;
$scope
.
app
.
orgName
=
selectedOrg
.
name
;
$scope
.
app
.
ownerEmail
=
$scope
.
app
.
ownerName
+
$scope
.
emailPostfix
;
AppService
.
create
(
$scope
.
app
).
then
(
function
(
result
)
{
AppService
.
create
(
$scope
.
app
).
then
(
function
(
result
)
{
toastr
.
success
(
'
添加成功!
'
);
toastr
.
success
(
'
添加成功!
'
);
...
...
apollo-portal/src/main/resources/static/scripts/controller/app/ConfigNamespaceController.js
View file @
5359d441
...
@@ -66,6 +66,17 @@ application_module.controller("ConfigNamespaceController",
...
@@ -66,6 +66,17 @@ application_module.controller("ConfigNamespaceController",
});
});
};
};
PermissionService
.
get_app_role_users
(
$rootScope
.
pageContext
.
appId
)
.
then
(
function
(
result
)
{
var
masterUsers
=
''
;
result
.
masterUsers
.
forEach
(
function
(
user
)
{
masterUsers
+=
user
.
userId
+
'
,
'
;
});
$scope
.
masterUsers
=
masterUsers
.
substring
(
0
,
masterUsers
.
length
-
1
);
},
function
(
result
)
{
});
$scope
.
switchView
=
function
(
namespace
,
viewType
)
{
$scope
.
switchView
=
function
(
namespace
,
viewType
)
{
if
(
namespace_view_type
.
TEXT
==
viewType
)
{
if
(
namespace_view_type
.
TEXT
==
viewType
)
{
namespace
.
text
=
parseModel2Text
(
namespace
);
namespace
.
text
=
parseModel2Text
(
namespace
);
...
...
apollo-portal/src/main/resources/static/scripts/controller/role/AppRoleController.js
View file @
5359d441
role_module
.
controller
(
'
AppRoleController
'
,
[
'
$scope
'
,
'
$location
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
'
PermissionService
'
,
role_module
.
controller
(
'
AppRoleController
'
,
[
'
$scope
'
,
'
$location
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
'
PermissionService
'
,
function
(
$scope
,
$location
,
$window
,
toastr
,
AppService
,
AppUtil
,
PermissionService
)
{
function
(
$scope
,
$location
,
$window
,
toastr
,
AppService
,
AppUtil
,
PermissionService
)
{
var
params
=
AppUtil
.
parseParams
(
$location
.
$$url
);
var
params
=
AppUtil
.
parseParams
(
$location
.
$$url
);
...
@@ -13,7 +14,6 @@ role_module.controller('AppRoleController', ['$scope', '$location', '$window', '
...
@@ -13,7 +14,6 @@ role_module.controller('AppRoleController', ['$scope', '$location', '$window', '
});
});
PermissionService
.
get_app_role_users
(
$scope
.
pageContext
.
appId
)
PermissionService
.
get_app_role_users
(
$scope
.
pageContext
.
appId
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
$scope
.
appRoleUsers
=
result
;
$scope
.
appRoleUsers
=
result
;
...
@@ -28,30 +28,35 @@ role_module.controller('AppRoleController', ['$scope', '$location', '$window', '
...
@@ -28,30 +28,35 @@ role_module.controller('AppRoleController', ['$scope', '$location', '$window', '
$scope
.
toAssignMasterRoleUser
)
$scope
.
toAssignMasterRoleUser
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
toastr
.
success
(
"
添加成功
"
);
toastr
.
success
(
"
添加成功
"
);
reloadPage
(
);
$scope
.
appRoleUsers
.
masterUsers
.
push
({
userId
:
$scope
.
toAssignMasterRoleUser
}
);
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加失败
"
);
});
});
};
};
$scope
.
removeMasterRoleFromUser
=
function
(
user
)
{
$scope
.
removeMasterRoleFromUser
=
function
(
user
)
{
if
(
$scope
.
appRoleUsers
.
masterUsers
.
length
<=
1
)
{
if
(
$scope
.
appRoleUsers
.
masterUsers
.
length
<=
1
)
{
$
(
'
#warning
'
).
modal
(
'
show
'
);
$
(
'
#warning
'
).
modal
(
'
show
'
);
return
;
return
;
}
}
PermissionService
.
remove_master_role
(
$scope
.
pageContext
.
appId
,
user
)
PermissionService
.
remove_master_role
(
$scope
.
pageContext
.
appId
,
user
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
toastr
.
success
(
"
删除成功
"
);
toastr
.
success
(
"
删除成功
"
);
reloadPage
(
);
removeUserFromList
(
$scope
.
appRoleUsers
.
masterUsers
,
user
);
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
删除失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
删除失败
"
);
});
});
};
};
function
reloadPage
()
{
function
removeUserFromList
(
list
,
user
)
{
setInterval
(
function
()
{
var
index
=
0
;
location
.
reload
(
true
);
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
},
1000
);
if
(
list
[
i
].
userId
==
user
)
{
index
=
i
;
break
;
}
}
}
list
.
splice
(
index
,
1
);
}
}]);
}]);
apollo-portal/src/main/resources/static/scripts/controller/role/NamespaceRoleController.js
View file @
5359d441
role_module
.
controller
(
'
NamespaceRoleController
'
,
[
'
$scope
'
,
'
$location
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
'
PermissionService
'
,
role_module
.
controller
(
'
NamespaceRoleController
'
,
[
'
$scope
'
,
'
$location
'
,
'
$window
'
,
'
toastr
'
,
'
AppService
'
,
'
AppUtil
'
,
'
PermissionService
'
,
function
(
$scope
,
$location
,
$window
,
toastr
,
AppService
,
AppUtil
,
PermissionService
)
{
function
(
$scope
,
$location
,
$window
,
toastr
,
AppService
,
AppUtil
,
PermissionService
)
{
var
params
=
AppUtil
.
parseParams
(
$location
.
$$url
);
var
params
=
AppUtil
.
parseParams
(
$location
.
$$url
);
...
@@ -32,7 +33,7 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
...
@@ -32,7 +33,7 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
$scope
.
toAssignReleaseNamespaceRoleUser
)
$scope
.
toAssignReleaseNamespaceRoleUser
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
toastr
.
success
(
"
添加成功
"
);
toastr
.
success
(
"
添加成功
"
);
reloadPage
(
);
$scope
.
rolesAssignedUsers
.
releaseRoleUsers
.
push
({
userId
:
$scope
.
toAssignReleaseNamespaceRoleUser
}
);
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加失败
"
);
});
});
...
@@ -42,7 +43,7 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
...
@@ -42,7 +43,7 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
$scope
.
toAssignModifyNamespaceRoleUser
)
$scope
.
toAssignModifyNamespaceRoleUser
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
toastr
.
success
(
"
添加成功
"
);
toastr
.
success
(
"
添加成功
"
);
reloadPage
(
);
$scope
.
rolesAssignedUsers
.
modifyRoleUsers
.
push
({
userId
:
$scope
.
toAssignModifyNamespaceRoleUser
}
);
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加失败
"
);
});
});
...
@@ -56,7 +57,7 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
...
@@ -56,7 +57,7 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
user
)
user
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
toastr
.
success
(
"
删除成功
"
);
toastr
.
success
(
"
删除成功
"
);
reloadPage
(
);
removeUserFromList
(
$scope
.
rolesAssignedUsers
.
releaseRoleUsers
,
user
);
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
删除失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
删除失败
"
);
});
});
...
@@ -66,17 +67,22 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
...
@@ -66,17 +67,22 @@ role_module.controller('NamespaceRoleController', ['$scope', '$location', '$wind
user
)
user
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
toastr
.
success
(
"
删除成功
"
);
toastr
.
success
(
"
删除成功
"
);
reloadPage
(
);
removeUserFromList
(
$scope
.
rolesAssignedUsers
.
modifyRoleUsers
,
user
);
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
删除失败
"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
删除失败
"
);
});
});
}
}
};
};
function
reloadPage
()
{
function
removeUserFromList
(
list
,
user
)
{
setInterval
(
function
()
{
var
index
=
0
;
location
.
reload
(
true
);
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
},
1000
);
if
(
list
[
i
].
userId
==
user
)
{
index
=
i
;
break
;
}
}
}
list
.
splice
(
index
,
1
);
}
}]);
}]);
apollo-portal/src/main/resources/static/styles/common-style.css
View file @
5359d441
...
@@ -127,7 +127,6 @@ table th {
...
@@ -127,7 +127,6 @@ table th {
.apps
.apps-description
{
.apps
.apps-description
{
color
:
gray
;
color
:
gray
;
font-family
:
"Apple Color Emoji"
;
font-size
:
16px
;
font-size
:
16px
;
}
}
...
...
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/ServiceExceptionTest.java
View file @
5359d441
...
@@ -61,7 +61,7 @@ public class ServiceExceptionTest extends AbstractPortalTest {
...
@@ -61,7 +61,7 @@ public class ServiceExceptionTest extends AbstractPortalTest {
new
HttpServerErrorException
(
HttpStatus
.
INTERNAL_SERVER_ERROR
,
"admin server error"
,
new
HttpServerErrorException
(
HttpStatus
.
INTERNAL_SERVER_ERROR
,
"admin server error"
,
new
Gson
().
toJson
(
errorAttributes
).
getBytes
(),
Charset
.
defaultCharset
());
new
Gson
().
toJson
(
errorAttributes
).
getBytes
(),
Charset
.
defaultCharset
());
when
(
appService
.
create
OrUpdateAppInLocal
(
any
(
App
.
class
))).
thenThrow
(
adminException
);
when
(
appService
.
create
(
any
(
App
.
class
))).
thenThrow
(
adminException
);
App
app
=
generateSampleApp
();
App
app
=
generateSampleApp
();
try
{
try
{
...
...
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