Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
public class RequiredActionUpdateProfileTest {

private static final String PASSWORD = PasswordGenerateUtil.generatePassword();
private static final String EMAIL_ALREADY_EXISTS_ERROR_MESSAGE = "This email is already associated with an existing account.";

@InjectRealm(config = RequiredActionUpdateProfileRealmConfig.class)
ManagedRealm realm;
Expand Down Expand Up @@ -339,7 +340,7 @@ public void updateProfileDuplicatedEmail() {
Assertions.assertEquals("New last", updateProfilePage.getLastName());
Assertions.assertEquals("keycloak-user@localhost", updateProfilePage.getEmail());

Assertions.assertEquals("Email already exists.", updateProfilePage.getInputErrors().getEmailError());
Assertions.assertEquals(EMAIL_ALREADY_EXISTS_ERROR_MESSAGE, updateProfilePage.getInputErrors().getEmailError());

Assertions.assertNull(events.poll());
}
Expand Down Expand Up @@ -399,7 +400,7 @@ public void updateProfileDuplicatedEmailWithUsername() {
Assertions.assertEquals("New last", updateProfilePage.getLastName());
Assertions.assertEquals("user1@local.com", updateProfilePage.getEmail());

Assertions.assertEquals("Email already exists.", updateProfilePage.getInputErrors().getEmailError());
Assertions.assertEquals(EMAIL_ALREADY_EXISTS_ERROR_MESSAGE, updateProfilePage.getInputErrors().getEmailError());

Assertions.assertNull(events.poll());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void updateToExistingEmail() {
emailUpdatePage.changeEmail("john-doh@localhost");
emailUpdatePage.assertCurrent();

Assertions.assertEquals("Email already exists.", emailUpdatePage.getEmailError());
Assertions.assertEquals("This email is already associated with an existing account.", emailUpdatePage.getEmailError());

UserRepresentation user = ActionUtil.findUserWithAdminClient(adminClient, "test-user@localhost");
Assertions.assertEquals("test-user@localhost", user.getEmail());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void updateEmailDuplicate() {
// assert that form holds submitted values during validation error
Assertions.assertEquals("test-user@localhost", updateEmailPage.getEmail());

Assertions.assertEquals("Email already exists.", updateEmailPage.getEmailInputError());
Assertions.assertEquals("This email is already associated with an existing account.", updateEmailPage.getEmailInputError());

Assertions.assertNull(events.poll());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void confirmEmailAfterDuplicateEmailSetForThirdPartyAccount() throws Mess
driver.navigate().to(confirmationLink);

errorPage.assertCurrent();
assertEquals("Email already exists.", errorPage.getError());
assertEquals("This email is already associated with an existing account.", errorPage.getError());
}

private String fetchEmailConfirmationLink(String emailRecipient) throws MessagingException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public void updateProfileDuplicatedEmail() {
Assertions.assertEquals("New last", updateProfilePage.getLastName());
Assertions.assertEquals("keycloak-user@localhost", updateProfilePage.getEmail());

Assertions.assertEquals("Email already exists.", updateProfilePage.getInputErrors().getEmailError());
Assertions.assertEquals("This email is already associated with an existing account.", updateProfilePage.getInputErrors().getEmailError());

Assertions.assertNull(events.poll());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public void confirmEmailAfterDuplicateEmailSetForThirdPartyAccount() throws Mess
driver.navigate().to(confirmationLink);

errorPage.assertCurrent();
assertEquals("Email already exists.", errorPage.getError());
assertEquals("This email is already associated with an existing account.", errorPage.getError());
assertTrue(ActionUtil.findUserWithAdminClient(adminClient, "test-user@localhost").getRequiredActions().contains(UserModel.RequiredAction.UPDATE_EMAIL.name()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ public void registerExistingLdapUser() {
// Check existing email
registerPage.register("firstName", "lastName", "existing@email.org", "nonExisting", "Password1", "Password1");
registerPage.assertCurrent();
Assertions.assertEquals("Email already exists.", registerPage.getInputAccountErrors().getEmailError());
Assertions.assertEquals("This email is already associated with an existing account.", registerPage.getInputAccountErrors().getEmailError());
}


Expand Down Expand Up @@ -997,7 +997,7 @@ public void testImportExistingUserFromLDAP() throws Exception {
// Try to import the duplicated LDAP user into Keycloak
oauth.openLoginForm();
loginPage.login("mary-duplicatemail", "password");
Assertions.assertEquals("Email already exists.", loginPage.getError());
Assertions.assertEquals("This email is already associated with an existing account.", loginPage.getError());
Comment thread
robson90 marked this conversation as resolved.

loginPage.login("mary1@email.org", "password");
Assertions.assertEquals("Username already exists.", loginPage.getError());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
*/
public class RegisterTest extends AbstractTestRealmKeycloakTest {

private static final String EMAIL_ALREADY_EXISTS_ERROR_MESSAGE = "This email is already associated with an existing account.";

@Rule
public AssertEvents events = new AssertEvents(this);

Expand Down Expand Up @@ -133,7 +135,7 @@ public void registerExistingEmailForbidden() {
registerPage.register("firstName", "lastName", "test-user@localhost", "registerExistingUser", generatePassword());

registerPage.assertCurrent();
assertEquals("Email already exists.", registerPage.getInputAccountErrors().getEmailError());
assertEquals(EMAIL_ALREADY_EXISTS_ERROR_MESSAGE, registerPage.getInputAccountErrors().getEmailError());

// assert form keeps form fields on error
assertEquals("firstName", registerPage.getFirstName());
Expand Down Expand Up @@ -607,7 +609,7 @@ public void registerExistingUser_emailAsUsername() throws IOException {
registerPage.registerWithEmailAsUsername("firstName", "lastName", "test-user@localhost", generatePassword());

registerPage.assertCurrent();
assertEquals("Email already exists.", registerPage.getInputAccountErrors().getEmailError());
assertEquals(EMAIL_ALREADY_EXISTS_ERROR_MESSAGE, registerPage.getInputAccountErrors().getEmailError());

EventAssertion.expectRegisterError(events.poll()).error("email_in_use").clientId(oauth.getClientId()).details(Details.USERNAME, "test-user@localhost").details(Details.EMAIL, "test-user@localhost");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ invalidPasswordConfirmMessage=Password confirmation doesn''t match.
invalidTotpMessage=Invalid authenticator code.

usernameExistsMessage=Username already exists.
emailExistsMessage=Email already exists.
emailExistsMessage=This email is already associated with an existing account.

readOnlyUserMessage=You can''t update your account as it is read-only.
readOnlyUsernameMessage=You can''t update your username as it is read-only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ invalidPasswordConfirmMessage=Password confirmation doesn''t match.
invalidTotpMessage=Invalid authenticator code.

usernameExistsMessage=Username already exists.
emailExistsMessage=Email already exists.
emailExistsMessage=This email is already associated with an existing account.
Comment thread
robson90 marked this conversation as resolved.

federatedIdentityExistsMessage=User with {0} {1} already exists. Please login to account management to link the account.
federatedIdentityUnavailableMessage=User {0} authenticated with identity provider {1} does not exist. Please contact your administrator.
Expand Down
Loading