From bb00524f94cb791dd5a039d2d8bbd9635fb6fd6a Mon Sep 17 00:00:00 2001 From: Vlasta Ramik Date: Wed, 21 Dec 2016 15:38:10 +0100 Subject: [PATCH] Added migration for KEYCLOAK-4059 --- .../testsuite/migration/MigrationTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java index fe789ace43..a3ff89401d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java @@ -78,6 +78,7 @@ public class MigrationTest extends AbstractKeycloakTest { testMigrationTo2_1_0(); testMigrationTo2_2_0(); testMigrationTo2_3_0(); + testMigrationTo2_5_0(); } @Test @@ -85,6 +86,7 @@ public class MigrationTest extends AbstractKeycloakTest { public void migration2_2_1Test() { testMigratedData(); testMigrationTo2_3_0(); + testMigrationTo2_5_0(); } private void testMigratedData() { @@ -135,6 +137,13 @@ public class MigrationTest extends AbstractKeycloakTest { testUpdateProtocolMappers(masterRealm, migrationRealm); } + private void testMigrationTo2_5_0() { + //TODO org.keycloak.migration.migrators.MigrateTo2_5_0 + + //https://github.com/keycloak/keycloak/pull/3630 + testDuplicateEmailSupport(masterRealm, migrationRealm); + } + private void testAuthorizationServices(RealmResource... realms) { for (RealmResource realm : realms) { //test setup of authorization services @@ -214,4 +223,12 @@ public class MigrationTest extends AbstractKeycloakTest { protocolMapper.getConfig().get("id.token.claim"), protocolMapper.getConfig().get("userinfo.token.claim")); } } + + private void testDuplicateEmailSupport(RealmResource... realms) { + for (RealmResource realm : realms) { + RealmRepresentation rep = realm.toRepresentation(); + assertTrue("LoginWithEmailAllowed should be enabled.", rep.isLoginWithEmailAllowed()); + assertFalse("DuplicateEmailsAllowed should be disabled.", rep.isDuplicateEmailsAllowed()); + } + } }