@Test(expected = IllegalArgumentException.class) public void testIsPasswordResetTokenExpired_Throws_Exception_When_Token_Has_Whitespaces_Only() throws TokenNotExistException { sut.isPasswordResetTokenExpired(" "); }
@Override public Boolean isPasswordResetTokenExpired(String token) throws TokenNotExistException { if (!StringUtils.hasText(token)) { throw new IllegalArgumentException( "Password reset token is required."); } EmailToken passwordResetToken = findPasswordResetToken(token); Boolean isExpired = passwordResetToken.isTokenExpired(); return isExpired; }
PasswordResetServiceImpl implements PasswordResetService { @Override public Boolean isPasswordResetTokenExpired(String token) throws TokenNotExistException { if (!StringUtils.hasText(token)) { throw new IllegalArgumentException( "Password reset token is required."); } EmailToken passwordResetToken = findPasswordResetToken(token); Boolean isExpired = passwordResetToken.isTokenExpired(); return isExpired; } }
PasswordResetServiceImpl implements PasswordResetService { @Override public Boolean isPasswordResetTokenExpired(String token) throws TokenNotExistException { if (!StringUtils.hasText(token)) { throw new IllegalArgumentException( "Password reset token is required."); } EmailToken passwordResetToken = findPasswordResetToken(token); Boolean isExpired = passwordResetToken.isTokenExpired(); return isExpired; } PasswordResetServiceImpl(Integer passwordResetTokenExpireInHours,
			UsersRepository usersRepository,
			PatientRepository patientRepository,
			StaffRepository staffRepository, TokenGenerator tokenGenerator,
			EmailTokenRepository passwordResetTokenRepository,
			EmailSender emailSender, PasswordEncoder passwordEncoder); }
PasswordResetServiceImpl implements PasswordResetService { @Override public Boolean isPasswordResetTokenExpired(String token) throws TokenNotExistException { if (!StringUtils.hasText(token)) { throw new IllegalArgumentException( "Password reset token is required."); } EmailToken passwordResetToken = findPasswordResetToken(token); Boolean isExpired = passwordResetToken.isTokenExpired(); return isExpired; } PasswordResetServiceImpl(Integer passwordResetTokenExpireInHours,
			UsersRepository usersRepository,
			PatientRepository patientRepository,
			StaffRepository staffRepository, TokenGenerator tokenGenerator,
			EmailTokenRepository passwordResetTokenRepository,
			EmailSender emailSender, PasswordEncoder passwordEncoder); @Override void createPasswordResetToken(String username, String emailAddress,
			String linkUrl); @Override Boolean isPasswordResetTokenExpired(String token); @Override void resetPassword(PasswordResetDto passwordResetDto, String linkUrl); @Override boolean changePassword(PasswordChangeDto passwordChangeDto); }
PasswordResetServiceImpl implements PasswordResetService { @Override public Boolean isPasswordResetTokenExpired(String token) throws TokenNotExistException { if (!StringUtils.hasText(token)) { throw new IllegalArgumentException( "Password reset token is required."); } EmailToken passwordResetToken = findPasswordResetToken(token); Boolean isExpired = passwordResetToken.isTokenExpired(); return isExpired; } PasswordResetServiceImpl(Integer passwordResetTokenExpireInHours,
			UsersRepository usersRepository,
			PatientRepository patientRepository,
			StaffRepository staffRepository, TokenGenerator tokenGenerator,
			EmailTokenRepository passwordResetTokenRepository,
			EmailSender emailSender, PasswordEncoder passwordEncoder); @Override void createPasswordResetToken(String username, String emailAddress,
			String linkUrl); @Override Boolean isPasswordResetTokenExpired(String token); @Override void resetPassword(PasswordResetDto passwordResetDto, String linkUrl); @Override boolean changePassword(PasswordChangeDto passwordChangeDto);  }