From 7c031505e21abc7b6ee15fe66be7c3b4afed09ec Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Fri, 8 Dec 2017 17:38:00 -0500 Subject: [PATCH] add test --- .../migration/AbstractMigrationTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java index b8282f8f5a..07a08ab75b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java @@ -34,6 +34,7 @@ import org.keycloak.representations.idm.AuthenticationFlowRepresentation; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ClientTemplateRepresentation; import org.keycloak.representations.idm.ComponentRepresentation; +import org.keycloak.representations.idm.MappingsRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RequiredActionProviderRepresentation; @@ -180,6 +181,23 @@ public abstract class AbstractMigrationTest extends AbstractKeycloakTest { } } + protected void testMigrationTo3_4_2() { + testCliConsoleScopeSize(this.masterRealm); + testCliConsoleScopeSize(this.migrationRealm); + } + + private void testCliConsoleScopeSize(RealmResource realm) { + ClientRepresentation cli = realm.clients().findByClientId(Constants.ADMIN_CLI_CLIENT_ID).get(0); + ClientRepresentation console = realm.clients().findByClientId(Constants.ADMIN_CONSOLE_CLIENT_ID).get(0); + MappingsRepresentation scopeMappings = realm.clients().get(console.getId()).getScopeMappings().getAll(); + Assert.assertNull(scopeMappings.getClientMappings()); + Assert.assertNull(scopeMappings.getRealmMappings()); + + scopeMappings = realm.clients().get(cli.getId()).getScopeMappings().getAll(); + Assert.assertNull(scopeMappings.getClientMappings()); + Assert.assertNull(scopeMappings.getRealmMappings()); + } + protected void testDockerAuthenticationFlow(RealmResource... realms) { for (RealmResource realm : realms) { AuthenticationFlowRepresentation flow = null; @@ -420,6 +438,7 @@ public abstract class AbstractMigrationTest extends AbstractKeycloakTest { testMigrationTo3_2_0(); testMigrationTo3_4_0(); testMigrationTo3_4_1(); + testMigrationTo3_4_2(); }