public final class KafkaMatchers
extends java.lang.Object
Matchers utilities.| Modifier and Type | Class and Description |
|---|---|
static class |
KafkaMatchers.ConsumerRecordKeyMatcher<K> |
static class |
KafkaMatchers.ConsumerRecordPartitionMatcher |
static class |
KafkaMatchers.ConsumerRecordTimestampMatcher |
static class |
KafkaMatchers.ConsumerRecordValueMatcher<V> |
| Modifier and Type | Method and Description |
|---|---|
static <K> org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<K,?>> |
hasKey(K key) |
static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> |
hasPartition(int partition) |
static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> |
hasTimestamp(long ts)
Matcher testing the timestamp of a
ConsumerRecord asssuming the topic has been set with
CreateTime. |
static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> |
hasTimestamp(org.apache.kafka.common.record.TimestampType type,
long ts)
Matcher testing the timestamp of a
ConsumerRecord |
static <V> org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,V>> |
hasValue(V value) |
public static <K> org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<K,?>> hasKey(K key)
K - the type.key - the keypublic static <V> org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,V>> hasValue(V value)
V - the type.value - the value.public static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> hasPartition(int partition)
partition - the partition.public static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> hasTimestamp(long ts)
ConsumerRecord asssuming the topic has been set with
CreateTime.ts - timestamp of the consumer record.public static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> hasTimestamp(org.apache.kafka.common.record.TimestampType type,
long ts)
ConsumerRecordtype - timestamp type of the recordts - timestamp of the consumer record.