Class Scenario.When.StateChangeResult<S>

java.lang.Object
org.springframework.modulith.test.Scenario.When.StateChangeResult<S>
Enclosing class:
Scenario.When<T>

public class Scenario.When.StateChangeResult<S> extends Object
The result of an expected state change.
Author:
Oliver Drotbohm
  • Constructor Details

    • StateChangeResult

      StateChangeResult(org.springframework.modulith.test.Scenario.When.ExecutionResult<S,T> result)
  • Method Details

    • andVerify

      public void andVerify(Consumer<S> consumer)
      Verifies the state change result using the given Consumer.
      Parameters:
      consumer - must not be null.
    • andVerify

      public void andVerify(BiConsumer<S,T> consumer)
      Verifies the state change result and stimulus result using the given BiConsumer.
      Parameters:
      consumer - must not be null.
    • andVerifyEvents

      public void andVerifyEvents(Consumer<AssertablePublishedEvents> events)
      Verifies the underlying AssertablePublishedEvents.
      Parameters:
      events - must not be null.
    • andExpect

      public <E> Scenario.When<T>.EventResult<E> andExpect(Class<E> eventType)
      Expects an event of the given type to arrive eventually. Use API on the returned Scenario.When.EventResult to specify more detailed expectations and conclude those with a call a flavor of Scenario.When.EventResult.toArrive().
      Type Parameters:
      E - the type of the event
      Parameters:
      eventType - must not be null.
      Returns:
      will never be null.