Search in sources :

Example 1 with KafkaMetaBeginExFW

use of io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaMetaBeginExFW in project zilla by aklivity.

the class KafkaFunctionsTest method shouldGenerateMetaBeginExtension.

@Test
public void shouldGenerateMetaBeginExtension() {
    byte[] build = KafkaFunctions.beginEx().typeId(0x01).meta().topic("topic").build().build();
    DirectBuffer buffer = new UnsafeBuffer(build);
    KafkaBeginExFW beginEx = new KafkaBeginExFW().wrap(buffer, 0, buffer.capacity());
    assertEquals(0x01, beginEx.typeId());
    assertEquals(KafkaApi.META.value(), beginEx.kind());
    final KafkaMetaBeginExFW metaBeginEx = beginEx.meta();
    assertEquals("topic", metaBeginEx.topic().asString());
}
Also used : DirectBuffer(org.agrona.DirectBuffer) KafkaMetaBeginExFW(io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaMetaBeginExFW) UnsafeBuffer(org.agrona.concurrent.UnsafeBuffer) KafkaBeginExFW(io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaBeginExFW) Test(org.junit.Test)

Aggregations

KafkaBeginExFW (io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaBeginExFW)1 KafkaMetaBeginExFW (io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaMetaBeginExFW)1 DirectBuffer (org.agrona.DirectBuffer)1 UnsafeBuffer (org.agrona.concurrent.UnsafeBuffer)1 Test (org.junit.Test)1