From 5fdb572f5f3adaad2d926e09c147e960ca5e8086 Mon Sep 17 00:00:00 2001 From: Lukas Hanusovsky <61745358+lhanusov@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:19:03 +0200 Subject: [PATCH] Testsuite PoC - Ability to configure server run-mode within the JUnit5 framework (#31109) Signed-off-by: Lukas Hanusovsky --- ...> AbstractKeycloakTestServerSupplier.java} | 11 +++++----- .../DistributionKeycloakTestServer.java | 20 +++++++++++++++++++ ...istributionKeycloakTestServerSupplier.java | 10 ++++++++++ .../EmbeddedKeycloakTestServerSupplier.java | 10 ++++++++++ .../RemoteKeycloakTestServerSupplier.java | 10 ++++++++++ ...keycloak.test.framework.injection.Supplier | 4 +++- 6 files changed, 59 insertions(+), 6 deletions(-) rename test-poc/framework/src/main/java/org/keycloak/test/framework/server/{KeycloakTestServerSupplier.java => AbstractKeycloakTestServerSupplier.java} (77%) create mode 100644 test-poc/framework/src/main/java/org/keycloak/test/framework/server/DistributionKeycloakTestServer.java create mode 100644 test-poc/framework/src/main/java/org/keycloak/test/framework/server/DistributionKeycloakTestServerSupplier.java create mode 100644 test-poc/framework/src/main/java/org/keycloak/test/framework/server/EmbeddedKeycloakTestServerSupplier.java create mode 100644 test-poc/framework/src/main/java/org/keycloak/test/framework/server/RemoteKeycloakTestServerSupplier.java diff --git a/test-poc/framework/src/main/java/org/keycloak/test/framework/server/KeycloakTestServerSupplier.java b/test-poc/framework/src/main/java/org/keycloak/test/framework/server/AbstractKeycloakTestServerSupplier.java similarity index 77% rename from test-poc/framework/src/main/java/org/keycloak/test/framework/server/KeycloakTestServerSupplier.java rename to test-poc/framework/src/main/java/org/keycloak/test/framework/server/AbstractKeycloakTestServerSupplier.java index 70ab47291c..17a9117fd6 100644 --- a/test-poc/framework/src/main/java/org/keycloak/test/framework/server/KeycloakTestServerSupplier.java +++ b/test-poc/framework/src/main/java/org/keycloak/test/framework/server/AbstractKeycloakTestServerSupplier.java @@ -7,7 +7,7 @@ import org.keycloak.test.framework.injection.Registry; import org.keycloak.test.framework.injection.Supplier; import org.keycloak.test.framework.injection.SupplierHelpers; -public class KeycloakTestServerSupplier implements Supplier { +public abstract class AbstractKeycloakTestServerSupplier implements Supplier { @Override public Class getValueType() { @@ -23,8 +23,7 @@ public class KeycloakTestServerSupplier implements Supplier getValue(Registry registry, KeycloakIntegrationTest annotation) { KeycloakTestServerConfig serverConfig = SupplierHelpers.getInstance(annotation.config()); -// RemoteKeycloakTestServer keycloakTestServer = new RemoteKeycloakTestServer(); - EmbeddedKeycloakTestServer keycloakTestServer = new EmbeddedKeycloakTestServer(); + KeycloakTestServer keycloakTestServer = getServer(); keycloakTestServer.start(serverConfig); @@ -37,8 +36,10 @@ public class KeycloakTestServerSupplier implements Supplier