切换到jackson #10
8
pom.xml
8
pom.xml
@@ -76,14 +76,6 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Json-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>net.sf.json-lib</groupId>-->
|
|
||||||
<!-- <artifactId>json-lib</artifactId>-->
|
|
||||||
<!-- <version>2.4</version>-->
|
|
||||||
<!-- <classifier>jdk15</classifier>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
|
|
||||||
<!-- 七牛云SDK -->
|
<!-- 七牛云SDK -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.qiniu</groupId>
|
<groupId>com.qiniu</groupId>
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ public class BaseTest {
|
|||||||
protected void mockInjectInstance(Object service, String mailFiledName, Object impl) {
|
protected void mockInjectInstance(Object service, String mailFiledName, Object impl) {
|
||||||
Field field;
|
Field field;
|
||||||
try {
|
try {
|
||||||
|
assertNotNull(service);
|
||||||
field = service.getClass().getDeclaredField(mailFiledName);
|
field = service.getClass().getDeclaredField(mailFiledName);
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
field.set(service, impl);
|
field.set(service, impl);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class UserControllerTest extends BaseTest {
|
|||||||
};
|
};
|
||||||
private static final TypeReference<?> USER_MODEL_LIST_TYPE = new TypeReference<Response<List<Map<String, Object>>>>() {
|
private static final TypeReference<?> USER_MODEL_LIST_TYPE = new TypeReference<Response<List<Map<String, Object>>>>() {
|
||||||
};
|
};
|
||||||
|
@Autowired
|
||||||
UserService userService;
|
UserService userService;
|
||||||
|
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@ public class UserControllerTest extends BaseTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getUserInfo() throws Exception {
|
public void getUserInfo() throws Exception {
|
||||||
getMockData(get("/user/userInfo"), userLogin()).andDo(result -> {
|
getMockData(get("/user/userInfo"), adminLogin()).andDo(result -> {
|
||||||
Response<UserModel> response = getResponse(result, USER_MODEL_TYPE);
|
Response<UserModel> response = getResponse(result, USER_MODEL_TYPE);
|
||||||
assertEquals(SUCCESS.getCode(), response.getCode());
|
assertEquals(SUCCESS.getCode(), response.getCode());
|
||||||
UserModel u = response.getResult();
|
UserModel u = response.getResult();
|
||||||
|
|||||||
Reference in New Issue
Block a user