KEYCLOAK-2660 Test updating user without including username with brute force enabled
This commit is contained in:
parent
450b57c76a
commit
c9bbfc3b0b
1 changed files with 10 additions and 0 deletions
|
@ -614,6 +614,8 @@ public class UserTest extends AbstractAdminTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateUserWithoutUsername() {
|
public void updateUserWithoutUsername() {
|
||||||
|
|
||||||
|
|
||||||
switchEditUsernameAllowedOn();
|
switchEditUsernameAllowedOn();
|
||||||
|
|
||||||
String id = createUser();
|
String id = createUser();
|
||||||
|
@ -674,6 +676,7 @@ public class UserTest extends AbstractAdminTest {
|
||||||
@Test
|
@Test
|
||||||
public void updateUserWithExistingUsername() {
|
public void updateUserWithExistingUsername() {
|
||||||
switchEditUsernameAllowedOn();
|
switchEditUsernameAllowedOn();
|
||||||
|
enableBruteForce();
|
||||||
createUser();
|
createUser();
|
||||||
|
|
||||||
UserRepresentation userRep = new UserRepresentation();
|
UserRepresentation userRep = new UserRepresentation();
|
||||||
|
@ -847,4 +850,11 @@ public class UserTest extends AbstractAdminTest {
|
||||||
assertAdminEvents.assertEvent(realmId, OperationType.UPDATE, Matchers.nullValue(String.class), rep);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue