feat: add whitelist register mode

This commit is contained in:
Tim
2025-07-14 21:32:07 +08:00
parent c9c96edcb0
commit 609156f4e5
21 changed files with 161 additions and 36 deletions

View File

@@ -18,7 +18,7 @@ import static org.junit.jupiter.api.Assertions.*;
/** Integration tests for review publish mode. */
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = "app.post.publish-mode=REVIEW")
properties = {"app.post.publish-mode=REVIEW","app.register.mode=DIRECT"})
class PublishModeIntegrationTest {
@Autowired
@@ -34,7 +34,7 @@ class PublishModeIntegrationTest {
HttpHeaders h = new HttpHeaders();
h.setContentType(MediaType.APPLICATION_JSON);
rest.postForEntity("/api/auth/register", new HttpEntity<>(
Map.of("username", username, "email", email, "password", "pass123"), h), Map.class);
Map.of("username", username, "email", email, "password", "pass123", "reason", "integration test reason more than twenty"), h), Map.class);
User u = users.findByUsername(username).orElseThrow();
if (u.getVerificationCode() != null) {
rest.postForEntity("/api/auth/verify", new HttpEntity<>(