|
|
|
|
@@ -1,6 +1,7 @@
|
|
|
|
|
package cn.celess.blog.controller;
|
|
|
|
|
|
|
|
|
|
import cn.celess.blog.BaseTest;
|
|
|
|
|
import cn.celess.blog.entity.Response;
|
|
|
|
|
import cn.celess.blog.entity.User;
|
|
|
|
|
import cn.celess.blog.entity.model.PageData;
|
|
|
|
|
import cn.celess.blog.entity.model.UserModel;
|
|
|
|
|
@@ -8,12 +9,13 @@ import cn.celess.blog.entity.request.LoginReq;
|
|
|
|
|
import cn.celess.blog.entity.request.UserReq;
|
|
|
|
|
import cn.celess.blog.mapper.UserMapper;
|
|
|
|
|
import cn.celess.blog.util.MD5Util;
|
|
|
|
|
import net.sf.json.JSONArray;
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
import cn.celess.blog.util.RedisUtil;
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
|
|
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
|
|
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
|
|
import org.springframework.util.MultiValueMap;
|
|
|
|
|
|
|
|
|
|
@@ -21,16 +23,25 @@ import java.io.InputStream;
|
|
|
|
|
import java.net.HttpURLConnection;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static cn.celess.blog.enmu.ResponseEnum.*;
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
|
|
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
|
|
|
|
import static cn.celess.blog.enmu.ResponseEnum.*;
|
|
|
|
|
|
|
|
|
|
public class UserControllerTest extends BaseTest {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
UserMapper userMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
private static final TypeReference<?> USER_MODEL_TYPE = new TypeReference<Response<UserModel>>() {
|
|
|
|
|
};
|
|
|
|
|
private static final TypeReference<?> USER_MODEL_PAGE_TYPE = new TypeReference<Response<PageData<UserModel>>>() {
|
|
|
|
|
};
|
|
|
|
|
private static final TypeReference<?> USER_MODEL_LIST_TYPE = new TypeReference<Response<List<Map<String, Object>>>>() {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void login() throws Exception {
|
|
|
|
|
@@ -41,11 +52,7 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
req.setEmail("zh@celess.cn");
|
|
|
|
|
req.setPassword("123456789");
|
|
|
|
|
req.setIsRememberMe(false);
|
|
|
|
|
JSONObject loginReq = JSONObject.fromObject(req);
|
|
|
|
|
mockMvc.perform(post("/login").content(loginReq.toString()).contentType("application/json"))
|
|
|
|
|
.andDo(result ->
|
|
|
|
|
assertEquals(USER_NOT_EXIST.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code))
|
|
|
|
|
);
|
|
|
|
|
getMockData(post("/login"), null, req).andDo(result -> assertEquals(USER_NOT_EXIST.getCode(), getResponse(result, STRING_TYPE).getCode()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
@@ -55,19 +62,18 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void logout() throws Exception {
|
|
|
|
|
mockMvc.perform(get("/logout")).andDo(result -> assertEquals(SUCCESS.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(get("/logout").header("Authorization", userLogin())).andDo(result -> assertEquals(SUCCESS.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
getMockData(get("/logout")).andDo(result -> assertEquals(SUCCESS.getCode(), getResponse(result, STRING_TYPE).getCode()));
|
|
|
|
|
getMockData(get("/logout"), adminLogin()).andDo(result -> assertEquals(SUCCESS.getCode(), getResponse(result).getCode()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void updateInfo() throws Exception {
|
|
|
|
|
String desc = UUID.randomUUID().toString().substring(0, 4);
|
|
|
|
|
String disPlayName = UUID.randomUUID().toString().substring(0, 4);
|
|
|
|
|
mockMvc.perform(put("/user/userInfo/update?desc=" + desc + "&displayName=" + disPlayName).header("Authorization", userLogin()))
|
|
|
|
|
.andDo(result -> {
|
|
|
|
|
JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString());
|
|
|
|
|
assertEquals(SUCCESS.getCode(), object.getInt(Code));
|
|
|
|
|
UserModel u = (UserModel) JSONObject.toBean(object.getJSONObject(Result), UserModel.class);
|
|
|
|
|
getMockData(put("/user/userInfo/update?desc=" + desc + "&displayName=" + disPlayName), userLogin()).andDo(result -> {
|
|
|
|
|
Response<UserModel> response = getResponse(result, USER_MODEL_TYPE);
|
|
|
|
|
assertEquals(SUCCESS.getCode(), response.getCode());
|
|
|
|
|
UserModel u = response.getResult();
|
|
|
|
|
assertEquals(desc, u.getDesc());
|
|
|
|
|
assertEquals(disPlayName, u.getDisplayName());
|
|
|
|
|
assertNotNull(u.getId());
|
|
|
|
|
@@ -76,11 +82,10 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void getUserInfo() throws Exception {
|
|
|
|
|
mockMvc.perform(get("/user/userInfo").header("Authorization", userLogin()))
|
|
|
|
|
.andDo(result -> {
|
|
|
|
|
JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString());
|
|
|
|
|
assertEquals(SUCCESS.getCode(), object.getInt(Code));
|
|
|
|
|
UserModel u = (UserModel) JSONObject.toBean(object.getJSONObject(Result), UserModel.class);
|
|
|
|
|
getMockData(get("/user/userInfo"), userLogin()).andDo(result -> {
|
|
|
|
|
Response<UserModel> response = getResponse(result, USER_MODEL_TYPE);
|
|
|
|
|
assertEquals(SUCCESS.getCode(), response.getCode());
|
|
|
|
|
UserModel u = response.getResult();
|
|
|
|
|
assertNotNull(u.getId());
|
|
|
|
|
assertNotNull(u.getEmail());
|
|
|
|
|
assertNotNull(u.getDisplayName());
|
|
|
|
|
@@ -100,11 +105,10 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
InputStream inputStream = connection.getInputStream();
|
|
|
|
|
assertNotNull(inputStream);
|
|
|
|
|
MockMultipartFile file = new MockMultipartFile("file", "logo.png", MediaType.IMAGE_PNG_VALUE, inputStream);
|
|
|
|
|
mockMvc.perform(multipart("/user/imgUpload").file(file)).andDo(result -> assertEquals(HAVE_NOT_LOG_IN.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(multipart("/user/imgUpload").file(file).header("Authorization", userLogin())).andDo(result -> {
|
|
|
|
|
JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString());
|
|
|
|
|
assertEquals(SUCCESS.getCode(), object.getInt(Code));
|
|
|
|
|
assertNotNull(object.getString(Result));
|
|
|
|
|
getMockData(multipart("/user/imgUpload").file(file), userLogin()).andDo(result -> {
|
|
|
|
|
Response<Object> response = getResponse(result, OBJECT_TYPE);
|
|
|
|
|
assertEquals(SUCCESS.getCode(), response.getCode());
|
|
|
|
|
assertNotNull(response.getResult());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -119,13 +123,34 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void emailVerify() {
|
|
|
|
|
// ignore
|
|
|
|
|
public void emailVerify() throws Exception {
|
|
|
|
|
String email = randomStr(4) + "@celess.cn";
|
|
|
|
|
String pwd = MD5Util.getMD5("123456789");
|
|
|
|
|
userMapper.addUser(new User(email, pwd));
|
|
|
|
|
String verifyId = randomStr();
|
|
|
|
|
LoginReq req = new LoginReq(email, "123456789", true);
|
|
|
|
|
redisUtil.setEx(email + "-verify", verifyId, 2, TimeUnit.DAYS);
|
|
|
|
|
getMockData(post("/emailVerify").param("verifyId", verifyId).param("email", email), login(req)).andDo(result ->
|
|
|
|
|
assertEquals(SUCCESS.getCode(), getResponse(result, OBJECT_TYPE).getCode())
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void resetPwd() {
|
|
|
|
|
// ignore
|
|
|
|
|
public void resetPwd() throws Exception {
|
|
|
|
|
String email = randomStr(4) + "@celess.cn";
|
|
|
|
|
String pwd = MD5Util.getMD5("1234567890");
|
|
|
|
|
userMapper.addUser(new User(email, pwd));
|
|
|
|
|
LoginReq req = new LoginReq(email, "1234567890", true);
|
|
|
|
|
String verifyId = randomStr();
|
|
|
|
|
// 设置验证id
|
|
|
|
|
redisUtil.setEx(email + "-resetPwd", verifyId, 2, TimeUnit.DAYS);
|
|
|
|
|
MockHttpServletRequestBuilder resetPwd = post("/resetPwd").param("verifyId", verifyId).param("email", email).param("pwd", "123456789");
|
|
|
|
|
// 未验证
|
|
|
|
|
getMockData(resetPwd, login(req)).andDo(result -> assertEquals(USEREMAIL_NOT_VERIFY.getCode(), getResponse(result, OBJECT_TYPE).getCode()));
|
|
|
|
|
// 设置未验证
|
|
|
|
|
userMapper.updateEmailStatus(email, true);
|
|
|
|
|
// 正常
|
|
|
|
|
getMockData(resetPwd, login(req)).andDo(result -> assertEquals(SUCCESS.getCode(), getResponse(result, OBJECT_TYPE).getCode()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
@@ -146,25 +171,16 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
userMapper.setUserRole(userMapper.findByEmail(email).getId(), "admin");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
|
userList.forEach(user -> idList.add(user.getId()));
|
|
|
|
|
System.out.println("id :: == > " + idList.toString());
|
|
|
|
|
mockMvc.perform(delete("/admin/user/delete").content(idList.toString()).contentType("application/json"))
|
|
|
|
|
.andDo(result -> assertEquals(HAVE_NOT_LOG_IN.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(delete("/admin/user/delete").content(idList.toString()).contentType("application/json").header("Authorization", userLogin()))
|
|
|
|
|
.andDo(result -> assertEquals(PERMISSION_ERROR.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(delete("/admin/user/delete").content(idList.toString()).contentType("application/json").header("Authorization", adminLogin()))
|
|
|
|
|
.andDo(result -> {
|
|
|
|
|
JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString());
|
|
|
|
|
assertEquals(SUCCESS.getCode(), object.getInt(Code));
|
|
|
|
|
JSONArray jsonArray = object.getJSONArray(Result);
|
|
|
|
|
jsonArray.forEach(o -> {
|
|
|
|
|
JSONObject json = JSONObject.fromObject(o);
|
|
|
|
|
List<Integer> idList = userList.stream().map(user -> user.getId().intValue()).collect(Collectors.toList());
|
|
|
|
|
getMockData(delete("/admin/user/delete"), adminLogin(), idList).andDo(result -> {
|
|
|
|
|
Response<List<Map<String, Object>>> response = getResponse(result, USER_MODEL_LIST_TYPE);
|
|
|
|
|
assertEquals(SUCCESS.getCode(), response.getCode());
|
|
|
|
|
response.getResult().forEach(o -> {
|
|
|
|
|
// 判断响应数据中是否包含输入的id
|
|
|
|
|
assertTrue(idList.contains((long) json.getInt("id")));
|
|
|
|
|
assertTrue(idList.contains((int) o.get("id")));
|
|
|
|
|
// 判断处理状态
|
|
|
|
|
boolean status = json.getBoolean("status");
|
|
|
|
|
if (json.containsKey("msg"))
|
|
|
|
|
boolean status = (boolean) o.get("status");
|
|
|
|
|
if (o.containsKey("msg"))
|
|
|
|
|
assertFalse(status);
|
|
|
|
|
else
|
|
|
|
|
assertTrue(status);
|
|
|
|
|
@@ -176,26 +192,21 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void updateInfoByAdmin() throws Exception {
|
|
|
|
|
UserReq userReq = new UserReq();
|
|
|
|
|
String email = UUID.randomUUID().toString().substring(0, 4) + "@celess.cn";
|
|
|
|
|
String email = randomStr(4) + "@celess.cn";
|
|
|
|
|
User user = new User(email, MD5Util.getMD5("123456789"));
|
|
|
|
|
userMapper.addUser(user);
|
|
|
|
|
User userByDb = userMapper.findByEmail(email);
|
|
|
|
|
userReq.setId(userByDb.getId());
|
|
|
|
|
userReq.setPwd(UUID.randomUUID().toString().replaceAll("-", "").substring(0, 10));
|
|
|
|
|
userReq.setDesc(UUID.randomUUID().toString());
|
|
|
|
|
userReq.setPwd(randomStr().substring(0, 10));
|
|
|
|
|
userReq.setDesc(randomStr());
|
|
|
|
|
userReq.setEmailStatus(new Random().nextBoolean());
|
|
|
|
|
userReq.setRole("admin");
|
|
|
|
|
userReq.setDisplayName(UUID.randomUUID().toString().substring(0, 4));
|
|
|
|
|
userReq.setEmail(UUID.randomUUID().toString().substring(0, 5) + "@celess.cn");
|
|
|
|
|
mockMvc.perform(put("/admin/user").contentType("application/json").content(JSONObject.fromObject(userReq).toString()))
|
|
|
|
|
.andDo(result -> assertEquals(HAVE_NOT_LOG_IN.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(put("/admin/user").contentType("application/json").header("Authorization", userLogin()).content(JSONObject.fromObject(userReq).toString()))
|
|
|
|
|
.andDo(result -> assertEquals(PERMISSION_ERROR.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(put("/admin/user").contentType("application/json").header("Authorization", adminLogin()).content(JSONObject.fromObject(userReq).toString()))
|
|
|
|
|
.andDo(result -> {
|
|
|
|
|
JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString());
|
|
|
|
|
assertEquals(SUCCESS.getCode(), object.getInt(Code));
|
|
|
|
|
UserModel userModel = (UserModel) JSONObject.toBean(object.getJSONObject(Result), UserModel.class);
|
|
|
|
|
userReq.setDisplayName(randomStr(4));
|
|
|
|
|
userReq.setEmail(randomStr().substring(0, 5) + "@celess.cn");
|
|
|
|
|
getMockData(put("/admin/user"), adminLogin(), userReq).andDo(result -> {
|
|
|
|
|
Response<UserModel> response = getResponse(result, USER_MODEL_TYPE);
|
|
|
|
|
assertEquals(SUCCESS.getCode(), response.getCode());
|
|
|
|
|
UserModel userModel = response.getResult();
|
|
|
|
|
assertEquals(userReq.getId(), userModel.getId());
|
|
|
|
|
assertEquals(userReq.getRole(), userModel.getRole());
|
|
|
|
|
assertEquals(userReq.getEmail(), userModel.getEmail());
|
|
|
|
|
@@ -206,25 +217,18 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void getAllUser() throws Exception {
|
|
|
|
|
mockMvc.perform(get("/admin/users?page=1&count=10"))
|
|
|
|
|
.andDo(result -> assertEquals(HAVE_NOT_LOG_IN.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(get("/admin/users?page=1&count=10").header("authorization", userLogin()))
|
|
|
|
|
.andDo(result -> assertEquals(PERMISSION_ERROR.getCode(), JSONObject.fromObject(result.getResponse().getContentAsString()).getInt(Code)));
|
|
|
|
|
mockMvc.perform(get("/admin/users?page=1&count=10").header("Authorization", adminLogin()))
|
|
|
|
|
.andDo(result -> {
|
|
|
|
|
JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString());
|
|
|
|
|
assertEquals(SUCCESS.getCode(), object.getInt(Code));
|
|
|
|
|
getMockData(get("/admin/users?page=1&count=10"), adminLogin()).andDo(result -> {
|
|
|
|
|
Response<PageData<UserModel>> response = getResponse(result, USER_MODEL_PAGE_TYPE);
|
|
|
|
|
assertEquals(SUCCESS.getCode(), response.getCode());
|
|
|
|
|
// 结果集非空
|
|
|
|
|
assertNotNull(object.getJSONObject(Result));
|
|
|
|
|
assertNotNull(response.getResult());
|
|
|
|
|
// 判断pageInfo是否包装完全
|
|
|
|
|
JSONObject resultJson = JSONObject.fromObject(object.getJSONObject(Result));
|
|
|
|
|
PageData<UserModel> pageData = (PageData<UserModel>) JSONObject.toBean(resultJson, PageData.class);
|
|
|
|
|
PageData<UserModel> pageData = response.getResult();
|
|
|
|
|
assertNotEquals(0, pageData.getTotal());
|
|
|
|
|
assertEquals(1, pageData.getPageNum());
|
|
|
|
|
assertEquals(10, pageData.getPageSize());
|
|
|
|
|
// 内容完整
|
|
|
|
|
for (Object user : pageData.getList()) {
|
|
|
|
|
UserModel u = (UserModel) JSONObject.toBean(JSONObject.fromObject(user), UserModel.class);
|
|
|
|
|
for (UserModel u : pageData.getList()) {
|
|
|
|
|
assertNotNull(u.getId());
|
|
|
|
|
assertNotNull(u.getEmail());
|
|
|
|
|
assertNotNull(u.getRole());
|
|
|
|
|
@@ -236,40 +240,24 @@ public class UserControllerTest extends BaseTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void getEmailStatus() throws Exception {
|
|
|
|
|
String email = UUID.randomUUID().toString().substring(0, 4) + "@celess.cn";
|
|
|
|
|
mockMvc.perform(get("/emailStatus/" + email)).andDo(result -> {
|
|
|
|
|
String content = result.getResponse().getContentAsString();
|
|
|
|
|
assertEquals(SUCCESS.getCode(), JSONObject.fromObject(content).getInt(Code));
|
|
|
|
|
assertFalse(JSONObject.fromObject(content).getBoolean(Result));
|
|
|
|
|
});
|
|
|
|
|
email = "a@celess.cn";
|
|
|
|
|
mockMvc.perform(get("/emailStatus/" + email)).andDo(result -> {
|
|
|
|
|
String content = result.getResponse().getContentAsString();
|
|
|
|
|
assertEquals(SUCCESS.getCode(), JSONObject.fromObject(content).getInt(Code));
|
|
|
|
|
assertTrue(JSONObject.fromObject(content).getBoolean(Result));
|
|
|
|
|
});
|
|
|
|
|
String email = randomStr(4) + "@celess.cn";
|
|
|
|
|
getMockData(get("/emailStatus/" + email)).andDo(result -> assertFalse((Boolean) getResponse(result, BOOLEAN_TYPE).getResult()));
|
|
|
|
|
getMockData(get("/emailStatus/" + ADMIN_EMAIL)).andDo(result -> assertTrue((Boolean) getResponse(result, BOOLEAN_TYPE).getResult()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void setPwd() throws Exception {
|
|
|
|
|
String email = UUID.randomUUID().toString().substring(0, 4) + "@celess.cn";
|
|
|
|
|
String email = randomStr(4) + "@celess.cn";
|
|
|
|
|
assertEquals(1, userMapper.addUser(new User(email, MD5Util.getMD5("1234567890"))));
|
|
|
|
|
LoginReq req = new LoginReq();
|
|
|
|
|
req.setEmail(email);
|
|
|
|
|
req.setPassword("1234567890");
|
|
|
|
|
req.setIsRememberMe(false);
|
|
|
|
|
JSONObject loginReq = JSONObject.fromObject(req);
|
|
|
|
|
String contentAsString = mockMvc.perform(post("/login").content(loginReq.toString()).contentType("application/json")).andReturn().getResponse().getContentAsString();
|
|
|
|
|
assertNotNull(contentAsString);
|
|
|
|
|
String token = JSONObject.fromObject(contentAsString).getJSONObject(Result).getString("token");
|
|
|
|
|
LoginReq req = new LoginReq(email, "1234567890", false);
|
|
|
|
|
String token = login(req);
|
|
|
|
|
assertNotNull(token);
|
|
|
|
|
MultiValueMap<String, String> param = new LinkedMultiValueMap<String, String>();
|
|
|
|
|
param.add("pwd", "1234567890");
|
|
|
|
|
param.add("newPwd", "aaabbbccc");
|
|
|
|
|
param.add("confirmPwd", "aaabbbccc");
|
|
|
|
|
mockMvc.perform(post("/user/setPwd").header("Authorization", token).params(param)).andDo(result -> {
|
|
|
|
|
String content = result.getResponse().getContentAsString();
|
|
|
|
|
assertEquals(SUCCESS.getCode(), JSONObject.fromObject(content).getInt(Code));
|
|
|
|
|
getMockData(post("/user/setPwd").params(param), token).andDo(result -> {
|
|
|
|
|
assertEquals(SUCCESS.getCode(), getResponse(result).getCode());
|
|
|
|
|
assertEquals(MD5Util.getMD5("aaabbbccc"), userMapper.getPwd(email));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|