@Test @DisplayName("propagate changes to entity when phase is propagated") void propagateChangesToEntityOnCommit() { E entity = createEntity(); S stateBeforePhase = entity.state(); Version versionBeforePhase = entity.version(); Transaction<I, E, S, B> tx = createTx(entity); Event event = withMessage(createEventMessage()); applyEvent(tx, event); S modifiedState = entity.state(); Version modifiedVersion = entity.version(); assertThat(modifiedState) .isNotEqualTo(stateBeforePhase); assertThat(modifiedVersion) .isNotEqualTo(versionBeforePhase); }
final Version version() { return version; }
Transaction { final Version version() { return version; } }
Transaction { final Version version() { return version; } protected  Transaction(E entity); protected  Transaction(E entity, S state, Version version); }
Transaction { final Version version() { return version; } 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 Version version() { return version; } 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);  }