Merge pull request #2993 from stianst/KEYCLOAK-2660

KEYCLOAK-2660 Test updating user without including username with brut…
This commit is contained in:
Stian Thorgersen 2016-07-04 19:11:56 +02:00 committed by GitHub
commit 453859d14f

View file

@ -614,6 +614,8 @@ public class UserTest extends AbstractAdminTest {
@Test
public void updateUserWithoutUsername() {
switchEditUsernameAllowedOn();
String id = createUser();
@ -674,6 +676,7 @@ public class UserTest extends AbstractAdminTest {
@Test
public void updateUserWithExistingUsername() {
switchEditUsernameAllowedOn();
enableBruteForce();
createUser();
UserRepresentation userRep = new UserRepresentation();
@ -847,4 +850,11 @@ public class UserTest extends AbstractAdminTest {
assertAdminEvents.assertEvent(realmId, OperationType.UPDATE, Matchers.nullValue(String.class), rep);
}
private void enableBruteForce() {
RealmRepresentation rep = realm.toRepresentation();
rep.setBruteForceProtected(true);
realm.update(rep);
assertAdminEvents.assertEvent(realmId, OperationType.UPDATE, Matchers.nullValue(String.class), rep);
}
}