...
Code Block | ||||
---|---|---|---|---|
| ||||
package org.apache.kafka.streams.test; public class TestInputTopic<K, V> { //TODO Constructors //Methods to pipe single record void pipeInput(V value); void pipeInput(K key, V value); void pipeInput(V value, long timestampMs); void pipeInput(K key, V value, long timestampMs); void pipeInput(K key, V value, Headers headers); void pipeInput(K key, V value, Headers headers, long timestampMs); void pipeKeyValueList(List<KeyValue<K, V>> keyValues); void pipeValueList(List<V> values); void pipeKeyValueList(List<KeyValue<K, V>> keyValues, long startTimestamp, long advanceMs); void pipeValueList(List<V> values, long startTimestamp, long advanceMs); } |
Code Block | ||||
---|---|---|---|---|
| ||||
package org.apache.kafka.streams.test; public class TestOutputTopic<K, V> { //TODO Constructors //Methods to readOutput V readValue(); K readKey(); KeyValue<K, V> readKeyValue(); ProducerRecord<K, V> readRecord(); Map<K, V> readRecordsToMap(); List<KeyValue<K, V>> readRecordsToList(); } |
Proposed Changes
This improvement adds TestInputTopic class which wraps TopologyTestDriver and ConsumerRecordFactory methods as one class to be used to write to Input Topics and TestOutputTopic class which collects TopologyTestDriver reading methods and provide typesafe read methods.
...
Compatibility, Deprecation, and Migration Plan
We are This is only adding new classes. The tests utilizing directly TopologyTestDriver can still be used. There are no compatiblity issuescompatibility issues.
Rejected Alternatives
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.