Hello list,
I was trying to asset assert the correct behaviour of a saga with the AnnotatedSagaTestFixture.
The first implementation was using an injected EventTemplate, but it appears that the fixture does not have an EventTemplate dummy available by default.
As a workaround I resolved by injecting the EventBus and instantiating an EventTemplate on the fly, with this tedious piece of code:
`
@Transient
private transient EventTemplate eventTemplate;
@Autowired
public void setEventBus(EventBus eventBus) {
eventTemplate = new EventTemplate(eventBus);
}
`
At this point I was wondering if this is the best way to publish events from sagas.
Alternatively, is there a correct way to register an EventTemplate with the fixture so that published event will reach the fixture’s EventBus?
Cheers,
Andrea