The documentation seems to suggest that I should prefer using EventTemplate to publish events. This works perfectly, but adds a small amount of friction to tests: no EventTemplate is injected by AnnotatedSagaTestFixture, so if I use EventTemplate in a saga class, in my test code I end up having to register a mock instance and test for calls to its publishEvent() method.
If I use the EventBus in my saga instead and handle wrapping my own objects in GenericEventMessage, my saga tests can use the fixture’s expectPublishedEvents() method to verify that the right events were sent, which feels cleaner.
Is this just a case of EventTemplate being a recent addition and the test fixture code not having caught up yet, or is the fixture’s API intentionally hinting to me that I should be directly calling the EventBus? If the latter, what’s the disadvantage of EventTemplate in the context of a saga?