@Test @DisplayName("set transaction entity version from event context") void setVersionFromEventContext() { E entity = createEntity(); Transaction<I, E, S, B> tx = createTx(entity); Event event = withMessage(createEventMessage()); Version ctxVersion = event.context() .getVersion(); assertThat(ctxVersion) .isNotEqualTo(tx.version()); applyEvent(tx, event); Version modifiedVersion = tx.version(); assertThat(tx.version()) .isEqualTo(modifiedVersion); }
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);  }