Skip to content

Refactor AssertEvents expect() and related methods to use EventAssertion equivalents.#48752

Open
lhanusov wants to merge 1 commit into
keycloak:mainfrom
lhanusov:48621
Open

Refactor AssertEvents expect() and related methods to use EventAssertion equivalents.#48752
lhanusov wants to merge 1 commit into
keycloak:mainfrom
lhanusov:48621

Conversation

@lhanusov
Copy link
Copy Markdown
Contributor

@lhanusov lhanusov commented May 6, 2026

Closes #48621

Comment on lines +476 to +477
.details(Details.PREVIOUS_LAST_NAME, "Brady").details(Details.UPDATED_LAST_NAME, "LastCC")
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.details(Details.PREVIOUS_LAST_NAME, "Brady").details(Details.UPDATED_LAST_NAME, "LastCC")
;
.details(Details.PREVIOUS_LAST_NAME, "Brady").details(Details.UPDATED_LAST_NAME, "LastCC");

Comment on lines +554 to +556
.details(Details.EMAIL, "login@test.com")
.sessionId(null)
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.details(Details.EMAIL, "login@test.com")
.sessionId(null)
;
.details(Details.EMAIL, "login@test.com")
.sessionId(null);

Comment on lines +298 to +299
.details(Details.FIELDS_TO_UPDATE, "department")
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.details(Details.FIELDS_TO_UPDATE, "department")
;
.details(Details.FIELDS_TO_UPDATE, "department");

@lhanusov lhanusov force-pushed the 48621 branch 4 times, most recently from 05160f1 to 1a2f39c Compare May 13, 2026 10:39
@@ -76,6 +76,28 @@ public R poll() {
return events.poll();
}

public R poll(int seconds) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be added here and would be considered generally bad practice to use this one.

The two brute force tests should handle internally in the test.

The RecoveryAuthnCodesAuthenticatorTest is honestly not very well written as its sending two requests without waiting, but it will be a bit random if one page is done before the other, and the whole clickSignInButtonViaJavaScriptNoDelay is just weird. I'd say this one should really click the buttoms in separate threads or something like that, then wait for both browers to be redirected, then it can just use events.poll()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to fix it, but the problem is with the HtmlUnitDriver, I will try something tomorrow, but don't think I will be successful.

@lhanusov lhanusov force-pushed the 48621 branch 3 times, most recently from df60bf1 to 117d7cc Compare May 13, 2026 14:37
…ion equivalents.

Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite expect into assertSuccess or assertError

2 participants