8000 Add core unit tests for utility edge cases by cr7yash · Pull Request #49327 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Add core unit tests for utility edge cases - #49327

Open
cr7yash wants to merge 2 commits into
keycloak:mainfrom
cr7yash:test/add-diverse-test-cases
Open

cr7yash wants to merge 2 commits into
keycloak:mainfrom
cr7yash:test/add-diverse-test-cases

Conversation

@cr7yash
@cr7yash cr7yash commented May 26, 2026
Copy link
Copy Markdown

Adds focused unit coverage for basic auth parsing, URI query decoding, JSON attribute deserialization, and ID token session state compatibility.

Closes #49325

Adds focused unit coverage for basic auth parsing, URI query decoding, JSON attribute deserialization, and ID token session state compatibility.

Closes keycloak#49325

Signed-off-by: cr7yash <yashaqua@gmail.com>
@cr7yash
cr7yash requested a review from a team as a code owner May 26, 2026 10:07
Copilot AI review requested due to automatic review settings May 26, 2026 10:07
Copilot AI left a comment
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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds additional unit tests to cover edge cases and backward-compatibility behaviors for several core utilities.

Changes:

  • Add tests for query-string decoding behavior (spaces/plus handling and empty parameters).
  • Add Basic Auth parsing test where the password contains colons.
  • Add tests for deprecated IDToken#getSessionState() compatibility and non-string JSON attribute deserialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
core/src/test/java/org/keycloak/util/UriUtilsTest.java Adds coverage for UriUtils.decodeQueryString decoding and empty parameter behavior.
core/src/test/java/org/keycloak/util/BasicAuthHelperTest.java Adds coverage for parsing Basic Auth headers when the password contains :.
core/src/test/java/org/keycloak/representations/IDTokenTest.java Adds a regression test asserting deprecated session-state behavior maps to session ID.
core/src/test/java/org/keycloak/json/StringListMapDeserializerTest.java Adds coverage ensuring non-string JSON primitive values are coerced into strings.

Comment on lines +81 to +84
8000
MultivaluedHashMap<String, String> actual = UriUtils.decodeQueryString("first%20name=Jane+Doe&empty");

assertEquals("Jane Doe", actual.getFirst("first name"));
assertEquals("", actual.getFirst("empty"));

@Test
public void testDecodeQueryString() {
MultivaluedHashMap<String, String> actual = UriUtils.decodeQueryString("first%20name=Jane+Doe&empty");
Signed-off-by: cr7yash <yashaqua@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 03:43
Copilot AI left a comment
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.

🟢 Approval recommended

No active review issues are identified for this test-only expansion of utility edge-case and ID token compatibility coverage.

2 open issues

Review effort: Balanced

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.

Add unit coverage for core utility edge cases

3 participants

0