Skip to content

Complete Identity Provider DSL support in test framework - #51436

Merged
ahus1 merged 4 commits into
keycloak:mainfrom
polifr:test-framework-builders-enhancement
Aug 6, 2026
Merged

Complete Identity Provider DSL support in test framework#51436
ahus1 merged 4 commits into
keycloak:mainfrom
polifr:test-framework-builders-enhancement

Conversation

@polifr

@polifr polifr commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR completes the Identity Provider DSL in the Keycloak Test Framework.

It includes:

  • additional configuration methods in IdentityProviderBuilder for properties already available in IdentityProviderRepresentation but not mapped in the builder
  • a new IdentityProviderMapperBuilder for IdentityProviderMapperRepresentation building
  • a RealmBuilder overload accepting IdentityProviderMapperBuilder instances

The changes allow complete broker configurations to be expressed using the fluent Realm DSL without directly manipulating representation classes.

Closes #51359

Copilot AI balanced review requested due to automatic review settings August 4, 2026 20:50
@polifr
polifr requested a review from a team as a code owner August 4, 2026 20:50

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

Completes the test-framework DSL for configuring identity providers and their mappers.

Changes:

  • Adds identity-provider configuration methods.
  • Introduces IdentityProviderMapperBuilder.
  • Adds mapper-builder support to RealmBuilder.

Reviewed changes

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

File Description
RealmBuilder.java Accepts identity-provider mapper builders.
IdentityProviderMapperBuilder.java Adds fluent mapper construction.
IdentityProviderBuilder.java Adds identity-provider configuration options.

Copilot AI review requested due to automatic review settings August 4, 2026 21:04

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

test-framework/builders/src/main/java/org/keycloak/testframework/realm/IdentityProviderMapperBuilder.java:15

  • The new fluent mapper path has no unit coverage, although this module's BuilderTest covers similar builder composition. Add a test that sets every mapper field/config entry, passes the builder to RealmBuilder.identityProviderMappers(...), and asserts the resulting nested representation so this new DSL contract is protected.
    public static IdentityProviderMapperBuilder create() {
        return new IdentityProviderMapperBuilder(new IdentityProviderMapperRepresentation());
    }

Copilot AI review requested due to automatic review settings August 4, 2026 21:44

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

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

@ahus1
ahus1 requested review from lhanusov and vaceksimon August 5, 2026 07:36

@vaceksimon vaceksimon 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.

Thanks for the contribution @polifr!

Please fix the spotless issue causing the CI failure, you can follow the CONTRIBUTING.md guide:

keycloak/CONTRIBUTING.md

Lines 126 to 151 in e8baed0

### Spotless
Spotless is used to check and apply code formatting. To check your code locally before sending a PR run:
```
./mvnw spotless:check
```
You can either use your IDE to fix these issues; or Spotless can fix them for you by running:
```
./mvnw spotless:apply
```
A good practice is to create a commit with your changes prior to running `spotless:apply` then you can see and
review what changes Spotless has applied, for example by using a diff tool. Finally, if you are happy with the changes
Spotless has applied you can amend the changes to your commit by running:
```
git add -a
git commit --amend
```
Note: If you get the error `Could not find goal 'verify' in plugin com.diffplug.spotless:spotless-maven-plugin` you are
probably running `mvn spotless:check` instead of `./mvnw spotless:check`. This is most likely a bug in Maven or the
Spotless plugin.

You can also ignore the Copilot's request for a test, it is not necessary for a builder. The test class can be removed.

Copilot AI review requested due to automatic review settings August 5, 2026 20:44
polifr added 4 commits August 5, 2026 22:47
Add missing builder methods to IdentityProviderBuilder and
introduce IdentityProviderMapperBuilder to provide a fluent API
consistent with the rest of the RealmBuilder DSL.

Closes keycloak#51359

Signed-off-by: Francesco Poli <polifr@gmail.com>
Signed-off-by: Francesco Poli <polifr@gmail.com>
Signed-off-by: Francesco Poli <polifr@gmail.com>
Signed-off-by: Francesco Poli <polifr@gmail.com>

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

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

@polifr
polifr force-pushed the test-framework-builders-enhancement branch from 783f628 to 40931bb Compare August 5, 2026 20:47
@vaceksimon

Copy link
Copy Markdown
Contributor

Hey @ahus1, can you please re-run the failed jobs? They don't seem to be related to this PR's changes

@vaceksimon vaceksimon 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.

Thanks @polifr, LGTM

@ahus1

ahus1 commented Aug 6, 2026

Copy link
Copy Markdown
Member

@vaceksimon - quite a lot of jobs failed; let's hope for the best.

@ahus1
ahus1 enabled auto-merge (squash) August 6, 2026 10:19
@ahus1
ahus1 merged commit 38e0c10 into keycloak:main Aug 6, 2026
147 of 151 checks passed
@polifr
polifr deleted the test-framework-builders-enhancement branch August 7, 2026 08:34
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.

Complete Identity Provider support in the Test Framework Realm DSL

4 participants