use of org.apache.kafka.test.MockTimestampExtractor in project apache-kafka-on-k8s by banzaicloud.
the class TopologyBuilderTest method shouldAddTimestampExtractorWithOffsetResetPerSource.
@Test
public void shouldAddTimestampExtractorWithOffsetResetPerSource() {
final TopologyBuilder builder = new TopologyBuilder();
builder.addSource(null, new MockTimestampExtractor(), "source", "topic");
final ProcessorTopology processorTopology = builder.build(null);
assertThat(processorTopology.source("topic").getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
use of org.apache.kafka.test.MockTimestampExtractor in project apache-kafka-on-k8s by banzaicloud.
the class TopologyBuilderTest method shouldAddTimestampExtractorWithOffsetResetAndKeyValSerdesAndPatternPerSource.
@Test
public void shouldAddTimestampExtractorWithOffsetResetAndKeyValSerdesAndPatternPerSource() {
final TopologyBuilder builder = new TopologyBuilder();
final Pattern pattern = Pattern.compile("t.*");
builder.addSource(null, "source", new MockTimestampExtractor(), null, null, pattern);
final ProcessorTopology processorTopology = builder.build(null);
assertThat(processorTopology.source(pattern.pattern()).getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
use of org.apache.kafka.test.MockTimestampExtractor in project kafka by apache.
the class InternalTopologyBuilderTest method shouldAddTimestampExtractorPerSource.
@Test
public void shouldAddTimestampExtractorPerSource() {
builder.addSource(null, "source", new MockTimestampExtractor(), null, null, "topic");
final ProcessorTopology processorTopology = builder.rewriteTopology(new StreamsConfig(StreamsTestUtils.getStreamsConfig())).buildTopology();
assertThat(processorTopology.source("topic").getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
use of org.apache.kafka.test.MockTimestampExtractor in project apache-kafka-on-k8s by banzaicloud.
the class KStreamBuilderTest method shouldAddTimestampExtractorToStreamWithOffsetResetPerSource.
@Test
public void shouldAddTimestampExtractorToStreamWithOffsetResetPerSource() {
builder.stream(null, new MockTimestampExtractor(), null, null, "topic");
final ProcessorTopology processorTopology = builder.build(null);
assertThat(processorTopology.source("topic").getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
use of org.apache.kafka.test.MockTimestampExtractor in project apache-kafka-on-k8s by banzaicloud.
the class InternalStreamsBuilderTest method shouldUseProvidedTimestampExtractor.
@Test
public void shouldUseProvidedTimestampExtractor() throws Exception {
final ConsumedInternal consumed = new ConsumedInternal<>(Consumed.with(new MockTimestampExtractor()));
builder.stream(Collections.singleton("topic"), consumed);
final ProcessorTopology processorTopology = builder.internalTopologyBuilder.build(null);
assertThat(processorTopology.source("topic").getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
Aggregations