package com.yami.shop.systemtest.test;
|
|
import cn.hutool.crypto.symmetric.AES;
|
import com.yami.shop.security.common.dto.AuthenticationDTO;
|
import com.yami.shop.security.common.vo.TokenInfoVO;
|
import com.yami.shop.systemtest.constants.Constant;
|
import com.yami.shop.systemtest.util.HttpUtil;
|
|
import java.nio.charset.StandardCharsets;
|
|
public class LoginTest {
|
|
|
// @Test
|
public void doTest() {
|
String url = Constant.API_URL + "/login";
|
String userName = "ping";
|
String password = "ping";
|
|
AES aes = new AES("-mall4j-password".getBytes(StandardCharsets.UTF_8));
|
password = aes.encryptBase64(System.currentTimeMillis() + password);
|
|
AuthenticationDTO authenticationDTO = new AuthenticationDTO();
|
authenticationDTO.setUserName(userName);
|
authenticationDTO.setPassWord(password);
|
|
TokenInfoVO token = HttpUtil.post(url, authenticationDTO, TokenInfoVO.class);
|
}
|
|
}
|