entityManager.clear();
aggregate1.changeState();
testSubject.appendEvents("test", aggregate1.getUncommittedEvents());
aggregate1.commitEvents();
DomainEventStream actualEventStream = testSubject.readEvents("test", aggregate1.getIdentifier());
List<DomainEventMessage> domainEvents = new ArrayList<DomainEventMessage>();
while (actualEventStream.hasNext()) {
DomainEventMessage next = actualEventStream.next();
domainEvents.add(next);
assertEquals(aggregate1.getIdentifier(), next.getAggregateIdentifier());
}
assertEquals(2, domainEvents.size());