protected void expects(int expectedRecordsCount) { assert latch.getCount() == 0; this.latch.countUp(expectedRecordsCount); }
protected void await(long timeout, TimeUnit unit) throws InterruptedException { if (!latch.await(timeout, unit)) { fail("Consumer is still expecting " + latch.getCount() + " records, as it received only " + records.size()); } } }
@Override public void accept(ChangeEvent event) { final SourceRecord record = event.getRecord(); if ( ignoreTopic(record.topic()) ) { return; } if (latch.getCount() == 0) { if (ignoreExtraRecords) { records.add(record); } else { fail("received more events than expected"); } } else { records.add(record); latch.countDown(); } }
protected void expects(int expectedRecordsCount) { assert latch.getCount() == 0; this.latch.countUp(expectedRecordsCount); }
protected void await(long timeout, TimeUnit unit) throws InterruptedException { if (!latch.await(timeout, unit)) { fail("Consumer is still expecting " + latch.getCount() + " records, as it received only " + records.size()); } } }
@Override public void accept(ChangeEvent event) { final SourceRecord record = event.getRecord(); if ( ignoreTopic(record.topic()) ) { return; } if (latch.getCount() == 0) { if (ignoreExtraRecords) { records.add(record); } else { fail("received more events than expected"); } } else { records.add(record); latch.countDown(); } }