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
2243da9f
Commit
2243da9f
authored
Oct 04, 2018
by
nobodyiam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix legacy mock issue
parent
50f0e6eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ControllerIntegrationExceptionTest.java
...ervice/controller/ControllerIntegrationExceptionTest.java
+11
-0
No files found.
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ControllerIntegrationExceptionTest.java
View file @
2243da9f
...
@@ -7,6 +7,7 @@ import com.ctrip.framework.apollo.biz.service.AppService;
...
@@ -7,6 +7,7 @@ import com.ctrip.framework.apollo.biz.service.AppService;
import
com.ctrip.framework.apollo.common.dto.AppDTO
;
import
com.ctrip.framework.apollo.common.dto.AppDTO
;
import
com.ctrip.framework.apollo.common.entity.App
;
import
com.ctrip.framework.apollo.common.entity.App
;
import
org.junit.After
;
import
org.junit.Assert
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -31,6 +32,8 @@ public class ControllerIntegrationExceptionTest extends AbstractControllerTest {
...
@@ -31,6 +32,8 @@ public class ControllerIntegrationExceptionTest extends AbstractControllerTest {
@Mock
@Mock
AdminService
adminService
;
AdminService
adminService
;
private
Object
realAdminService
;
@Autowired
@Autowired
AppService
appService
;
AppService
appService
;
...
@@ -39,9 +42,17 @@ public class ControllerIntegrationExceptionTest extends AbstractControllerTest {
...
@@ -39,9 +42,17 @@ public class ControllerIntegrationExceptionTest extends AbstractControllerTest {
@Before
@Before
public
void
setUp
()
{
public
void
setUp
()
{
MockitoAnnotations
.
initMocks
(
this
);
MockitoAnnotations
.
initMocks
(
this
);
realAdminService
=
ReflectionTestUtils
.
getField
(
appController
,
"adminService"
);
ReflectionTestUtils
.
setField
(
appController
,
"adminService"
,
adminService
);
ReflectionTestUtils
.
setField
(
appController
,
"adminService"
,
adminService
);
}
}
@After
public
void
tearDown
()
throws
Exception
{
ReflectionTestUtils
.
setField
(
appController
,
"adminService"
,
realAdminService
);
}
private
String
getBaseAppUrl
()
{
private
String
getBaseAppUrl
()
{
return
"http://localhost:"
+
port
+
"/apps/"
;
return
"http://localhost:"
+
port
+
"/apps/"
;
}
}
...
...
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