-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Given serviceA receives an event
And serviceA processes a series of internal events
Then ServiceA produces an external command
how do we monitor this command has been successfully produced in the service tests?
Currently, our test library creates its own subscriber, which is fine for monitoring external events, but as Commands have the SpecificSubscriber property set, the test subscriber will never receive the command, and we cannot verify our service works.
Proposal 1
The external service listens to the synthetic command, and responds with some canned events.
Got problems in here with the DomainUnderTest property having the wrong value, as we are crossing domain boundaries, and also similar problems to the sysnthetic web-api controllers in that that test code for other peoples domains ends up embedded next to our production code.
Proposal 2
We alter PAT to allow a custom or configurable RuleBuilder to be injected. We then leverage that in our service tests so that the test subscriber builds a set of rules in the normal way, except we doesn't have the SpecificSubscriber clauses in there. Thus allowing the test subscriber to receive commands intended for somewhere else.