| | |
| | | } |
| | | |
| | | @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); |
| | |
| | | service.disableEligibleGuides(); |
| | | |
| | | verify(guideUserMapper, never()).selectList(any()); |
| | | verify(guideUserMapper, never()).restoreAutoDisabledGuidesNoLongerEligible(any(), any()); |
| | | verifyNoInteractions(orderMapper, realtimeStatusMapper, receivingSessionMapper); |
| | | } |
| | | |