diff --git a/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java b/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java index 99ece5117c..b61e16aab6 100644 --- a/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java +++ b/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java @@ -25,6 +25,7 @@ import org.keycloak.common.Version; import org.keycloak.common.util.Time; import org.keycloak.connections.jpa.JpaConnectionProvider; import org.keycloak.migration.MigrationModel; +import org.keycloak.migration.ModelVersion; import org.keycloak.models.ClientProvider; import org.keycloak.models.ClientScopeProvider; import org.keycloak.models.Constants; @@ -57,7 +58,7 @@ public class MigrationModelTest extends KeycloakModelTest { public void test() { inComittedTransaction(1, (session , i) -> { - String currentVersion = Version.VERSION_KEYCLOAK.replaceAll("^(\\d+(?:\\.\\d+){0,2}).*$", "$1"); + String currentVersion = new ModelVersion(Version.VERSION_KEYCLOAK).toString(); JpaConnectionProvider p = session.getProvider(JpaConnectionProvider.class); EntityManager em = p.getEntityManager();