[keycloak-user] Integration Tests

Marek Posolda mposolda at redhat.com
Tue Apr 4 15:48:19 EDT 2017


Hi,

there is some docs here 
https://github.com/keycloak/keycloak/blob/master/misc/Testsuite.md and 
here 
https://github.com/keycloak/keycloak/blob/master/misc/HackingOnKeycloak.md

Marek
On 04/04/17 19:17, Gabriel Trisca wrote:
> 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.
>



More information about the keycloak-user mailing list