Setting EventBus in TestFixture Does Not Update Event Bus in FixtureExecutionResultImpl

Our code uses an autowired EventBus and I am wondering how to make it so that an AnnotatedSagaTestFixture can verify events on it (through .expectPublishedEvents())

AnnotatedSagaTestFixture allows for its event bus to be set via registerResource() but it seems like the event bus that fixtureExecutionResult’s event validator uses to verify events still uses AnnotatedSagaTestFixture’s constructor event bus, the original SimpleEventBus.

How does one get a saga test fixture to update the event bus so that FixtureExecutionResultImpl uses it to verify against?

Hi @Yaroon, and welcome to the forum! :slight_smile:

Concerning your question, the answer is rather straightforward.
Although you can register an EventBus resource with the SagaTestFixture, this does not impact the EventBus used in the FixtureExecutionResultImpl.

However, I am not fully certain why you need this.
The SagaTestFixture already builds a SimpleEventBus and passes it to the FixtureExecutionResultImpl to construct an EventValidator.
Hence, published events can be validated out of the box, without you being required to register the EventBus yourself.

So, would you be able to explain why you require the ability to register a custom EventBus with the SagaTestFixture?