From a3a56121a476cd23d0f29bc391c07374dc5008f2 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 16 九月 2026 15:25:07 +0800
Subject: [PATCH] feat(导游端): 更换消息提示音为新音频

---
 backend/src/test/java/com/tourguide/modules/user/service/GuideUserServiceProfileTest.java |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/backend/src/test/java/com/tourguide/modules/user/service/GuideUserServiceProfileTest.java b/backend/src/test/java/com/tourguide/modules/user/service/GuideUserServiceProfileTest.java
index a142289..e494fef 100644
--- a/backend/src/test/java/com/tourguide/modules/user/service/GuideUserServiceProfileTest.java
+++ b/backend/src/test/java/com/tourguide/modules/user/service/GuideUserServiceProfileTest.java
@@ -24,6 +24,7 @@
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -114,14 +115,9 @@
 
         service.createPendingFromApplication(application);
 
-        ArgumentCaptor<GuideUser> updateCaptor = ArgumentCaptor.forClass(GuideUser.class);
-        verify(userMapper).updateById(updateCaptor.capture());
-        GuideUser anonymizedGuide = updateCaptor.getValue();
-        assertThat(anonymizedGuide.getStatus()).isEqualTo(GuideUserService.STATUS_CANCELLED);
-        assertThat(anonymizedGuide.getUsername()).startsWith("deleted_").hasSize(32);
-        assertThat(anonymizedGuide.getMobile()).isNull();
-        assertThat(anonymizedGuide.getCertificateNo()).isNull();
-        assertThat(anonymizedGuide.getIdCardNo()).isNull();
+        verify(userMapper).anonymizeCancelledGuide(eq(12L), org.mockito.ArgumentMatchers.argThat(
+                username -> username.startsWith("deleted_") && username.length() == 32));
+        verify(userMapper).clearCancelledIdentityByIdCard("11010519491231002X");
 
         ArgumentCaptor<GuideUser> insertCaptor = ArgumentCaptor.forClass(GuideUser.class);
         verify(userMapper).insert(insertCaptor.capture());
@@ -134,6 +130,20 @@
     }
 
     @Test
+    void shouldReleaseIdentityFromStaleCancelledGuideBeforeNewRegistration() {
+        GuideApplication application = new GuideApplication();
+        application.setMobile("13900139000");
+        application.setRealName("新导游");
+        application.setIdCardNo("11010519491231002X");
+        when(userMapper.selectOne(any())).thenReturn(null);
+
+        service.createPendingFromApplication(application);
+
+        verify(userMapper).clearCancelledIdentityByIdCard("11010519491231002X");
+        verify(userMapper).insert(any(GuideUser.class));
+    }
+
+    @Test
     void shouldTreatOneYearOrLessAsZeroWorkYears() {
         GuideApplication application = new GuideApplication();
         application.setMobile("13800138000");

--
Gitblit v1.7.1