Context
PR #281 introduced monitoring integration tests that validate the /metrics (Prometheus) and /api/v1/health endpoints. A reviewer noted that the JSON REST API endpoints are only covered by unit tests in http_server.rs but lack integration-level validation against a running topology.
Goal
Extend test coverage to exercise the full JSON REST API surface in both unit tests and integration tests, ensuring the responses contain correct, meaningful data from live SV2 topologies.
Endpoints needing integration tests
All JSON API endpoints (/, /api/v1/global, /api/v1/server, /api/v1/server/channels, /api/v1/clients, /api/v1/clients/{id}, /api/v1/clients/{id}/channels, /api/v1/sv1/clients, /api/v1/sv1/clients/{id}) currently have unit tests only. /api/v1/health and /metrics are already covered by integration tests.
Suggested approach
- Add integration tests to
monitoring_integration.rs that reuse existing topology setups and make HTTP requests to each JSON endpoint, asserting on status codes and key fields.
- Add assertion helpers to
prometheus_metrics_assertions.rs for JSON API responses.
- Strengthen unit tests in
http_server.rs to cover edge cases (pagination boundaries, invalid path params, partial data sources).
Acceptance criteria
- Every JSON API endpoint has at least one integration test against a live topology
- Unit tests cover error/edge cases for pagination and missing data
- All existing tests continue to pass
cargo fmt, cargo clippy -D warnings clean
Context
PR #281 introduced monitoring integration tests that validate the
/metrics(Prometheus) and/api/v1/healthendpoints. A reviewer noted that the JSON REST API endpoints are only covered by unit tests inhttp_server.rsbut lack integration-level validation against a running topology.Goal
Extend test coverage to exercise the full JSON REST API surface in both unit tests and integration tests, ensuring the responses contain correct, meaningful data from live SV2 topologies.
Endpoints needing integration tests
All JSON API endpoints (
/,/api/v1/global,/api/v1/server,/api/v1/server/channels,/api/v1/clients,/api/v1/clients/{id},/api/v1/clients/{id}/channels,/api/v1/sv1/clients,/api/v1/sv1/clients/{id}) currently have unit tests only./api/v1/healthand/metricsare already covered by integration tests.Suggested approach
monitoring_integration.rsthat reuse existing topology setups and make HTTP requests to each JSON endpoint, asserting on status codes and key fields.prometheus_metrics_assertions.rsfor JSON API responses.http_server.rsto cover edge cases (pagination boundaries, invalid path params, partial data sources).Acceptance criteria
cargo fmt,cargo clippy -D warningsclean