From 39f6fca28e3f78abe48f08e474ec011abb990b36 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 09 九月 2026 10:39:21 +0800
Subject: [PATCH] update

---
 backend/src/test/java/com/tourguide/modules/user/service/GuideAutoDisableServiceTest.java |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/backend/src/test/java/com/tourguide/modules/user/service/GuideAutoDisableServiceTest.java b/backend/src/test/java/com/tourguide/modules/user/service/GuideAutoDisableServiceTest.java
index 7e4d4be..30202aa 100644
--- a/backend/src/test/java/com/tourguide/modules/user/service/GuideAutoDisableServiceTest.java
+++ b/backend/src/test/java/com/tourguide/modules/user/service/GuideAutoDisableServiceTest.java
@@ -58,6 +58,21 @@
     }
 
     @Test
+    void shouldRestoreAutomaticallyDisabledGuideNoLongerMatchingRule() {
+        GuideAutoDisableConfig config = validConfig();
+        when(configMapper.selectById(1)).thenReturn(config);
+        when(guideUserMapper.restoreAutoDisabledGuidesNoLongerEligible(10, new BigDecimal("4.50")))
+                .thenReturn(1);
+        when(guideUserMapper.selectList(any())).thenReturn(Collections.emptyList());
+
+        service.synchronizeGuideStatuses();
+
+        verify(guideUserMapper).restoreAutoDisabledGuidesNoLongerEligible(10, new BigDecimal("4.50"));
+        verify(guideUserMapper, never()).autoDisableIfEligible(any(), any(), any());
+        verifyNoInteractions(orderMapper, realtimeStatusMapper, receivingSessionMapper);
+    }
+
+    @Test
     void shouldNotDisableGuideWithoutAnEffectiveRating() {
         GuideUser guide = eligibleGuide(0);
         guide.setRating(BigDecimal.ZERO);
@@ -128,6 +143,7 @@
         service.disableEligibleGuides();
 
         verify(guideUserMapper, never()).selectList(any());
+        verify(guideUserMapper, never()).restoreAutoDisabledGuidesNoLongerEligible(any(), any());
         verifyNoInteractions(orderMapper, realtimeStatusMapper, receivingSessionMapper);
     }
 

--
Gitblit v1.7.1