Merge pull request #3691 from vramik/migration-duplicate-emails

KEYCLOAK-4059 Added migration test
This commit is contained in:
Marek Posolda 2016-12-22 12:42:16 +01:00 committed by GitHub
commit b1d9fd670a

View file

@ -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());
}
}
}