The integration-tests for OSIAM.
You can run the integration-tests on your machine, you only need to install java and docker, and configure docker.
The tests will fetch the snapshot dependencies from OSS JFrog or you clone the
following repos and install them with ./mvnw clean install
https://github.com/osiam/connector4java
https://github.com/osiam/osiam
The integration-tests use the docker-maven-plugin,
which utilizes docker-java.
In order to run the integration-tests, you need to ensure that your docker daemon
listens on the TCP port 2375.
How exactly this works depends on your operating system, but
echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock' >> /etc/default/docker
is a good starting point. For further information, please refer to the docker-java README and the official Docker documentation.
To run the integration-tests against
postgres (default)
$ ./mvnw clean verify
mysql
$ ./mvnw clean verify -P mysql
To run the integration-tests in your IDE against the started containers
postgres (default)
$ ./mvnw clean pre-integration-test
mysql
$ ./mvnw clean pre-integration-test -P mysql
If you are on mac or want to run them in a VM, just checkout the OSIAM vagrant VM. It's pretty easy to setup. Just run the above mentioned command in the OSIAM vagrant VM and then the integration-tests against the VM.
If you want to use the integration tests to debug code in other OSIAM projects,
you need to enable the debug profile. Please remember that this overrides
the active-by-default setting for the postgres profile, so if you want to use
it, run it like
$ ./mvnw clean pre-integration-test -P postgres,debug
This changes nothing for the mysql profile, so running
$ ./mvnw clean pre-integration-test -P mysql,debug
is equivalent.
In your IDE containing the project you want to debug, you can now attach the debugger.
Just use the normal remote debugging setup for your IDE and connect to localhost:8000.
Set your breakpoints as usual and run the test in the ITs project.
Your IDE should pop up as soon as the service reaches the breakpoint.
If you like to run the tests against a remote docker host, you nedd to set the following system properties:
Docker:
docker.hostThe URL of the docker daemon. Default:http://localhost:2375
OSIAM:
osiam.host.protocolThe protocol of the OSIAM host. Default:httposiam.hostThe host where OSIAM is running. Default:localhostosiam.portThe port where OSIAM is running. Default:8180osiam.database.hostThe host where the database for OSIAM is running. Default:localhostosiam.database.portThe port where the database for OSIAM is running. Defaults: Postgres:15432, MySQL:13306
Here is an example when docker running in a boot2docker vm:
$ ./mvnw verify -Ddocker.host=https://192.168.99.100:2376 -Dosiam.host=192.168.99.100