use of io.aklivity.zilla.specs.binding.kafka.internal.types.OctetsFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldMatchProduceDataExtensionHeaderWithNullValue.
@Test
public void shouldMatchProduceDataExtensionHeaderWithNullValue() throws Exception {
BytesMatcher matcher = KafkaFunctions.matchDataEx().produce().header("name", null).build().build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new KafkaDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0x01).produce(p -> p.timestamp(12345678L).sequence(0).key(k -> k.length(5).value(v -> v.set("match".getBytes(UTF_8)))).headersItem(h -> h.nameLen(4).name(n -> n.set("name".getBytes(UTF_8))).valueLen(-1).value((OctetsFW) null))).build();
assertNotNull(matcher.match(byteBuf));
}
use of io.aklivity.zilla.specs.binding.kafka.internal.types.OctetsFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldMatchFetchDataExtensionNullKey.
@Test
public void shouldMatchFetchDataExtensionNullKey() throws Exception {
BytesMatcher matcher = KafkaFunctions.matchDataEx().fetch().key(null).build().build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new KafkaDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0x01).fetch(f -> f.timestamp(12345678L).partition(p -> p.partitionId(0).partitionOffset(0L)).key(k -> k.length(-1).value((OctetsFW) null)).delta(d -> d.type(t -> t.set(KafkaDeltaType.NONE))).headersItem(h -> h.nameLen(4).name(n -> n.set("name".getBytes(UTF_8))).valueLen(5).value(v -> v.set("value".getBytes(UTF_8))))).build();
assertNotNull(matcher.match(byteBuf));
}
use of io.aklivity.zilla.specs.binding.kafka.internal.types.OctetsFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldMatchMergedDataExtensionHeaderWithNullValue.
@Test
public void shouldMatchMergedDataExtensionHeaderWithNullValue() throws Exception {
BytesMatcher matcher = KafkaFunctions.matchDataEx().merged().header("name", null).build().build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new KafkaDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0x01).merged(f -> f.timestamp(12345678L).partition(p -> p.partitionId(0).partitionOffset(0L)).progressItem(p -> p.partitionId(0).partitionOffset(1L)).key(k -> k.length(5).value(v -> v.set("match".getBytes(UTF_8)))).delta(d -> d.type(t -> t.set(KafkaDeltaType.NONE))).headersItem(h -> h.nameLen(4).name(n -> n.set("name".getBytes(UTF_8))).valueLen(-1).value((OctetsFW) null))).build();
assertNotNull(matcher.match(byteBuf));
}
use of io.aklivity.zilla.specs.binding.kafka.internal.types.OctetsFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldMatchMergedDataExtensionWithNullValue.
@Test
public void shouldMatchMergedDataExtensionWithNullValue() throws Exception {
BytesMatcher matcher = KafkaFunctions.matchDataEx().typeId(0x01).merged().partition(0, 0L).progress(0, 1L).timestamp(12345678L).key("match").headerNull("name").build().build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new KafkaDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0x01).merged(f -> f.timestamp(12345678L).partition(p -> p.partitionId(0).partitionOffset(0L)).progressItem(p -> p.partitionId(0).partitionOffset(1L)).key(k -> k.length(5).value(v -> v.set("match".getBytes(UTF_8)))).delta(d -> d.type(t -> t.set(KafkaDeltaType.NONE))).headersItem(h -> h.nameLen(4).name(n -> n.set("name".getBytes(UTF_8))).valueLen(-1).value((OctetsFW) null))).build();
assertNotNull(matcher.match(byteBuf));
}
use of io.aklivity.zilla.specs.binding.kafka.internal.types.OctetsFW in project zilla by aklivity.
the class KafkaFunctionsTest method shouldMatchProduceDataExtensionNullKey.
@Test
public void shouldMatchProduceDataExtensionNullKey() throws Exception {
BytesMatcher matcher = KafkaFunctions.matchDataEx().produce().key(null).build().build();
ByteBuffer byteBuf = ByteBuffer.allocate(1024);
new KafkaDataExFW.Builder().wrap(new UnsafeBuffer(byteBuf), 0, byteBuf.capacity()).typeId(0x01).produce(p -> p.timestamp(12345678L).sequence(0).key(k -> k.length(-1).value((OctetsFW) null)).headersItem(h -> h.nameLen(4).name(n -> n.set("name".getBytes(UTF_8))).valueLen(5).value(v -> v.set("value".getBytes(UTF_8))))).build();
assertNotNull(matcher.match(byteBuf));
}
Aggregations