Esempio n. 1
0
 public KeycloakTestingClient getTestingClient() {
   if (testingClient == null) {
     testingClient =
         KeycloakTestingClient.getInstance(
             AuthServerTestEnricher.getAuthServerContextRoot() + "/auth");
   }
   return testingClient;
 }
Esempio n. 2
0
  @Before
  public void beforeAbstractKeycloakTest() throws Exception {
    SSLContext ssl = null;
    if ("true".equals(System.getProperty("auth.server.ssl.required"))) {
      ssl =
          getSSLContextWithTrustore(
              new File("src/test/resources/keystore/keycloak.truststore"), "secret");
    }
    adminClient =
        Keycloak.getInstance(
            AuthServerTestEnricher.getAuthServerContextRoot() + "/auth",
            MASTER,
            ADMIN,
            ADMIN,
            Constants.ADMIN_CLI_CLIENT_ID,
            null,
            ssl);

    getTestingClient();

    adminUser = createAdminUserRepresentation();

    setDefaultPageUriParameters();

    driverSettings();

    TestEventsLogger.setDriver(driver);

    if (!suiteContext.isAdminPasswordUpdated()) {
      log.debug("updating admin password");
      updateMasterAdminPassword();
      suiteContext.setAdminPasswordUpdated(true);
    }

    importTestRealms();

    oauth.init(adminClient, driver);
  }