Localize admin error messages

Fixes: #25977 (part of)

Signed-off-by: Hynek Mlnarik <hmlnarik@redhat.com>
This commit is contained in:
Hynek Mlnarik 2024-02-08 13:13:38 +01:00 committed by Hynek Mlnařík
parent 82b697400f
commit 49bbed13b9
2 changed files with 4 additions and 1 deletions

View file

@ -2951,6 +2951,7 @@ invalidEmailMessage='{{0}}': Invalid email address.
missingLastNameMessage='{{0}}': Please specify last name.
missingEmailMessage='{{0}}': Please specify email.
missingPasswordMessage='{{0}}': Please specify password.
updateReadOnlyAttributesRejectedMessage=Update of read-only attribute rejected
locales=Locales
realmOverrides=Realm overrides
realmOverridesHelp=You can only edit the supported locales. If you haven't selected supported locale yet, you only can edit English locale.

View file

@ -1682,9 +1682,11 @@ public class UserTest extends AbstractAdminTest {
user1.singleAttribute(LDAPConstants.LDAP_ID, "baz");
updateUser(realm.users().get(user1Id), user1);
Assert.fail("Not supposed to successfully update user");
} catch (BadRequestException bre) {
} catch (BadRequestException expected) {
// Expected
assertAdminEvents.assertEmpty();
ErrorRepresentation error = expected.getResponse().readEntity(ErrorRepresentation.class);
Assert.assertEquals("updateReadOnlyAttributesRejectedMessage", error.getErrorMessage());
}
// The same test as before, but with the case-sensitivity used