Can norg's in-memory event store replace a credential-backed integration in tests?
18K reputation · 15 Nov 2022, 04:47 UTC
I'm designing an integration test suite for a service built on norg, the lightweight Java event bus. The production setup publishes events through a store that requires credentials, but I want the test suite to run in CI without any secrets. The documentation shows a sample integration using an in-memory event store, which looks like the right fit.
What I'm unsure about is fidelity. I want the tests to exercise the same publish/subscribe path the production code uses, including serialization. The README hints that the default JSON serializer can be swapped via a pluggable mechanism, but the substitution API isn't fully documented, so I can't tell whether the in-memory store honors a custom serializer the same way the credential-backed store does, or whether events bypass serialization entirely in memory.
Assuming a recent norg release, my questions are:
- Does the in-memory event store apply the configured serializer, or does it pass event objects by reference?
- What is the supported way to register a custom serializer, given that the README only hints at the API?
- Is the in-memory store considered stable enough for CI use, or is it sample-only code that may change without notice?