Source:
private StreamTask createStreamsTask(final StreamsConfig streamsConfig, final MockClientSupplier clientSupplier, final ProcessorTopology topology, final TaskId taskId) { final Metrics metrics = new Metrics(); final LogContext logContext = new LogContext("test-stream-task "); final Set<TopicPartition> partitions = Collections.singleton(new TopicPartition(topicName, taskId.partition)); final ProcessorStateManager stateManager = new ProcessorStateManager( taskId, Task.TaskType.ACTIVE, EXACTLY_ONCE.equals(streamsConfig.getString(StreamsConfig.PROCESSING_GUARANTEE_CONFIG)), logContext, stateDirectory, new StoreChangelogReader( new MockTime(), streamsConfig, logContext, clientSupplier.restoreConsumer, new MockStateRestoreListener()), topology.storeToChangelogTopic(), partitions); final StreamThread.ProcessingMode processingMode; final String eosConfig = streamsConfig.getString(StreamsConfig.PROCESSING_GUARANTEE_CONFIG); if (StreamsConfig.EXACTLY_ONCE.equals(eosConfig)) { processingMode = StreamThread.ProcessingMode.EXACTLY_ONCE_ALPHA; } else if (StreamsConfig.EXACTLY_ONCE_BETA.equals(eosConfig)) { processingMode = StreamThread.ProcessingMode.EXACTLY_ONCE_BETA; } else { processingMode = StreamThread.ProcessingMode.AT_LEAST_ONCE; } final RecordCollector recordCollector = new RecordCollectorImpl( logContext, taskId, new StreamsProducer( clientSupplier.getProducer(new HashMap<>()), processingMode, logContext ), streamsConfig.defaultProductionExceptionHandler(), new MockStreamsMetrics(metrics)); return new StreamTask( taskId, partitions, topology, clientSupplier.consumer, streamsConfig, new MockStreamsMetrics(metrics), stateDirectory, null, new MockTime(), stateManager, recordCollector); }

Target:
private StreamTask createStreamsTask(final StreamsConfig streamsConfig, final MockClientSupplier clientSupplier, final ProcessorTopology topology, final TaskId taskId) { final Metrics metrics = new Metrics(); final LogContext logContext = new LogContext("test-stream-task "); final Set<TopicPartition> partitions = Collections.singleton(new TopicPartition(topicName, taskId.partition)); final ProcessorStateManager stateManager = new ProcessorStateManager( taskId, Task.TaskType.ACTIVE, EXACTLY_ONCE.equals(streamsConfig.getString(StreamsConfig.PROCESSING_GUARANTEE_CONFIG)), logContext, stateDirectory, new StoreChangelogReader( new MockTime(), streamsConfig, logContext, clientSupplier.restoreConsumer, new MockStateRestoreListener()), topology.storeToChangelogTopic(), partitions); final StreamThread.ProcessingMode processingMode; if (StreamThread.eosAlphaEnabled(streamsConfig)) { processingMode = StreamThread.ProcessingMode.EXACTLY_ONCE_ALPHA; } else if (StreamThread.eosBetaEnabled(streamsConfig)) { processingMode = StreamThread.ProcessingMode.EXACTLY_ONCE_BETA; } else { processingMode = StreamThread.ProcessingMode.AT_LEAST_ONCE; } final RecordCollector recordCollector = new RecordCollectorImpl( logContext, taskId, new StreamsProducer( clientSupplier.getProducer(new HashMap<>()), processingMode, logContext ), streamsConfig.defaultProductionExceptionHandler(), new MockStreamsMetrics(metrics)); return new StreamTask( taskId, partitions, topology, clientSupplier.consumer, streamsConfig, new MockStreamsMetrics(metrics), stateDirectory, null, new MockTime(), stateManager, recordCollector); }