merge: 同步 K16 最新测试到回执分支

This commit is contained in:
Zhou Weidong authored and trae-solo-agent committed 2026-10-17 23:32:47 +08:00
commit 1493fce319
1 file changed
+11
@@ -204,6 +204,17 @@ class AppAuthServiceTest {
.hasMessageContaining("当前网络注册过于频繁");
}
@Test
void should_fallback_to_default_limit_when_config_is_missing() {
given(userMapper.selectCount(any())).willReturn(5L);
assertThatThrownBy(() -> authService.register(emailRegister("abcd1234", null), "203.0.113.8"))
.isInstanceOf(ServiceException.class)
.satisfies(ex -> assertThat(((ServiceException) ex).getCode())
.isEqualTo(ErrorCode.TOO_MANY_REQUESTS.getCode()))
.hasMessageContaining("当前网络注册过于频繁");
}
@Test
void should_not_limit_by_ip_when_ip_limit_is_zero() {
stubHappyRegister();