This module uses Testcontainers to run Open Liberty in a Docker container during tests, providing an isolated and consistent testing environment.
- Docker installed and running
- WAR file built (automatically handled by the build)
./gradlew :grooves-example-javaee:test- Docker Image: Uses
openliberty/open-liberty:full-java17-openj9-ubi - Configuration: Custom
server.xmlwith JAX-RS 2.1, CDI 2.0, EJB Lite 3.2, and other required features - Application Deployment: WAR file is copied to
/config/dropins/for automatic deployment - Cross-platform: Includes Docker configuration for Mac ARM64 systems
- No Local Liberty Installation Required: Tests run in isolated Docker containers
- Better CI/CD Integration: More portable across different environments
- Consistent Testing Environment: Same Liberty version used everywhere
- Parallel Test Friendly: Multiple test runs don't interfere with each other
- Version Flexibility: Easy to test against different Liberty versions by changing the Docker image
build.gradle: Testcontainers dependencies and Docker configurationsrc/test/resources/server.xml: Liberty server configurationsrc/test/groovy/grooves/example/javaee/PatientSpec.groovy: Main test class using Testcontainers