Source:
<code>protected static final String AUTH_SERVER_PORT = AUTH_SERVER_SSL_REQUIRED ? System.getProperty("auth.server.https.port", "8543") : System.getProperty("auth.server.http.port", "8180"); protected static final String ENGLISH_LOCALE_NAME = "English"; protected Logger log = Logger.getLogger(this.getClass()); @ArquillianResource protected SuiteContext suiteContext; @ArquillianResource protected TestContext testContext; protected Keycloak adminClient; protected KeycloakTestingClient testingClient; @ArquillianResource protected OAuthClient oauth; protected List<RealmRepresentation> testRealmReps; @Drone protected WebDriver driver; @Page protected AuthServerContextRoot authServerContextRootPage; @Page protected AuthServer authServerPage; @Page protected AuthRealm masterRealmPage; @Page protected Account accountPage; @Page protected OIDCLogin loginPage; @Page protected UpdatePassword updatePasswordPage; @Page protected LoginPasswordUpdatePage passwordUpdatePage; @Page protected WelcomePage welcomePage; private PropertiesConfiguration constantsProperties; private boolean resetTimeOffset; @Before public void beforeAbstractKeycloakTest() throws Exception { <START> TestClassProvider.getInstance(); <END> adminClient = testContext.getAdminClient(); if (adminClient == null || adminClient.isClosed()) { reconnectAdminClient(); } getTestingClient(); setDefaultPageUriParameters(); TestEventsLogger.setDriver(driver); if (!AuthServerTestEnricher.AUTH_SERVER_CLUSTER) { updateMasterAdminPassword(); } beforeAbstractKeycloakTestRealmImport(); if (testContext.getTestRealmReps().isEmpty()) { importTestRealms(); if (!isImportAfterEachMethod()) { testContext.setTestRealmReps(testRealmReps); } afterAbstractKeycloakTestRealmImport(); } oauth.init(driver); } public void reconnectAdminClient() throws Exception { testContext.reconnectAdminClient(); adminClient = testContext.getAdminClient(); } protected void beforeAbstractKeycloakTestRealmImport() throws Exception { } protected void postAfterAbstractKeycloak() { }</code><technical_language>AuthServerTestEnricher.initializeSuiteContext other arquillian @BeforeSuite event handler a fit for this</technical_language>

Target:
protected static final String AUTH_SERVER_PORT = AUTH_SERVER_SSL_REQUIRED ? System.getProperty("auth.server.https.port", "8543") : System.getProperty("auth.server.http.port", "8180"); protected static final String ENGLISH_LOCALE_NAME = "English"; protected Logger log = Logger.getLogger(this.getClass()); @ArquillianResource protected SuiteContext suiteContext; @ArquillianResource protected TestContext testContext; protected Keycloak adminClient; protected KeycloakTestingClient testingClient; @ArquillianResource protected OAuthClient oauth; protected List<RealmRepresentation> testRealmReps; @Drone protected WebDriver driver; @Page protected AuthServerContextRoot authServerContextRootPage; @Page protected AuthServer authServerPage; @Page protected AuthRealm masterRealmPage; @Page protected Account accountPage; @Page protected OIDCLogin loginPage; @Page protected UpdatePassword updatePasswordPage; @Page protected LoginPasswordUpdatePage passwordUpdatePage; @Page protected WelcomePage welcomePage; private PropertiesConfiguration constantsProperties; private boolean resetTimeOffset; @Before public void beforeAbstractKeycloakTest() throws Exception { adminClient = testContext.getAdminClient(); if (adminClient == null || adminClient.isClosed()) { reconnectAdminClient(); } getTestingClient(); setDefaultPageUriParameters(); TestEventsLogger.setDriver(driver); if (!AuthServerTestEnricher.AUTH_SERVER_CLUSTER) { updateMasterAdminPassword(); } beforeAbstractKeycloakTestRealmImport(); if (testContext.getTestRealmReps().isEmpty()) { importTestRealms(); if (!isImportAfterEachMethod()) { testContext.setTestRealmReps(testRealmReps); } afterAbstractKeycloakTestRealmImport(); } oauth.init(driver); } public void reconnectAdminClient() throws Exception { testContext.reconnectAdminClient(); adminClient = testContext.getAdminClient(); } protected void beforeAbstractKeycloakTestRealmImport() throws Exception { } protected void postAfterAbstractKeycloak() { }