Package com.opencqrs.framework.command
Class CommandHandlingTestFixture.Expect
java.lang.Object
com.opencqrs.framework.command.CommandHandlingTestFixture.Expect
- All Implemented Interfaces:
ExpectDsl.Outcome
- Enclosing class:
CommandHandlingTestFixture<C extends Command>
Fluent API helper class encapsulating the results of a
CommandHandler execution for assertion.
Assertions are organized into inner classes implementing the ExpectDsl sub-interfaces:
CommandHandlingTestFixture.Expect.Succeedingfor assertions after successful command executionCommandHandlingTestFixture.Expect.Failingfor assertions after failed command executionCommandHandlingTestFixture.Expect.AllEventsfor non-sequential assertions on all captured eventsCommandHandlingTestFixture.Expect.NextEventsfor cursor-based sequential assertions on captured events
-
Method Details
-
succeeds
Description copied from interface:ExpectDsl.OutcomeAsserts that the command execution succeeded (no exception was thrown). Returns aExpectDsl.Succeedinginterface for further assertions on the result, state, and published events.- Specified by:
succeedsin interfaceExpectDsl.Outcome- Returns:
- a
ExpectDsl.Succeedinginterface for success-path assertions
-
fails
Description copied from interface:ExpectDsl.OutcomeAsserts that the command execution failed (an exception was thrown). Returns aExpectDsl.Failinginterface for assertions on the exception type and precondition violations.- Specified by:
failsin interfaceExpectDsl.Outcome- Returns:
- a
ExpectDsl.Failinginterface for failure-path assertions
-