From 47c1c07e03de15886879b29e3ba7b81afd84a417 Mon Sep 17 00:00:00 2001 From: Sergey Beryozkin Date: Fri, 3 Jan 2025 13:26:34 +0000 Subject: [PATCH] More HtmlUnit fixes in OIDC code flow and multi-tenancy docs --- .../main/asciidoc/security-oidc-code-flow-authentication.adoc | 4 ++-- .../main/asciidoc/security-openid-connect-multitenancy.adoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc b/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc index 7f5495186009a..c4bcee3711aad 100644 --- a/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc +++ b/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc @@ -1923,12 +1923,12 @@ public class CodeFlowAuthorizationTest { // the test REST endpoint listens on '/code-flow' HtmlPage page = webClient.getPage("http://localhost:8081/code-flow"); - HtmlForm form = page.getFormByName("form"); + HtmlForm form = page.getForms().get(0); // user 'alice' has the 'user' role form.getInputByName("username").type("alice"); form.getInputByName("password").type("alice"); - page = form.getInputByValue("login").click(); + page = form.getButtonByName("login").click(); assertEquals("alice", page.getBody().asNormalizedText()); } diff --git a/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc b/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc index 5f83c5e2b00aa..85cef4c352505 100644 --- a/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc +++ b/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc @@ -503,7 +503,7 @@ public class CodeFlowTest { page = loginForm.getButtonByName("login").click(); - assertTrue(page.asText().contains("tenant")); + assertTrue(page.asNormalizedText().contains("tenant")); } } @@ -521,7 +521,7 @@ public class CodeFlowTest { page = loginForm.getButtonByName("login").click(); - assertTrue(page.asText().contains("alice@tenant-a.org")); + assertTrue(page.asNormalizedText().contains("alice@tenant-a.org")); } }