fix:"保证验证码消费与账号变更原子提交"

This commit is contained in:
xpp committed 2026-10-21 23:09:02 +08:00
1 parent 32f6f67b9f
commit 02c21e5c19
9 files changed
+345 -14

No files matched your search

@@ -65,7 +65,9 @@ class AuthPostgresTest {
assertThrows(DataIntegrityViolationException.class, () -> jdbc.update("UPDATE users SET role = 'super_admin' WHERE id = ?", operatorId));
assertThrows(IllegalStateException.class, () -> auth.ensureAdmin("operator", "test-password", "Other"));
MockMvc http = MockMvcBuilders.standaloneSetup(new AuthController(auth, org.mockito.Mockito.mock(VerificationService.class), 168, true))
var verification = org.mockito.Mockito.mock(VerificationService.class);
var verifiedAccounts = new VerifiedAccountService(auth, verification, context.getBean(DataSourceTransactionManager.class));
MockMvc http = MockMvcBuilders.standaloneSetup(new AuthController(auth, verification, verifiedAccounts, 168, true))
.setControllerAdvice(new ApiExceptionHandler()).build();
var ownerCookie = login(http, "adimin", "super_admin");
var operatorCookie = login(http, "operator", "admin");