-
Notifications
You must be signed in to change notification settings - Fork 155
Support for scenarios to integration test application modules #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
odrotbohm
added a commit
that referenced
this issue
Feb 20, 2023
See the Javadoc of Scenario for details.
odrotbohm
added a commit
that referenced
this issue
Feb 20, 2023
See the Javadoc of Scenario for details.
Find a bit of preliminary documentation here. |
odrotbohm
added a commit
that referenced
this issue
Feb 20, 2023
odrotbohm
added a commit
that referenced
this issue
Feb 20, 2023
odrotbohm
added a commit
that referenced
this issue
Feb 20, 2023
odrotbohm
added a commit
that referenced
this issue
Feb 20, 2023
odrotbohm
added a commit
that referenced
this issue
Feb 23, 2023
Move the registration of cleanup callbacks to the intermediate When type to avoid overloads of Scenario.stimulate(…). Also, to prevent multiple lambda-style parameters for ….stimulate(…) as they don't distinguish nice on the declaration side. Removed the varargs from ….publish(…) methods and wait for the actual request to add support for preparing, in transaction callbacks (potentially to be introduced as ….prepare(…) method). The default acceptance criteria for state change expectations now also considers a boolean true as concluding method result.
This looks very promising, can't wait to try it! Is it already included in a snapshot version? |
Available in 0.4 / 0.4.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Working with application modules, and ones driven by
@ApplicationEventListener
s in particular introduces a couple of challenges:TransactionOperations
andApplicationEventPublisher
.While all of this can be assembled using already existing abstractions, it would be nice if there was a way to formulate such scenarios in a readable API. An event-based scenario could look something like this:
<1> Stimulates the system through an event publication.
<2> (Optional) Customizations of the execution
<3> Define expectation by describing the event that's supposed to appear, optionally defining filters.
<4> (Optional) Formulate additional verifications. The most simple variant is
toArrive()
.Alternatively, the scenario could be described based on state changes.
<1> Would trigger some method of a module's service or the like. Access
TransactionOperations
to make sure that transactional event listeners are triggered for events potentially published during the operation.<2> Inspect some state on the module. By default, accept a non-null (non-empty in the case of an
Optional
) as concluding.<3> Additional verifications based on the value returned by the stimulus or expected changed state (out of <2>).
The text was updated successfully, but these errors were encountered: