Re: Testing a DoFn with a Create.of() and a KafkaRecord

2020-12-09 Thread Kaymak, Tobias
The Pipeline p = TestPipeline.create(); p.getCoderRegistry().registerCoderForClass(KafkaRecord.class, KafkaRecordCoder.of(StringUtf8Coder.of(),StringUtf8Coder.of())); approach works, I just forgot to generate fake headers (passed null to the constructor). :) On Wed, Dec 9, 2020 at

Testing a DoFn with a Create.of() and a KafkaRecord

2020-12-09 Thread Kaymak, Tobias
According to the documentation [0] the Create.of() works only for "Standard" types, but shouldn't it in theory also work for non-standard types when the Coder is specified? I want to test a DoFn that receives KafkaRecord as an input: KafkaRecord input = new KafkaRecord(topic, partition, offset