| | |
| | | } |
| | | |
| | | @Test |
| | | void shouldReleaseIdentityFromStalePendingGuideBeforeNewRegistration() { |
| | | 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).clearPendingIdentityByIdCard("11010519491231002X"); |
| | | verify(userMapper).insert(any(GuideUser.class)); |
| | | } |
| | | |
| | | @Test |
| | | void shouldReleasePendingIdentityWhenRejectingApplication() { |
| | | GuideUser pendingGuide = new GuideUser(); |
| | | pendingGuide.setId(12L); |
| | | pendingGuide.setStatus(GuideUserService.STATUS_PENDING); |
| | | pendingGuide.setMobile("13800138000"); |
| | | when(userMapper.selectOne(any())).thenReturn(pendingGuide); |
| | | |
| | | service.releaseIdentityForRejectedApplication("13800138000"); |
| | | |
| | | verify(userMapper).releasePendingIdentity(12L); |
| | | } |
| | | |
| | | @Test |
| | | void shouldTreatOneYearOrLessAsZeroWorkYears() { |
| | | GuideApplication application = new GuideApplication(); |
| | | application.setMobile("13800138000"); |