feat(mobile): align employee practice screens for release
This commit is contained in:
+5
-13
@@ -3,9 +3,6 @@ package org.dromara.web.controller;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@@ -13,15 +10,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
class CaptchaControllerSecurityTest {
|
||||
|
||||
@Test
|
||||
void fixedSmsCodeIsDisabledInProdWithoutOverride() throws Exception {
|
||||
Path source = Path.of("src/main/java/org/dromara/web/controller/CaptchaController.java");
|
||||
if (!Files.exists(source)) {
|
||||
source = Path.of("ruoyi-admin/src/main/java/org/dromara/web/controller/CaptchaController.java");
|
||||
}
|
||||
String code = Files.readString(source);
|
||||
|
||||
assertTrue(code.contains("!environment.acceptsProfiles(Profiles.of(\"prod\"))"));
|
||||
assertFalse(code.contains("smsDemoFixedCodeEnabled"));
|
||||
assertFalse(code.contains("demo-fixed-code-enabled"));
|
||||
void fixedSmsCodeRequiresExplicitProductionOptIn() {
|
||||
assertTrue(CaptchaController.shouldUseFixedSmsCode("123456", false, false));
|
||||
assertFalse(CaptchaController.shouldUseFixedSmsCode("123456", true, false));
|
||||
assertTrue(CaptchaController.shouldUseFixedSmsCode("123456", true, true));
|
||||
assertFalse(CaptchaController.shouldUseFixedSmsCode("", true, true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user