Search in sources :

Example 21 with InternalMockProcessorContext

use of org.apache.kafka.test.InternalMockProcessorContext in project apache-kafka-on-k8s by banzaicloud.

the class ChangeLoggingKeyValueBytesStoreTest method before.

@Before
public void before() {
    final NoOpRecordCollector collector = new NoOpRecordCollector() {

        @Override
        public <K, V> void send(final String topic, K key, V value, Integer partition, Long timestamp, Serializer<K> keySerializer, Serializer<V> valueSerializer) {
            sent.put(key, value);
        }
    };
    context = new InternalMockProcessorContext(TestUtils.tempDirectory(), Serdes.String(), Serdes.Long(), collector, new ThreadCache(new LogContext("testCache "), 0, new MockStreamsMetrics(new Metrics())));
    context.setTime(0);
    store.init(context, store);
}
Also used : MockStreamsMetrics(org.apache.kafka.streams.processor.internals.MockStreamsMetrics) Metrics(org.apache.kafka.common.metrics.Metrics) NoOpRecordCollector(org.apache.kafka.test.NoOpRecordCollector) LogContext(org.apache.kafka.common.utils.LogContext) MockStreamsMetrics(org.apache.kafka.streams.processor.internals.MockStreamsMetrics) InternalMockProcessorContext(org.apache.kafka.test.InternalMockProcessorContext) Serializer(org.apache.kafka.common.serialization.Serializer) Before(org.junit.Before)

Aggregations

InternalMockProcessorContext (org.apache.kafka.test.InternalMockProcessorContext)21 LogContext (org.apache.kafka.common.utils.LogContext)14 NoOpRecordCollector (org.apache.kafka.test.NoOpRecordCollector)14 Metrics (org.apache.kafka.common.metrics.Metrics)13 Before (org.junit.Before)12 MockStreamsMetrics (org.apache.kafka.streams.processor.internals.MockStreamsMetrics)11 Test (org.junit.Test)8 Serializer (org.apache.kafka.common.serialization.Serializer)5 File (java.io.File)4 ArrayList (java.util.ArrayList)4 ProducerRecord (org.apache.kafka.clients.producer.ProducerRecord)4 StreamsConfig (org.apache.kafka.streams.StreamsConfig)3 StateStore (org.apache.kafka.streams.processor.StateStore)3 ProcessorRecordContext (org.apache.kafka.streams.processor.internals.ProcessorRecordContext)3 HashMap (java.util.HashMap)2 Properties (java.util.Properties)2 Bytes (org.apache.kafka.common.utils.Bytes)2 MockTime (org.apache.kafka.common.utils.MockTime)2 RecordCollector (org.apache.kafka.streams.processor.internals.RecordCollector)2 LinkedHashMap (java.util.LinkedHashMap)1