[keycloak-dev] Testing with mocking libraries?

Stian Thorgersen sthorger at redhat.com
Wed May 30 03:19:23 EDT 2018


At the moment our testing strategy is only with functional or integration
level tests. Both with the full server up and running and primarily testing
through public APIs.

Now here comes the question should we also allow testing through a mocking
library like Mockito?

In general I'm against mocking libraries. At best you end up with something
that may work, but you're not guaranteed that it actually works. They also
have a very big maintenance cost when any changes are made to the codebase.

However, take a look at https://github.com/keycloak/keycloak/pull/5215 for
example. It is a contribution to add support for the hd param to the Google
login. Not sure how else we could test this without a mocking library.


More information about the keycloak-dev mailing list