@Test public void testJverifyPasswordResetLinkInvalidKey() { String activationKey = "invalidKey"; try { _userService.verifiyPasswordResetLink(2L, activationKey); } catch (IpatException e) { assertEquals(ErrorCodes.INVALID_ACTIVATION_KEY, e.getErrorInfos().get(0).getErrorCode()); } }
public String verifiyPasswordResetLink(long userId, String key) throws IpatException { User user = getUser(userId); IpatPreconditions.checkArgument(key.equals(user.getActivationKey()), ErrorCodes.INVALID_ACTIVATION_KEY); return user.getName(); }
UserService { public String verifiyPasswordResetLink(long userId, String key) throws IpatException { User user = getUser(userId); IpatPreconditions.checkArgument(key.equals(user.getActivationKey()), ErrorCodes.INVALID_ACTIVATION_KEY); return user.getName(); } }
UserService { public String verifiyPasswordResetLink(long userId, String key) throws IpatException { User user = getUser(userId); IpatPreconditions.checkArgument(key.equals(user.getActivationKey()), ErrorCodes.INVALID_ACTIVATION_KEY); return user.getName(); }  }
UserService { public String verifiyPasswordResetLink(long userId, String key) throws IpatException { User user = getUser(userId); IpatPreconditions.checkArgument(key.equals(user.getActivationKey()), ErrorCodes.INVALID_ACTIVATION_KEY); return user.getName(); }  User createAnonymous(); UserReportData getUserDetails(String userName, boolean isEditAllowed); void editUser(String userName, String toEdit, String newEntry); String uploadUserImage(String userName, MultipartFile file); void registrateUser(UserRegistrationData userRegistrationData); void activateUser(long userId, String key); void createPasswordResetMail(String userName); String verifiyPasswordResetLink(long userId, String key); String resetPasswordForUser(long userId, String key, String password); User anonymizeUser(String userName); }
UserService { public String verifiyPasswordResetLink(long userId, String key) throws IpatException { User user = getUser(userId); IpatPreconditions.checkArgument(key.equals(user.getActivationKey()), ErrorCodes.INVALID_ACTIVATION_KEY); return user.getName(); }  User createAnonymous(); UserReportData getUserDetails(String userName, boolean isEditAllowed); void editUser(String userName, String toEdit, String newEntry); String uploadUserImage(String userName, MultipartFile file); void registrateUser(UserRegistrationData userRegistrationData); void activateUser(long userId, String key); void createPasswordResetMail(String userName); String verifiyPasswordResetLink(long userId, String key); String resetPasswordForUser(long userId, String key, String password); User anonymizeUser(String userName);  }