@Test @DisplayName("delegate applying events to transaction when playing") void delegateEventsToTx() { TxPlayingEntity entity = entityWithActiveTx(false); EventPlayingTransaction txMock = (EventPlayingTransaction) entity.transaction(); assertNotNull(txMock); Version v1 = increment(zero()); Event firstEvent = withVersion(v1); Event secondEvent = withVersion(increment(v1)); entity.play(newArrayList(firstEvent, secondEvent)); verifyEventApplied(txMock, firstEvent); verifyEventApplied(txMock, secondEvent); }
@Override public BatchDispatchOutcome play(Iterable<Event> events) { checkNotNull(events); BatchDispatch process = new BatchDispatch(transaction); for (Event event : events) { process.play(event); } return process.summary(); }
TransactionalEventPlayer implements EventPlayer { @Override public BatchDispatchOutcome play(Iterable<Event> events) { checkNotNull(events); BatchDispatch process = new BatchDispatch(transaction); for (Event event : events) { process.play(event); } return process.summary(); } }
TransactionalEventPlayer implements EventPlayer { @Override public BatchDispatchOutcome play(Iterable<Event> events) { checkNotNull(events); BatchDispatch process = new BatchDispatch(transaction); for (Event event : events) { process.play(event); } return process.summary(); } TransactionalEventPlayer(EventPlayingTransaction<?, ?, ?, ?> transaction); }
TransactionalEventPlayer implements EventPlayer { @Override public BatchDispatchOutcome play(Iterable<Event> events) { checkNotNull(events); BatchDispatch process = new BatchDispatch(transaction); for (Event event : events) { process.play(event); } return process.summary(); } TransactionalEventPlayer(EventPlayingTransaction<?, ?, ?, ?> transaction); @Override BatchDispatchOutcome play(Iterable<Event> events); }
TransactionalEventPlayer implements EventPlayer { @Override public BatchDispatchOutcome play(Iterable<Event> events) { checkNotNull(events); BatchDispatch process = new BatchDispatch(transaction); for (Event event : events) { process.play(event); } return process.summary(); } TransactionalEventPlayer(EventPlayingTransaction<?, ?, ?, ?> transaction); @Override BatchDispatchOutcome play(Iterable<Event> events);  }