KEYCLOAK-7015: Not allowing two users to have empty string emails addrs.

This commit is contained in:
ssilvert@win.redhat.com 2018-06-18 16:57:07 -04:00 committed by Stan Silvert
parent 871be4ad87
commit d55ccf5312
2 changed files with 9 additions and 1 deletions

View file

@ -195,6 +195,7 @@ public class UserResource {
user.setUsername(rep.getUsername());
}
if (rep.getEmail() != null) user.setEmail(rep.getEmail());
if (rep.getEmail() == "") user.setEmail(null);
if (rep.getFirstName() != null) user.setFirstName(rep.getFirstName());
if (rep.getLastName() != null) user.setLastName(rep.getLastName());

View file

@ -324,6 +324,13 @@ public class UserTest extends AbstractAdminTest {
assertAdminEvents.assertEmpty();
}
// KEYCLOAK-7015
@Test
public void createTwoUsersWithEmptyStringEmails() {
createUser("user1", "");
createUser("user2", "");
}
@Test
public void createUserWithFederationLink() {
@ -1212,7 +1219,7 @@ public class UserTest extends AbstractAdminTest {
switchEditUsernameAllowedOn(false);
}
}
@Test
public void resetUserPassword() {
String userId = createUser("user1", "user1@localhost");