Sit合并到prod #111

Merged
xiaowang merged 189 commits from sit into prod 2026-11-23 17:45:25 +08:00
Showing only changes of commit 2eefae834a - Show all commits
@@ -2,19 +2,23 @@ package com.xiaowang.jayucloud.salon.core.modules.user.support;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
class UserProfileFieldSupportTest {
/**
* 微信号已改为选填:空值与空白统一归一为 null,不再抛出必填异常。
*/
@Test
void nailArtistWechatIdIsOptional() {
assertDoesNotThrow(() -> UserProfileFieldSupport.requireWechatIdForServiceUser(3, null));
void blankWechatIdIsNormalizedToNull() {
assertNull(UserProfileFieldSupport.normalizeOptionalText(null));
assertNull(UserProfileFieldSupport.normalizeOptionalText(""));
assertNull(UserProfileFieldSupport.normalizeOptionalText(" "));
}
@Test
void managerWechatIdRemainsRequired() {
assertThrows(IllegalArgumentException.class,
() -> UserProfileFieldSupport.requireWechatIdForServiceUser(2, null));
void nonBlankWechatIdIsTrimmed() {
assertEquals("wx_123", UserProfileFieldSupport.normalizeOptionalText(" wx_123 "));
}
}