Hello Keycloak developers,
I think I found a neat way to develop and test custom Keycloak extensions
with a running Keycloak Docker container by using test-containers.
The trick is to dynamically map the target/classes folder into the
started container as an exploded deployment which can then be redeployed on demand
on class-file contents change during IDE build.
This allows speedy development cycles by skipping intermediate packaging steps and
eases testing. You can use the same approach in your integration tests. Since we expose our target/classes to the stock Keycloak container started by test-containers
during integration tests we can directly test our extensions without any packaging.
A demo for this approach (for development and testing) can be found here:
As always, I’m looking forward to hear your feedback
Cheers,
Thomas