@Test(expected = RepositoryException.class) public void testChangePasswordWithOldMismatch() throws Exception { user.changePassword("different", "wrongOldPassword"); }
@Override public void changePassword(String password) throws RepositoryException { if (password == null) { throw new RepositoryException("Attempt to set 'null' password for user " + getID()); } UserManagerImpl userManager = getUserManager(); userManager.onPasswordChange(this, password); pwHistory.updatePasswordHistory(getTree(), password); userManager.setPassword(getTree(), getID(), password, false); }
UserImpl extends AuthorizableImpl implements User { @Override public void changePassword(String password) throws RepositoryException { if (password == null) { throw new RepositoryException("Attempt to set 'null' password for user " + getID()); } UserManagerImpl userManager = getUserManager(); userManager.onPasswordChange(this, password); pwHistory.updatePasswordHistory(getTree(), password); userManager.setPassword(getTree(), getID(), password, false); } }
UserImpl extends AuthorizableImpl implements User { @Override public void changePassword(String password) throws RepositoryException { if (password == null) { throw new RepositoryException("Attempt to set 'null' password for user " + getID()); } UserManagerImpl userManager = getUserManager(); userManager.onPasswordChange(this, password); pwHistory.updatePasswordHistory(getTree(), password); userManager.setPassword(getTree(), getID(), password, false); } UserImpl(String id, Tree tree, UserManagerImpl userManager); }
UserImpl extends AuthorizableImpl implements User { @Override public void changePassword(String password) throws RepositoryException { if (password == null) { throw new RepositoryException("Attempt to set 'null' password for user " + getID()); } UserManagerImpl userManager = getUserManager(); userManager.onPasswordChange(this, password); pwHistory.updatePasswordHistory(getTree(), password); userManager.setPassword(getTree(), getID(), password, false); } UserImpl(String id, Tree tree, UserManagerImpl userManager); @Override boolean isGroup(); @NotNull @Override Principal getPrincipal(); @Override boolean isAdmin(); @Override boolean isSystemUser(); @NotNull @Override Credentials getCredentials(); @NotNull @Override Impersonation getImpersonation(); @Override void changePassword(String password); @Override void changePassword(@Nullable String password, @NotNull String oldPassword); @Override void disable(@Nullable String reason); @Override boolean isDisabled(); @Nullable @Override String getDisabledReason(); }
UserImpl extends AuthorizableImpl implements User { @Override public void changePassword(String password) throws RepositoryException { if (password == null) { throw new RepositoryException("Attempt to set 'null' password for user " + getID()); } UserManagerImpl userManager = getUserManager(); userManager.onPasswordChange(this, password); pwHistory.updatePasswordHistory(getTree(), password); userManager.setPassword(getTree(), getID(), password, false); } UserImpl(String id, Tree tree, UserManagerImpl userManager); @Override boolean isGroup(); @NotNull @Override Principal getPrincipal(); @Override boolean isAdmin(); @Override boolean isSystemUser(); @NotNull @Override Credentials getCredentials(); @NotNull @Override Impersonation getImpersonation(); @Override void changePassword(String password); @Override void changePassword(@Nullable String password, @NotNull String oldPassword); @Override void disable(@Nullable String reason); @Override boolean isDisabled(); @Nullable @Override String getDisabledReason();  }