-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3398 from KouShenhai/dev
Dev
- Loading branch information
Showing
7 changed files
with
33 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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"); | ||
|
@@ -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"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
} | ||
|
@@ -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); | ||
} | ||
|
@@ -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); | ||
} | ||
|
@@ -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); | ||
} | ||
|
@@ -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]"); | ||
|
@@ -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"); | ||
|