Skip to content

Commit

Permalink
feat: 修改测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
KouShenhai committed Jan 22, 2025
1 parent 4015d8e commit 9eb0982
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 48 deletions.
9 changes: 9 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ image:https://img.shields.io/badge/Q群-465450496-blue.svg[KCloud-Platform开源
image:doc/image/img_1.png[COLA架构图,400,400,align=center]
image:doc/image/img.png[COLA架构图,400,400,align=center]

=== 🌿 服务器配置

[width=100%]
|===
|环境 |配置 |备注
|开发 | 32G【内存】  512G【磁盘】 |无
|生产 | 16G【内存】  40G【磁盘】 |请搭建集群
|===

=== 🔗 在线体验

[width=100%]
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ KCloud-Platform-IoT(阻塞式)(老寇IoT云平台)是一个企业级微
<img src="doc/image/img_1.png" width=400 height=400 alt="COLA架构图"/>
<img src="doc/image/img.png" width=400 height=400 alt="COLA架构图"/>

### 🌿 服务器配置

| 环境 | 配置 | 备注 |
|:--:|:---------------------------:|:-----:|
| 开发 | 32G【内存】&nbsp;&nbsp;512G【磁盘】 ||
| 生产 | 16G【内存】&nbsp;&nbsp;40G【磁盘】 | 请搭建集群 |

### 🔗 在线体验

| 序号 | 账号 | 密码 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,47 +37,32 @@ class AuthParamValidatorTest {
@Test
void testUsernamePasswordAuthParamValidator() {
AuthParamValidatorExtPt authParamValidator = new UsernamePasswordAuthParamValidator();
Assertions.assertNotNull(authParamValidator);

AuthA auth = DomainFactory.getUsernamePasswordAuth(1L, "admin", "123", "laokou", "1", "1234");
Assertions.assertNotNull(auth);

// 校验用户名密码登录
authParamValidator.validate(auth);
}

@Test
void testAuthorizationCodeAuthParamValidator() {
AuthParamValidatorExtPt authParamValidator = new AuthorizationCodeAuthParamValidator();
Assertions.assertNotNull(authParamValidator);

AuthA auth = DomainFactory.getAuthorizationCodeAuth(1L, "admin", "123", "laokou");
Assertions.assertNotNull(auth);

// 校验授权码登录
authParamValidator.validate(auth);
}

@Test
void testMailAuthParamValidator() {
AuthParamValidatorExtPt authParamValidator = new MailAuthParamValidator();
Assertions.assertNotNull(authParamValidator);

AuthA auth = DomainFactory.getMailAuth(1L, "[email protected]", "123456", "laokou");
Assertions.assertNotNull(auth);

// 校验邮箱登录
authParamValidator.validate(auth);
}

@Test
void testMobileAuthParamValidator() {
AuthParamValidatorExtPt authParamValidator = new MobileAuthParamValidator();
Assertions.assertNotNull(authParamValidator);

AuthA auth = DomainFactory.getMobileAuth(1L, "18888888888", "123456", "laokou");
Assertions.assertNotNull(auth);

// 校验手机号登录
authParamValidator.validate(auth);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.laokou.auth;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.laokou.auth.factory.DomainFactory;
import org.laokou.auth.model.CaptchaE;
Expand All @@ -35,11 +34,7 @@ class CaptchaParamValidatorTest {
@Test
void testMailCaptchaParamValidator() {
CaptchaParamValidatorExtPt captchaParamValidator = new MailCaptchaParamValidator();
Assertions.assertNotNull(captchaParamValidator);

CaptchaE captcha = DomainFactory.getCaptcha();
Assertions.assertNotNull(captcha);

// 校验邮箱验证码
captcha.setUuid("[email protected]");
captcha.setTenantCode("laokou");
Expand All @@ -49,11 +44,7 @@ void testMailCaptchaParamValidator() {
@Test
void testMobileCaptchaParamValidator() {
CaptchaParamValidatorExtPt captchaParamValidator = new MobileCaptchaParamValidator();
Assertions.assertNotNull(captchaParamValidator);

CaptchaE captcha = DomainFactory.getCaptcha();
Assertions.assertNotNull(captcha);

// 校验手机号验证码
captcha.setUuid("18888888888");
captcha.setTenantCode("laokou");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ class ExtensionExecutorTest {
void testUsernamePasswordAuthParamValidateExecutor() {
// 校验参数
validate();

AuthA auth = DomainFactory.getUsernamePasswordAuth(1L, "admin", "123", "laokou", "1", "1234");
Assertions.assertNotNull(auth);

// 注册【用户名密码登录】校验器
doRegistration(new UsernamePasswordAuthParamValidator());

// 执行参数校验【用户名密码登录】
execute(auth);
}
Expand All @@ -75,13 +71,9 @@ void testUsernamePasswordAuthParamValidateExecutor() {
void testMailAuthParamValidateExecutor() {
// 校验参数
validate();

AuthA auth = DomainFactory.getMailAuth(1L, "[email protected]", "123456", "laokou");
Assertions.assertNotNull(auth);

// 注册【邮箱登录】校验器
doRegistration(new MailAuthParamValidator());

// 执行参数校验【邮箱登录】
execute(auth);
}
Expand All @@ -90,13 +82,9 @@ void testMailAuthParamValidateExecutor() {
void testMobileAuthParamValidateExecutor() {
// 校验参数
validate();

AuthA auth = DomainFactory.getMobileAuth(1L, "18888888888", "123456", "laokou");
Assertions.assertNotNull(auth);

// 注册【手机号登录】校验器
doRegistration(new MobileAuthParamValidator());

// 执行参数校验【手机号登录】
execute(auth);
}
Expand All @@ -105,13 +93,9 @@ void testMobileAuthParamValidateExecutor() {
void testAuthorizationCodeAuthParamValidateExecutor() {
// 校验参数
validate();

AuthA auth = DomainFactory.getAuthorizationCodeAuth(1L, "admin", "123", "laokou");
Assertions.assertNotNull(auth);

// 注册【授权码登录】校验器
doRegistration(new AuthorizationCodeAuthParamValidator());

// 执行参数校验【授权码登录】
execute(auth);
}
Expand All @@ -120,13 +104,9 @@ void testAuthorizationCodeAuthParamValidateExecutor() {
void testMailCaptchaParamValidateExecutor() {
// 校验参数
validate();

CaptchaE captcha = DomainFactory.getCaptcha();
Assertions.assertNotNull(captcha);

// 注册【邮箱验证码】校验器
doRegistration(new MailCaptchaParamValidator());

// 执行参数校验【邮箱验证码】
captcha.setTag(MAIL_TAG);
captcha.setUuid("[email protected]");
Expand All @@ -138,13 +118,9 @@ void testMailCaptchaParamValidateExecutor() {
void testCaptchaParamValidateExecutor() {
// 校验参数
validate();

CaptchaE captcha = DomainFactory.getCaptcha();
Assertions.assertNotNull(captcha);

// 注册【手机号验证码】校验器
doRegistration(new MobileCaptchaParamValidator());

// 执行参数校验【手机号验证码】
captcha.setTag(MOBILE_TAG);
captcha.setUuid("18888888888");
Expand Down

0 comments on commit 9eb0982

Please sign in to comment.