@Test @DisplayName("create phase for each dispatched message") void createPhaseForAppliedEvent() { E entity = createEntity(); Transaction<I, E, S, B> tx = createTx(entity); Event event = withMessage(createEventMessage()); DispatchOutcome outcome = applyEvent(tx, event); assertTrue(outcome.hasSuccess()); assertThat(tx.phases()) .hasSize(1); Phase<I> phase = tx.phases() .get(0); assertThat(phase.messageId()).isEqualTo(event.id()); }
final List<Phase<I>> phases() { return ImmutableList.copyOf(phases); }
Transaction { final List<Phase<I>> phases() { return ImmutableList.copyOf(phases); } }
Transaction { final List<Phase<I>> phases() { return ImmutableList.copyOf(phases); } protected  Transaction(E entity); protected  Transaction(E entity, S state, Version version); }
Transaction { final List<Phase<I>> phases() { return ImmutableList.copyOf(phases); } protected  Transaction(E entity); protected  Transaction(E entity, S state, Version version); final void commitIfActive(); @VisibleForTesting final void commit(); final void setListener(TransactionListener<I> listener); }
Transaction { final List<Phase<I>> phases() { return ImmutableList.copyOf(phases); } protected  Transaction(E entity); protected  Transaction(E entity, S state, Version version); final void commitIfActive(); @VisibleForTesting final void commit(); final void setListener(TransactionListener<I> listener);  }