How to test a custom extension (SPI Authenticator)

33 views
Skip to first unread message

Alvaro Arenas

unread,
Oct 11, 2021, 9:50:48 AM10/11/21
to Keycloak Dev
Hi there,

I have created some Authenticators and a required action and wonder what would be the best approach to make some acceptance tests. I am thinking something similar on what the own keycloak test suit does with Arquillian. However, I don't know what would be the right way to start with this. We also have some integration from the keycloak authenticators to an external service. I don't need to test the real integration with the service. I am happy with some type of mocking for this interface. I am interested in testing the keycloak bits.

Is there a cleaver way i could leverage the keycloak codebase by including it in my project. If yes, which subproject should I import?

Or is there some other approach for this?

I have not used arquillian and I am under the impression that to use the keycloak test suite with my code, i will have to add my project to the keycloak parent project.

Any ideas are appreciated.

Alvaro


Sven-Torben Janus

unread,
Oct 21, 2021, 7:46:28 AM10/21/21
to Keycloak Dev
Hey Alvaro,

I am using Testcontainers with Keycloak Testcontainers extension for this purpose in my own project.
You can find the dependencies needed in the pom here and an example test here.

Best regards
Sven-Torben

Reply all
Reply to author
Forward
0 new messages