use of org.apache.kafka.streams.errors.ProductionExceptionHandler in project apache-kafka-on-k8s by banzaicloud.
the class StreamTaskTest method shouldFlushRecordCollectorOnFlushState.
@Test
public void shouldFlushRecordCollectorOnFlushState() {
final AtomicBoolean flushed = new AtomicBoolean(false);
final StreamsMetrics streamsMetrics = new MockStreamsMetrics(new Metrics());
final StreamTask streamTask = new StreamTask(taskId00, partitions, topology, consumer, changelogReader, config, streamsMetrics, stateDirectory, null, time, producer) {
@Override
RecordCollector createRecordCollector(final LogContext logContext, final ProductionExceptionHandler exHandler) {
return new NoOpRecordCollector() {
@Override
public void flush() {
flushed.set(true);
}
};
}
};
streamTask.flushState();
assertTrue(flushed.get());
}
Aggregations