use of org.apache.kafka.test.MockTimestampExtractor in project kafka by apache.
the class InternalStreamsBuilderTest method ktableShouldUseProvidedTimestampExtractor.
@Test
public void ktableShouldUseProvidedTimestampExtractor() {
final ConsumedInternal<String, String> consumed = new ConsumedInternal<>(Consumed.with(new MockTimestampExtractor()));
builder.table("topic", consumed, materialized);
builder.buildAndOptimizeTopology();
final ProcessorTopology processorTopology = builder.internalTopologyBuilder.rewriteTopology(new StreamsConfig(StreamsTestUtils.getStreamsConfig(APP_ID))).buildTopology();
assertThat(processorTopology.source("topic").getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
use of org.apache.kafka.test.MockTimestampExtractor in project kafka by apache.
the class InternalTopologyBuilderTest method shouldAddTimestampExtractorWithPatternPerSource.
@Test
public void shouldAddTimestampExtractorWithPatternPerSource() {
final Pattern pattern = Pattern.compile("t.*");
builder.addSource(null, "source", new MockTimestampExtractor(), null, null, pattern);
final ProcessorTopology processorTopology = builder.rewriteTopology(new StreamsConfig(StreamsTestUtils.getStreamsConfig())).buildTopology();
assertThat(processorTopology.source(pattern.pattern()).getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
Aggregations