EventStreamId eventId = new EventStreamId(UUID.randomUUID().toString());
this.eventStore.appendWith(eventId, events);
EventStream eventStream = this.eventStore.fullEventStreamFor(eventId);
assertEquals(3, eventStream.version());
assertEquals(3, eventStream.events().size());
events.clear();
events.add(new TestableDomainEvent(4, "Name: " + 4));
this.eventStore.appendWith(eventId.withStreamVersion(4), events);
eventStream = this.eventStore.fullEventStreamFor(eventId);
assertEquals(4, eventStream.version());
assertEquals(4, eventStream.events().size());
for (int idx = 1; idx <= 4; ++idx) {
DomainEvent domainEvent = eventStream.events().get(idx - 1);
assertEquals(idx, ((TestableDomainEvent) domainEvent).id());
}
}