8000 Move PartialImportTest.java to the new testsuite by lhanusov · Pull Request #40279 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move PartialImportTest.java to the new testsuite #40279

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lhanusov
Copy link
Contributor
@lhanusov lhanusov commented Jun 5, 2025

Part of: #34494

Part of: keycloak#34494

Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
Comment on lines +91 to +93
protected ClientResource clientRolesClient() {
return ApiUtil.findClientResourceByName(managedRealm.admin(), CLIENT_ROLES_CLIENT);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This method can be replaced with rolesClient.admin()

@Test
public void testOverwriteExistingClientWithServiceAccount() {
setOverwrite();
piRep.setClients(Collections.singletonList(managedRealm.admin().clients().findByClientId(CLIENT_SERVICE_ACCOUNT).get(0)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
piRep.setClients(Collections.singletonList(managedRealm.admin().clients().findByClientId(CLIENT_SERVICE_ACCOUNT).get(0)));
piRep.setClients(Collections.singletonList(serviceClient.admin().toRepresentation()));

Comment on lines +185 to +186
ClientRepresentation client = managedRealm.admin().clients().findByClientId(CLIENT_SERVICE_ACCOUNT).get(0);
managedRealm.admin().clients().get(client.getId()).getServiceAccountUser();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ClientRepresentation client = managedRealm.admin().clients().findByClientId(CLIENT_SERVICE_ACCOUNT).get(0);
managedRealm.admin().clients().get(client.getId()).getServiceAccountUser();
serviceClient.admin().getServiceAccountUser();

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at this, I realized how little we use assertDoesNotThrow. Or actually only twice in all the tests. Why is it not used? Wouldn't it make it clearer what should and shouldn't happen?

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.

2 participants
0