Search in sources :

Example 1 with KafkaBootstrapBeginExFW

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

the class KafkaFunctionsTest method shouldGenerateBootstrapBeginExtension.

@Test
public void shouldGenerateBootstrapBeginExtension() {
    byte[] build = KafkaFunctions.beginEx().typeId(0x01).bootstrap().topic("topic").build().build();
    DirectBuffer buffer = new UnsafeBuffer(build);
    KafkaBeginExFW beginEx = new KafkaBeginExFW().wrap(buffer, 0, buffer.capacity());
    assertEquals(0x01, beginEx.typeId());
    assertEquals(KafkaApi.BOOTSTRAP.value(), beginEx.kind());
    final KafkaBootstrapBeginExFW bootstrapBeginEx = beginEx.bootstrap();
    assertEquals("topic", bootstrapBeginEx.topic().asString());
}
Also used : DirectBuffer(org.agrona.DirectBuffer) KafkaBootstrapBeginExFW(io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaBootstrapBeginExFW) 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 KafkaBootstrapBeginExFW (io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaBootstrapBeginExFW)1 DirectBuffer (org.agrona.DirectBuffer)1 UnsafeBuffer (org.agrona.concurrent.UnsafeBuffer)1 Test (org.junit.Test)1