[keycloak-user] Integration Tests

Gabriel Trisca gtrisca at cignifi.com
Tue Apr 4 13:17:48 EDT 2017


Hi all,

What is the best way to run integration tests with Keycloak? I would like
to have an embedded Keycloak server that can be brought up as a @ClassRule
or something along those lines, and then I can validate that different
users have or don't have access to resources/scopes.

I found that there is a testsuite path in Git that contains many useful
classes, like a KeycloakServer that can be initialized with a realm
exported as JSON, but this module (keycloak-testsuite-integration) is not
deployed to Maven central.

I tried to clone the repository and install that artifact locally, but I
face different errors that hint at mismatched versions in dependencies:

Caused by: java.lang.NoSuchMethodError:
org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Properties;
at
org.hibernate.jpa.internal.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:124)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:890)
at
org.keycloak.connections.jpa.util.JpaUtils.createEntityManagerFactory(JpaUtils.java:63)
...

Thanks in advance.

-- 
*Gabriel Trisca, Software Developer*
Cignifi | 101 Main Street, 14th Floor, Cambridge, MA 02142  USA
P: +1 857-209-2685 • M: +1 301-433-2221 | www.cignifi.com


More information about the keycloak-user mailing list