Thanks to visit codestin.com
Credit goes to github.com

Skip to content

initial version of the client v2 policy test#46029

Merged
mabartos merged 4 commits intokeycloak:mainfrom
edewit:issue-45932
Feb 6, 2026
Merged

initial version of the client v2 policy test#46029
mabartos merged 4 commits intokeycloak:mainfrom
edewit:issue-45932

Conversation

@edewit
Copy link
Contributor

@edewit edewit commented Feb 4, 2026

related to #45932
fixes: #46074

@edewit edewit requested review from a team as code owners February 4, 2026 16:59
@edewit edewit force-pushed the issue-45932 branch 2 times, most recently from 6b96f53 to 3bddb51 Compare February 5, 2026 09:54
@vmuzikar vmuzikar requested review from mabartos and vmuzikar February 5, 2026 10:52
@mabartos
Copy link
Contributor

mabartos commented Feb 6, 2026

@edewit Just before starting to reviewing that - would it be possible to create the sub-task for the #44154, to have it properly tracked? Thanks!

@edewit
Copy link
Contributor Author

edewit commented Feb 6, 2026

@mabartos done, reworded the commit

Copy link
Contributor

@mabartos mabartos left a comment

Choose a reason for hiding this comment

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

@edewit From the first look, it looks very good.

Just added some suggestion.

I'll also verify these test cases do make sense and if ther relate to the spike we did.

Thanks!

@AfterEach
public void cleanup() throws Exception {
// Clean up any test clients
cleanupClient("test-policy-client");
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to have ManagedRealm for these cases, as we might not care about these cleanups. However, I had some problems to have master realm managed (even with the attachTo) and custom admin clients.

On the other hand, we directly test the master realm, so the test coverage might be a little bit higher.

These test improvements can be done in a follow-up tasks with the help of guys working on the testsuite.

So, it's ok to me as is for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to a similar approach @mabartos did in #45981

* when a policy requires specific authenticators.
*/
@Test
public void testCreateClientWithUnacceptableAuthType() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

@edewit nitpick: it'd be good to not use the prefix "test", as it does not add any added value and is considered as old JUnit approach.

edewit and others added 2 commits February 6, 2026 11:52
Extract client profile/policy to dedicated method
Signed-off-by: Erik Jan de Wit <[email protected]>
Copy link
Contributor

@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

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

@edewit Thank you for the PR.

In general, I think it's good for now but obviously it'll need many refinements once we create clients properly and get rid of the "two-step approach".

@mabartos
Copy link
Contributor

mabartos commented Feb 6, 2026

@edewit @vmuzikar I think we can make improvements in the follow-up tasks.

I created some additions on top of these tests that I'd like to have included (still WiP): 91417ca

@mabartos mabartos merged commit 618384e into keycloak:main Feb 6, 2026
82 checks passed
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.

Create client policy test for rest v2

3 participants