Dev #107

Merged
xiaowang merged 5 commits from dev into sit 2026-11-08 23:25:06 +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 org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertNull;
class UserProfileFieldSupportTest { class UserProfileFieldSupportTest {
/**
* 微信号已改为选填:空值与空白统一归一为 null,不再抛出必填异常。
*/
@Test @Test
void nailArtistWechatIdIsOptional() { void blankWechatIdIsNormalizedToNull() {
assertDoesNotThrow(() -> UserProfileFieldSupport.requireWechatIdForServiceUser(3, null)); assertNull(UserProfileFieldSupport.normalizeOptionalText(null));
assertNull(UserProfileFieldSupport.normalizeOptionalText(""));
assertNull(UserProfileFieldSupport.normalizeOptionalText(" "));
} }
@Test @Test
void managerWechatIdRemainsRequired() { void nonBlankWechatIdIsTrimmed() {
assertThrows(IllegalArgumentException.class, assertEquals("wx_123", UserProfileFieldSupport.normalizeOptionalText(" wx_123 "));
() -> UserProfileFieldSupport.requireWechatIdForServiceUser(2, null));
} }
} }