Looks like it's not. The WAR is here just for Alpha1 https://repository.jboss.org/nexus/content/groups/public/org/keycloak/keycloak-server/1.0-alpha-1-12062013/ but not for later releases, which looks like a bug IMO. Can you create JIRA for it? I think it won't be bad if release will include all the artifacts including docs and distribution stuff (like WAR and full Wildfly appliance)Hi guys,
I'm just setting up an integration test project for our application and I'm wondering what's the best way to bootstrap keycloak within it.
I'm using arquillian for testing and I'm using the maven-dependency-plugin and maven-resources-plugin to put together a wildfly instance with the keycloak-wildfly-adapter.
So far, that approach works nicely. However, I'm not quite sure yet how to go about
* importing a realm and* creating a bearer/ access token to use in the test cases
One approach would be to deploy the auth-server.war (is there a mvn repository to pull it from?), POST the realm to the respective URL of the admin console and do the authentication the same way (POST http://localhost:8080/auth/rest/realms/TestRealm/tokens/grants/access).
Maybe it will be interesting for you that we have integration testsuite https://github.com/keycloak/keycloak/tree/master/testsuite/integration . This testsuite is using embedded Undertow server and it programmatically deploys Keycloak server on it. You can take a look at KeycloakServer class and also at individual tests to see how it works. The point is that it's embedded, so test classes have access to KeycloakSessionFactory inside KeycloakSetup actions and so they can directly use the model API to setup needed things.
Alternatively, I suppose I could deploy a small helper war or jar that accesses the core services of keycloak to import the realm and create test access tokens (some convenience method like "createLogin()" in a test utility that is deployed with shrink wrap maybe).
Which option do you recommend or is there a third one that I'm missing?
Cheers,Nils
_______________________________________________ keycloak-user mailing list keycloak-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/keycloak-user