コード例 #1
0
 private PasswordResetToken newPasswordResetToken(User user) {
   String id = mockValues.nextId();
   String token = mockValues.nextUUID().toString();
   PasswordResetToken passwordResetToken = new PasswordResetToken(token, user);
   passwordResetToken.setPasswordResetTokenId(id);
   return passwordResetToken;
 }
コード例 #2
0
 public PasswordResetToken newPasswordResetToken(User user, boolean expired) {
   PasswordResetToken passwordResetToken = newPasswordResetToken(user);
   if (expired) {
     Date now = Date.from(Calendar.getInstance().toInstant());
     passwordResetToken.setExpiryDate(now);
   }
   return passwordResetToken;
 }