Skip to content

What is the preferred way to test event producers (Scenario vs AsseriblePublishedEvents)? #385

Answered by odrotbohm
nikimicallef asked this question in Q&A
Discussion options

You must be logged in to vote

We generally recommend Scenario as it provides a simplified, more guided API on how to set up a test scenario. It also deals with challenges stemming from the potentially asynchronous integration by using Awaitility under the hood. This is especially helpful in case you test cascading, asynchronously handled events.

AssertablePublishedEvents on the other hand, requires a bit more ceremony, predates Scenario and is used by that under the covers. Using APE might feel more natural to folks familiar with general AssertJ assertions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nikimicallef
Comment options

Answer selected by nikimicallef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants