A small sample project, containing a service
module (representing the system under test) and a citrus
module, containing the citrus tests for the service.
The project uses Java 17, so a Java 17 JDK should be installed.
The services are deployed with docker compose
, hence a working docker setup is recommended. For the deploymeht via docker compose
we need internet connection to load the base image used.
When deployed,
-
the
service
is exposed underhttp://localhost:8080
, and has opened debug port5006
(also forwarded tolocalhost
) -
citrus
is exposed underhttp://localhost:4567
, and has opened debug port5007
(again, also forwarded tolocalhost
).
Citrus tests are not started automatically, but must be triggered explicitly.
The citrus tests are written with testng.
From the project root, build the project with the profile build-test-jar
active:
$ mvnw -Pbuild-test-jar package
When the build is completed, start the compose environment:
$ cd local-deployment
$ docker compose up -d
We verify that both services are running:
service
and citrus
are running in docker$ curl http://localhost:8080/q/health/ready
{
"status": "UP",
"checks": [
]
}%
$ curl http://localhost:4567/health
{ "status": "UP" }%
We just need to execute the goal verify
on module citrus
:
$ ./mvnw -pl citrus verify
In this scenario, we trigger the citrus container, running in docker, to execute the tests.
We execute the verify`goal on module `citrus
with profile trigger-citrus-remote
activated:
citrus-maven-remote-plugin
$ ./mvnw -Ptrigger-citrus-remote -pl citrus verify