}
@Test
public void fetchAggregateStreamWorks() throws SQLException {
deleteCurrentPersistentEvents();
DomainEventMessage dem = new GenericDomainEventMessage(aggregateIdentifier, 122, "apayload");
testSubject.persistEvent(aggregateType, dem, getPayload(), getMetaData());
DomainEventMessage dem2 = new GenericDomainEventMessage(aggregateIdentifier, 123, "apayload2");
testSubject.persistEvent(aggregateType, dem2, getPayload(), getMetaData());
Iterator<? extends SerializedDomainEventData> stream = testSubject.fetchAggregateStream(aggregateType, "agg1", 0, 1);
assertTrue(stream.hasNext());
SerializedDomainEventData next = stream.next();
assertEquals(dem.getSequenceNumber(), next.getSequenceNumber());
assertTrue(stream.hasNext());
SerializedDomainEventData next1 = stream.next();
assertEquals(dem2.getSequenceNumber(), next1.getSequenceNumber());
assertFalse(stream.hasNext());
}