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 Summary

    Modifier and Type
    Method
    Description
    Asserts that the command execution failed (an exception was thrown).
    Asserts that the command execution succeeded (no exception was thrown).
  • Method Details

    • succeeds

      Asserts that the command execution succeeded (no exception was thrown). Returns a ExpectDsl.Succeeding interface for further assertions on the result, state, and published events.
      Returns:
      a ExpectDsl.Succeeding interface for success-path assertions
      Throws:
      AssertionError - if the command execution threw an exception
    • fails

      Asserts that the command execution failed (an exception was thrown). Returns a ExpectDsl.Failing interface for assertions on the exception type and precondition violations.
      Returns:
      a ExpectDsl.Failing interface for failure-path assertions
      Throws:
      AssertionError - if the command execution succeeded