From 7b820a4eed18bf3a5b074abc1ec1bdb43476f150 Mon Sep 17 00:00:00 2001 From: Michael Gerber Date: Mon, 23 Mar 2015 21:03:56 +0100 Subject: [PATCH] i18n for default claims role description i18n tests typo fix unit test --- .../exportimport/util/ImportUtils.java | 3 + .../resources/theme/base/account/template.ftl | 4 +- .../login/messages/messages_de.properties | 25 +++- .../login/messages/messages_en.properties | 23 ++++ .../resources/theme/base/login/template.ftl | 4 +- .../protocol/saml/SamlProtocolFactory.java | 6 +- .../oidc/OIDCLoginProtocolFactory.java | 21 ++- .../protocol/oidc/mappers/AddressMapper.java | 4 +- .../services/managers/RealmManager.java | 3 + .../org/keycloak/testsuite/OAuthClient.java | 11 ++ .../testsuite/account/ProfileTest.java | 1 - .../testsuite/i18n/AccountPageTest.java | 84 ++++++++++++ .../keycloak/testsuite/i18n/EmailTest.java | 106 +++++++++++++++ .../testsuite/i18n/LoginPageTest.java | 122 ++++++++++++++++++ .../testsuite/pages/AbstractAccountPage.java | 14 ++ .../keycloak/testsuite/pages/LoginPage.java | 16 ++- .../src/test/resources/testrealm.json | 6 +- 17 files changed, 433 insertions(+), 20 deletions(-) create mode 100644 testsuite/integration/src/test/java/org/keycloak/testsuite/i18n/AccountPageTest.java create mode 100644 testsuite/integration/src/test/java/org/keycloak/testsuite/i18n/EmailTest.java create mode 100755 testsuite/integration/src/test/java/org/keycloak/testsuite/i18n/LoginPageTest.java diff --git a/export-import/export-import-api/src/main/java/org/keycloak/exportimport/util/ImportUtils.java b/export-import/export-import-api/src/main/java/org/keycloak/exportimport/util/ImportUtils.java index b3b6baf802..5c0a60c890 100755 --- a/export-import/export-import-api/src/main/java/org/keycloak/exportimport/util/ImportUtils.java +++ b/export-import/export-import-api/src/main/java/org/keycloak/exportimport/util/ImportUtils.java @@ -112,10 +112,12 @@ public class ImportUtils { RoleModel createRealmRole = realm.addRole(AdminRoles.CREATE_REALM); adminRole.addCompositeRole(createRealmRole); + createRealmRole.setDescription("${role_"+AdminRoles.CREATE_REALM+"}"); } else { adminRealm = model.getRealmByName(Config.getAdminRealm()); adminRole = adminRealm.getRole(AdminRoles.ADMIN); } + adminRole.setDescription("${role_"+AdminRoles.ADMIN+"}"); ApplicationModel realmAdminApp = KeycloakModelUtils.createApplication(adminRealm, KeycloakModelUtils.getMasterRealmAdminApplicationName(realm)); realmAdminApp.setBearerOnly(true); @@ -123,6 +125,7 @@ public class ImportUtils { for (String r : AdminRoles.ALL_REALM_ROLES) { RoleModel role = realmAdminApp.addRole(r); + role.setDescription("${role_"+r+"}"); adminRole.addCompositeRole(role); } } diff --git a/forms/common-themes/src/main/resources/theme/base/account/template.ftl b/forms/common-themes/src/main/resources/theme/base/account/template.ftl index 22bade4791..d461118989 100644 --- a/forms/common-themes/src/main/resources/theme/base/account/template.ftl +++ b/forms/common-themes/src/main/resources/theme/base/account/template.ftl @@ -30,8 +30,8 @@