Commit Graph
3 Commits
Author SHA1 Message Date
pnoker 74e16bfb30 style: format dc3-common, dc3-driver and dc3-e2e test code 2026-05-15 00:28:35 +08:00
pnoker 9123b480f4 test(e2e): stabilize infrastructure harness 2026-05-14 21:29:08 +08:00
Vickey 69090d1316 test(e2e): cover infrastructure contracts with rest-assured and direct clients
PostgresHypertableIT (2 tests):
  - timescaledb hypertable accepts batched inserts and returns expected aggregates
    (count / avg / min / max via simple SELECT) plus shows up in
    timescaledb_information.hypertables
  - hypertable enforces NOT NULL on the time column at insert time

RabbitDeliveryIT (6 tests):
  - publisher confirm round-trips for routed messages and queue depth = 1
  - mandatory=true unroutable messages return through the basic.return listener
  - manual ack drains the queue exactly once (unacked redelivered, acked stays drained)
  - waitForConfirms with no outstanding publishes completes synchronously
  - exclusive queue rejects a second consumer on the same connection
  - connection factory refuses invalid credentials on the fast path

RestAssuredHarnessIT (4 tests):
  - rest-assured can call a stub HTTP server and decode JSON envelopes (R.ok / R.fail)
  - request body and custom headers (X-DC3-Token) round-trip through assertions
  - RestAssuredConfig can force a JSON parser when the server omits Content-Type
  - response body can be extracted as a raw string for non-shape assertions

The full platform-image-driven user-flow scenarios (login, driver registration,
write point value, gateway 401, cross-tenant isolation, OFFLINE auto-status,
command round-trip, DLX requeue, agentic via WireMock, CSV import, token
rotation) will extend this harness once dc3-center-* and dc3-driver-* publish
immutable image tags suitable for CI. The infrastructure contracts pinned here
lock the assumptions those scenarios will rely on (timescale aggregation,
publisher confirms, rest-assured wiring).

@EnabledIfEnvironmentVariable(DC3_E2E) is now declared on each concrete IT
class because JUnit 5 evaluates the condition on the declared class only — the
abstract base BaseE2eIT comment now spells this out.

Run via DC3_E2E=true mvn -pl dc3-e2e -am verify.
2026-05-14 14:13:37 +08:00