Class EventSourcedBehaviorTestKit.CommandResult<Command,​Event,​State>

    • Method Detail

      • command

        public Command command()
        The command that was run.
      • event

        public Event event()
        The first event. It will throw AssertionError if there is no event.
      • eventOfType

        public <E extends Event> E eventOfType​(java.lang.Class<E> eventClass)
        The first event as a given expected type. It will throw AssertionError if there is no event or if the event is of a different type.
      • events

        public java.util.List<Event> events()
        The events that were emitted by the command, and persisted. In many cases only one event is emitted and then it's more convenient to use CommandResult.event or CommandResult.eventOfType.
      • hasNoEvents

        public boolean hasNoEvents()
        true if no events were emitted by the command.
      • state

        public State state()
        The state after applying the events.
      • stateOfType

        public <S extends State> S stateOfType​(java.lang.Class<S> stateClass)
        The state as a given expected type. It will throw AssertionError if the state is of a different type.