Ported EnforcerConfigTest from Keycloak main. Improvements in testsui… #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…te to be better able to handle lifecycle of components
closes keycloak/keycloak#31979
PR introduces
authz-tests
module and addsEnforcerConfigTest
from the Keycloak testsuite. Hope other policy enforcer tests can be added as a follow-up (See parent issue of EnforcerConfigTest keycloak#31979 )Did some updates in the testsuite to make Keycloak server being executed just once per testsuite run (Currently it is separate run per all
admin-client-tests
,admin-client-jee-tests
andauthz-tests
as it is separate JVM run ofmaven-surefire-plugin
per each of the modules, but I hope we will have just those 3 modules and hence 3 runs of the Keycloak server per the testsuite run, which should be OK).For this, I've introduced junit jupiter extension
KeycloakClientTestExtension
and some related classes likeTestRegistry
. It allows to specify the "lifecycle" of the components, so for example Keycloak-server is executed just once per the testsuite, when admin-client is started/stopped once per every test class. The realms are imported also once per test class (Similar approach like Keycloak main testsuite).I've temporarily removed the
24.0
from the runs of the testsuite. The reason is, that it is not possible to import the realm with latest keycloak-admin-client to the Keycloak 24 server due this issue Not possible to import realm with newest Java admin-client against Keycloak 24 keycloak#32025 . Hopefully we can add it back once this is sorted.