use of org.apache.kafka.test.MockTimestampExtractor in project apache-kafka-on-k8s by banzaicloud.
the class KStreamBuilderTest method shouldAddTimestampExtractorToTableWithKeyValSerdePerSource.
@Test
public void shouldAddTimestampExtractorToTableWithKeyValSerdePerSource() {
builder.table(null, new MockTimestampExtractor(), null, null, "topic", "store");
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 KStreamBuilderTest method shouldAddTimestampExtractorToStreamWithKeyValSerdePerSource.
@Test
public void shouldAddTimestampExtractorToStreamWithKeyValSerdePerSource() {
builder.stream(new MockTimestampExtractor(), null, null, "topic");
final ProcessorTopology processorTopology = builder.build(null);
for (final SourceNode sourceNode : processorTopology.sources()) {
assertThat(sourceNode.getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
}
use of org.apache.kafka.test.MockTimestampExtractor in project apache-kafka-on-k8s by banzaicloud.
the class InternalTopologyBuilderTest method shouldAddTimestampExtractorPerSource.
@SuppressWarnings("unchecked")
@Test
public void shouldAddTimestampExtractorPerSource() throws Exception {
builder.addSource(null, "source", 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 TopologyBuilderTest method shouldAddTimestampExtractorWithOffsetResetAndPatternPerSource.
@Test
public void shouldAddTimestampExtractorWithOffsetResetAndPatternPerSource() {
final TopologyBuilder builder = new TopologyBuilder();
final Pattern pattern = Pattern.compile("t.*");
builder.addSource(null, new MockTimestampExtractor(), "source", 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 apache-kafka-on-k8s by banzaicloud.
the class TopologyBuilderTest method shouldAddTimestampExtractorWithOffsetResetAndKeyValSerdesPerSource.
@Test
public void shouldAddTimestampExtractorWithOffsetResetAndKeyValSerdesPerSource() {
final TopologyBuilder builder = new TopologyBuilder();
builder.addSource(null, "source", new MockTimestampExtractor(), null, null, "topic");
final ProcessorTopology processorTopology = builder.build(null);
assertThat(processorTopology.source("topic").getTimestampExtractor(), instanceOf(MockTimestampExtractor.class));
}
Aggregations