Repository navigation
Conversation
Signed-off-by: Robin Meese <39960884+robson90@users.noreply.github.com>
|
@robson90 Or even something like this in the parent class? @InjectAdminClient
Keycloak adminClient;
public ClientApi getClientApi(Keycloak adminClient, String realmName, String clientId) {
return adminClient.clients(realmName).v2().client(clientId);
}
public ClientApi getClientApi(String realmName, String clientId) {
return getClientApi(adminClient, realmName, clientId);
}
public ClientApi getClientApi(String clientId) {
return getClientApi(getRealmName(), clientId);
}The majority of the test might use only one adminClient and one realm, but sometimes, there are additional requirements. So, the |
|
@mabartos works for me, will adjust it. I just want to point out, it won't be possible to Inject with specific properties, for example: Right now that is only the case for the ManagedRealm, as the AdminClient has no config, as far as I have seen. |
@robson90 It's only for tests, so we can adjust how we want if we need some kind of functionality. But even with this managed realm, you can then specify the realm name as the |
|
Yeah works for me, thanks ! |
As discussed here: #46973 (comment)
Here is my proposal for the helper method.
This was the only option, to still have the option to overwrite the Injection in the child class.
Abstract class:
Child class:
CC: @mabartos && @vmuzikar