fix:"保证验证码消费与账号变更原子提交"
This commit is contained in:
1 parent
32f6f67b9f
commit
02c21e5c19
9 files changed
+345
-14
No files matched your search
+2
-1
@@ -323,7 +323,8 @@ class PlatformAdminPostgresTest {
|
||||
}
|
||||
|
||||
@Test void directCreationCannotEscalateAndOtpIsRequiredOnBothChannels() throws Exception {
|
||||
MockMvc http = MockMvcBuilders.standaloneSetup(new AuthController(auth,verification,168,false)).setControllerAdvice(new ApiExceptionHandler()).build();
|
||||
var verifiedAccounts = new VerifiedAccountService(auth, verification, context.getBean(DataSourceTransactionManager.class));
|
||||
MockMvc http = MockMvcBuilders.standaloneSetup(new AuthController(auth,verification,verifiedAccounts,168,false)).setControllerAdvice(new ApiExceptionHandler()).build();
|
||||
http.perform(post("/api/admin/users").cookie(new Cookie("moyi_session",ownerToken)).contentType("application/json").content("{\"account\":\"created_user\",\"password\":\"test-password\",\"role\":\"super_admin\"}"))
|
||||
.andExpect(status().isCreated()).andExpect(jsonPath("$.user.role").value("user")).andExpect(jsonPath("$.user.password").doesNotExist());
|
||||
http.perform(post("/api/admin/users").cookie(new Cookie("moyi_session",memberToken)).contentType("application/json").content("{\"account\":\"bad_user\",\"password\":\"test-password\"}"))
|
||||
|
||||
Reference in new issue
Block a user