Added migration for KEYCLOAK-4059

This commit is contained in:
Vlasta Ramik 2016-12-21 15:38:10 +01:00
parent 2ba21485f9
commit bb00524f94

View file

@ -78,6 +78,7 @@ public class MigrationTest extends AbstractKeycloakTest {
testMigrationTo2_1_0(); testMigrationTo2_1_0();
testMigrationTo2_2_0(); testMigrationTo2_2_0();
testMigrationTo2_3_0(); testMigrationTo2_3_0();
testMigrationTo2_5_0();
} }
@Test @Test
@ -85,6 +86,7 @@ public class MigrationTest extends AbstractKeycloakTest {
public void migration2_2_1Test() { public void migration2_2_1Test() {
testMigratedData(); testMigratedData();
testMigrationTo2_3_0(); testMigrationTo2_3_0();
testMigrationTo2_5_0();
} }
private void testMigratedData() { private void testMigratedData() {
@ -135,6 +137,13 @@ public class MigrationTest extends AbstractKeycloakTest {
testUpdateProtocolMappers(masterRealm, migrationRealm); 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) { private void testAuthorizationServices(RealmResource... realms) {
for (RealmResource realm : realms) { for (RealmResource realm : realms) {
//test setup of authorization services //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")); 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());
}
}
} }