From efdb99f8cecc4afb592afad79c761081d5d5cf22 Mon Sep 17 00:00:00 2001 From: lee <4766465@qq.com> Date: Wed, 18 Dec 2024 13:27:00 +0800 Subject: [PATCH] init --- system-test/src/main/java/com/yami/shop/systemtest/test/LoginTest.java | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/system-test/src/main/java/com/yami/shop/systemtest/test/LoginTest.java b/system-test/src/main/java/com/yami/shop/systemtest/test/LoginTest.java new file mode 100644 index 0000000..483dd22 --- /dev/null +++ b/system-test/src/main/java/com/yami/shop/systemtest/test/LoginTest.java @@ -0,0 +1,30 @@ +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); + } + +} -- Gitblit v1.9.3