use of io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaFetchFlushExFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldGenerateFetchFlushExtensionWithLatestOffset.
@Test
public void shouldGenerateFetchFlushExtensionWithLatestOffset() {
byte[] build = KafkaFunctions.flushEx().typeId(0x01).fetch().partition(0, 1L, 1L).build().build();
DirectBuffer buffer = new UnsafeBuffer(build);
KafkaFlushExFW flushEx = new KafkaFlushExFW().wrap(buffer, 0, buffer.capacity());
assertEquals(0x01, flushEx.typeId());
final KafkaFetchFlushExFW fetchFlushEx = flushEx.fetch();
final KafkaOffsetFW partition = fetchFlushEx.partition();
assertEquals(0, partition.partitionId());
assertEquals(1L, partition.partitionOffset());
assertEquals(1L, partition.latestOffset());
}
use of io.aklivity.zilla.specs.binding.kafka.internal.types.stream.KafkaFetchFlushExFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldGenerateFetchFlushExtension.
@Test
public void shouldGenerateFetchFlushExtension() {
byte[] build = KafkaFunctions.flushEx().typeId(0x01).fetch().partition(0, 1L).build().build();
DirectBuffer buffer = new UnsafeBuffer(build);
KafkaFlushExFW flushEx = new KafkaFlushExFW().wrap(buffer, 0, buffer.capacity());
assertEquals(0x01, flushEx.typeId());
final KafkaFetchFlushExFW fetchFlushEx = flushEx.fetch();
final KafkaOffsetFW partition = fetchFlushEx.partition();
assertEquals(0, partition.partitionId());
assertEquals(1L, partition.partitionOffset());
}
Aggregations