}
// In case of failures we print out "load" messages, the main junit thread is expected to
// test that the failures variable is 0.
RecordId recordId = repository.getIdGenerator().fromBytes(event.getRow());
try {
RecordEvent recordEvent = new RecordEvent(event.getPayload(), idGenerator);
if (recordEvent.getType().equals(RecordEvent.Type.INDEX)) {
log.debug("Ignoring incoming re-index event for message verification");
return;
}
if (expectedEvents.isEmpty()) {
System.err
.println("No events are expected, but we just got event " + recordEvent.toJson() + " on " + recordId);
failures++;
return;
}
Pair<RecordId, RecordEvent> expectedPair = expectedEvents.remove(0);
RecordId expectedId = expectedPair.getV1();
RecordEvent expectedEvent = expectedPair.getV2();
if (expectedEvent == null) {
failures++;
printSomethingLoad();