Package com.opencqrs.framework.command
Interface ExpectDsl.Outcome
- All Known Implementing Classes:
CommandHandlingTestFixture.Expect
- Enclosing interface:
ExpectDsl
public static interface ExpectDsl.Outcome
Entry point for specifying whether the command execution is expected to succeed or fail. This is the first
decision point after the When phase.
-
Method Details
-
succeeds
ExpectDsl.Succeeding succeeds()Asserts that the command execution succeeded (no exception was thrown). Returns aExpectDsl.Succeedinginterface for further assertions on the result, state, and published events.- Returns:
- a
ExpectDsl.Succeedinginterface for success-path assertions - Throws:
AssertionError- if the command execution threw an exception
-
fails
ExpectDsl.Failing fails()Asserts that the command execution failed (an exception was thrown). Returns aExpectDsl.Failinginterface for assertions on the exception type and precondition violations.- Returns:
- a
ExpectDsl.Failinginterface for failure-path assertions - Throws:
AssertionError- if the command execution succeeded
-