use of io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaProduceBeginExFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldGenerateProduceBeginExtension.
@Test
public void shouldGenerateProduceBeginExtension() {
byte[] build = KafkaFunctions.beginEx().typeId(0x01).produce().transaction("transaction").topic("topic").partition(1, 0).build().build();
DirectBuffer buffer = new UnsafeBuffer(build);
KafkaBeginExFW beginEx = new KafkaBeginExFW().wrap(buffer, 0, buffer.capacity());
assertEquals(0x01, beginEx.typeId());
assertEquals(KafkaApi.PRODUCE.value(), beginEx.kind());
final KafkaProduceBeginExFW produceBeginEx = beginEx.produce();
assertEquals("transaction", produceBeginEx.transaction().asString());
assertEquals(1, produceBeginEx.partition().partitionId());
assertEquals("topic", produceBeginEx.topic().asString());
assertEquals(0, produceBeginEx.partition().partitionOffset());
}
Aggregations