+
Skip to content

Initial tests for admin-client #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Conversation

graziang
Copy link
Contributor

@graziang graziang commented Sep 6, 2024

First PR to add admin-client tests from keycloak repository to keycloak-client repository:

  • Keycloak admin client class copied into the testsuite to add some useful methods, synced some classes from keycloak-server-spi and keycloak-server-spi-private into the admin client such as Constants and StringUtil. Is this okay, or is it better to copy them into the testsuite?

  • Other classes like CibaConfig, OAuth2DeviceConfig, and ParConfig instead have been simplified and copied directly into the testsuite due too many dependencies, for example with RealmModel, KeycloakSession, and many others that are currently unnecessary to synchronize.

  • Created AbstractAdminClientTest which imports the default realms and injects the adminClient and the oauthClient.

  • Created the annotation @KeycloakVersion, which takes min and/or max values (i.e. @KeycloakVersion(min="25.0.0")) to use on test methods to run the test only on specific Keycloak versions.

  • So far, only the tests AdminClientTest, RealmTest, RealmRolesTest, and ClientTest have been migrated.

  • Assertions on admin events have been removed.

  • Tests strictly related to operations that require the use of KeycloakTestingClient and then related to the testing resource provider (such as run on server) have been removed or modified.

Closes keycloak/keycloak#31869

Closes #31869

Signed-off-by: Giuseppe Graziano <g.graziano94@gmail.com>
Copy link
Contributor

@mposolda mposolda left a comment

Choose a reason for hiding this comment

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

@graziang Great work, Huge thanks for it!

I have few comments, which are mostly minor things and/or possible follow-up work to this PR. I have only one bigger concern, which is copying the class Keycloak to the testsuite, which I am not sure why it is needed.

Closes #31869

Signed-off-by: Giuseppe Graziano <g.graziano94@gmail.com>
@graziang
Copy link
Contributor Author

graziang commented Sep 9, 2024

@mposolda Thanks for the review, I replied to your comments and added another commit.

Copy link
Contributor

@mposolda mposolda left a comment

Choose a reason for hiding this comment

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

@graziang Nice, Thanks for all the updates and clarifications to my comments!

@mposolda mposolda merged commit 292abdd into keycloak:main Sep 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more tests for admin-client
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载