- JDK 17
- Maven 3.9 or newer
- Docker Desktop or another Docker-compatible engine
Testcontainers starts isolated PostgreSQL 16 + pgvector, Redis 7, and
RabbitMQ containers automatically. Do not start docker compose before the
test matrix unless you also want the long-running development stack.
Run the fast unit suite:
cd backend
mvn testRun unit tests followed by every *IT.java integration test:
cd backend
mvn verify -PfailsafeRun one integration-test class while iterating:
cd backend
mvn verify -Pfailsafe -Dit.test=WorkflowOrchestratorITGenerate coverage and enforce the RFC-001 60% line-coverage gates for the
workflow package, RAG package, and StockAiAnalysisService:
cd backend
mvn verify -Pjacoco
open target/site/jacoco/index.htmlThe complete matrix should finish comfortably inside the eight-minute CI budget. The first run can be slower while Docker downloads images.
Testcontainers intentionally removes its database when Maven exits. For an
interactive database that remains available, start the development PostgreSQL
service and open psql inside it:
docker compose up -d postgres
docker compose exec postgres psql -U finsight -d finsightUseful commands inside psql:
\dt
SELECT * FROM flyway_schema_history ORDER BY installed_rank;
SELECT id, status, stage, fencing_token FROM workflow_tasks ORDER BY updated_at DESC;
SELECT id, company_symbol, chunk_index FROM document_chunks LIMIT 20;
Stop the development database with docker compose stop postgres. Use
docker compose down -v only when you intentionally want to delete its local
volume and all stored development data.
- Confirm Docker is reachable with
docker info. - Rerun a failure using
-Dit.test=ClassNameand inspectbackend/target/failsafe-reports/. - Docker Engine 29 requires API version 1.44 or newer. The test resources pin
this compatible client API in
docker-java.propertiesfor the currently managed Testcontainers version. - Container ports are random. Always use the dynamic properties supplied by the abstract integration-test base classes instead of hard-coded ports.