From d9de19885af7a64d528c88e07bc0e675e5915a41 Mon Sep 17 00:00:00 2001 From: Diana Krepinska Date: Fri, 12 Apr 2024 21:03:53 +0200 Subject: [PATCH] test --- .../test/java/org/wildfly/security/http/oidc/BearerTest.java | 5 +++-- .../test/java/org/wildfly/security/http/oidc/OidcTest.java | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/http/oidc/src/test/java/org/wildfly/security/http/oidc/BearerTest.java b/http/oidc/src/test/java/org/wildfly/security/http/oidc/BearerTest.java index 1aacbe3239d..5e2f32bc497 100644 --- a/http/oidc/src/test/java/org/wildfly/security/http/oidc/BearerTest.java +++ b/http/oidc/src/test/java/org/wildfly/security/http/oidc/BearerTest.java @@ -35,6 +35,7 @@ import java.util.List; import java.util.Map; +import com.gargoylesoftware.htmlunit.html.HtmlPage; import org.apache.http.HttpStatus; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -464,9 +465,9 @@ private void accessAppWithoutToken(String endpoint, InputStream oidcConfigInputS try { // browser login should succeed client.setDispatcher(createAppResponse(mechanism, HttpStatus.SC_MOVED_TEMPORARILY, getClientUrl(), CLIENT_PAGE_TEXT)); - TextPage page = loginToKeycloak(KeycloakConfiguration.ALICE, KeycloakConfiguration.ALICE_PASSWORD, requestUri, response.getLocation(), + HtmlPage page = loginToKeycloak(KeycloakConfiguration.ALICE, KeycloakConfiguration.ALICE_PASSWORD, requestUri, response.getLocation(), response.getCookies()).click(); - assertTrue(page.getContent().contains(CLIENT_PAGE_TEXT)); + assertTrue(page.asText().contains(CLIENT_PAGE_TEXT)); } finally { client.setDispatcher(new QueueDispatcher()); } diff --git a/http/oidc/src/test/java/org/wildfly/security/http/oidc/OidcTest.java b/http/oidc/src/test/java/org/wildfly/security/http/oidc/OidcTest.java index 3df0fce7410..483d7b45a68 100644 --- a/http/oidc/src/test/java/org/wildfly/security/http/oidc/OidcTest.java +++ b/http/oidc/src/test/java/org/wildfly/security/http/oidc/OidcTest.java @@ -36,7 +36,6 @@ import org.junit.Test; import org.wildfly.security.http.HttpServerAuthenticationMechanism; -import com.gargoylesoftware.htmlunit.TextPage; import com.gargoylesoftware.htmlunit.html.HtmlPage; import io.restassured.RestAssured; @@ -156,9 +155,9 @@ private void performAuthentication(InputStream oidcConfig, String username, Stri if (loginToKeycloak) { client.setDispatcher(createAppResponse(mechanism, expectedDispatcherStatusCode, expectedLocation, clientPageText)); - TextPage page = loginToKeycloak(username, password, requestUri, response.getLocation(), + HtmlPage page = loginToKeycloak(username, password, requestUri, response.getLocation(), response.getCookies()).click(); - assertTrue(page.getContent().contains(clientPageText)); + assertTrue(page.asText().contains(clientPageText)); } } finally { client.setDispatcher(new QueueDispatcher());