This docker-compose file provides a local testing environment for the TCDI Admin application with all required dependencies.
| Service | Port | Description |
|---|---|---|
| postgres | 5432 | PostgreSQL database for the admin application |
| postgres-interference | 5433 | PostgreSQL database for the interference service |
| eureka | 8761 | Netflix Eureka service registry |
| mock-interference-service | 8090 | MockServer simulating the interference service API |
- Docker and Docker Compose installed
- The admin application built (
mvn install -Dcheckstyle.skip=true -DskipTests)
-
Start the infrastructure:
docker-compose -f docker-compose-test.yml up -d
-
Wait for services to be healthy:
docker-compose -f docker-compose-test.yml ps
-
Run the admin application:
mvn spring-boot:run -pl forms -Dcheckstyle.skip=true \ -Dspring-boot.run.profiles=dev \ -Dspring-boot.run.arguments="--eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/" -
Access the application:
- Admin UI: http://localhost:8080
- Eureka Dashboard: http://localhost:8761
- Navigate to the CSV Datasets section in the admin UI
- Create a new dataset for the "INTERFERENCE" service
- Upload the test CSV file:
forms/src/test/resources/world_industry_interference_2025.csv - Click "Save and Publish"
- The mock service will return a successful response
- Create and publish a dataset
- The job checker runs every minute (
@Scheduled(cron = "0 * * * * *")) - If a job is in PUBLISHING state for longer than
dataset.publishing.timeout.minutes(default: 30), it will be marked as ERROR_IN_PUBLISHING
- Create a dataset and start publishing
- While in PUBLISHING state, a "Cancel Publishing" button should appear
- Click the button to cancel and mark as ERROR_IN_PUBLISHING
- This allows retrying the upload after fixing issues
Configure the timeout for stuck jobs in application.properties or via environment variable:
dataset.publishing.timeout.minutes=30The mock interference service (MockServer) is configured via mockserver-init.json. It simulates:
GET /health- Health check endpointPOST /datasets- Dataset upload (returns PROCESSING status)GET /jobs/code/tcdi-*- Job status check (returns COMPLETED)DELETE /datasets/tcdi-*- Dataset deletionGET /template/download- CSV template downloadGET /dimensions- Get available dimensionsGET /measures- Get available measures
Stop and remove all containers and volumes:
docker-compose -f docker-compose-test.yml down -vCheck if PostgreSQL is healthy:
docker-compose -f docker-compose-test.yml logs postgresEnsure Eureka is running and accessible:
curl http://localhost:8761/actuator/healthCheck MockServer logs:
docker-compose -f docker-compose-test.yml logs mock-interference-serviceThe DatasetClientServiceTest class contains unit tests for the new functionality:
mvn test -pl forms -Dtest=DatasetClientServiceTest -Dcheckstyle.skip=trueTests cover:
- Cancel publishing functionality
- Status transitions (PUBLISHING → PUBLISHED, UNPUBLISHING → DRAFT)
- Error status transitions (PUBLISHING → ERROR_IN_PUBLISHING, UNPUBLISHING → ERROR_IN_UNPUBLISHING)
- Timeout detection for stuck jobs
- Dataset saving based on type (CSV vs Tetsim)