The wrapper makes easy test process for kafka-streams
This project is maintained by besok
StreamsTestHelper makes easy test process for kafka-streams. It based on TopologyTestDriver and work in case if you need kafka streams, avro classes as model and schema-registry.
testCompile("ru.ru.besok.kafka.streams:streams-test-support:0.1")
List<ConsumerRecord<byte[], byte[]>> records = StreamsTestHelper
.run(builder, properties)
.sender("topic", () -> null, () -> newValue())
.generate(10);
StreamsTestHelper
.run(builder, properties)
.sender("topic", () -> null, () -> newValue())
.send(10);
ProducerRecord<Key, Value> record = StreamsTestHelper
.run(builder, properties)
.sender("topic", () -> null, () -> newValue())
.send()
.pipe()
.receiver("topic-next", Key.class, Value.class)
.read();
Optional<Value> record = StreamsTestHelper
.run(builder, properties)
.sender("topic", () -> null, () -> newValue())
.send(10)
.pipe()
.keeper("topic-next",Key.class,Value.class)
.find(new Key("1"));
List<ConsumerRecord<byte[], byte[]>> records = StreamsTestHelper
.run(builder, properties)
.sender("topic", Key.class, Value.class)
.generate(10);
List<ConsumerRecord<byte[], byte[]>> records = StreamsTestHelper
.run(builder, properties)
.sender("topic", Key.class, Value.class)
.rule(
field -> field.name().equals("field"),
v -> 10, false)
.send(10);
List<ConsumerRecord<byte[], byte[]>> records = StreamsTestHelper
.run(builder, properties)
.sender("topic", Key.class, Value.class)
.rule(name("field"), constant(10), false)
.send(10);
This project is licensed under the terms of the MIT license.