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

This commit is contained in:
ssilvert@win.redhat.com authored and Stan Silvert committed 2018-07-03 11:04:36 -04:00
1 parent 871be4ad87
commit d55ccf5312
2 files changed
+9 -1

No files matched your search

@@ -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());
@@ -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");