ores.cpp.eventing-integration-test
Table of Contents
This page is the node for the ores.cpp.eventing-integration-test
facet of the codegen template library, part of the ores.cpp technical
space. Each archetype below is documented, and holds its mustache
source, in its own linked page — this page is the facet-level
summary and the routing table to them.
Summary
One template: a Catch2 integration test that writes an entity via
its repository and asserts the resulting NATS entity-changed
notification is actually observed on the wire — no mocks, real
Postgres LISTEN/NOTIFY, real NATS. eventing-integration-test
profile.
The ores.cpp.eventing-integration-test facet
Generalises the hand-written proof-of-pattern test
(business_unit_eventing_integration_tests.cpp, see
the task that proved it) into a per-entity archetype: assembles the
same postgres_event_source + event_bus + publish_entity_event
wiring the entity's production event-registrar uses (see
ores.cpp.nats-event-registrar), directly in the test rather than via
a running service process, writes a generated instance through the
entity's repository, and polls a buffered NATS subscription for the
matching notification.
Opt-in, disabled by default — every entity with a repository and
ores.cpp.nats-eventing enabled (the default set) is eligible, but
enabling this facet is a per-entity decision: the generated test
needs its component's tests/CMakeLists.txt to link
ores.eventing.api.lib, ores.eventing.core.lib, and ores.nats.lib
(a one-time, hand-maintained addition — see
ores.refdata.core.tests/CMakeLists.txt for the pattern) and, for any
entity with party_id_from_session set, also
ores.refdata.api.lib=/=ores.refdata.core.lib for party scoping.
Requires a live Postgres + NATS to run (it is a real integration
test, not a unit test) — not something to blanket-enable across
every entity without considering CI cost.
Handles both the flat and C1202-nested (has_identity_group=/
=has_audit_group) entity shapes, branching identically to every
other facet that already does this (mapper, repository, service,
presentation).
Archetypes
| Archetype | Description |
|---|---|
| ores.cpp.eventing-integration-test.nats_integration_test | Write-then-observe-NATS-notification Catch2 test. eventing-integration-test profile. |
See also
- ores.cpp.nats-event-registrar — the production wiring this test replicates directly rather than exercising through a running service.
- ores.cpp.nats-eventing — the changed-event type this test subscribes to.
- ores.cpp — the parent technical space's generated facet/archetype catalogue and shared Mustache conventions.
- Codegen template library — the groups overview.