Class KafkaConditions


  • public final class KafkaConditions
    extends java.lang.Object
    AssertJ custom Conditions.
    Author:
    Artem Bilan, Gary Russell, Biju Kunjummen
    • Method Detail

      • key

        public static <K> org.assertj.core.api.Condition<org.apache.kafka.clients.consumer.ConsumerRecord<K,​?>> key​(K key)
        Type Parameters:
        K - the type.
        Parameters:
        key - the key.
        Returns:
        a Condition that matches the key in a consumer record.
      • value

        public static <V> org.assertj.core.api.Condition<org.apache.kafka.clients.consumer.ConsumerRecord<?,​V>> value​(V value)
        Type Parameters:
        V - the type.
        Parameters:
        value - the value.
        Returns:
        a Condition that matches the value in a consumer record.
      • keyValue

        public static <K,​V> org.assertj.core.api.Condition<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>> keyValue​(K key,
                                                                                                                                       V value)
        Type Parameters:
        K - the key type.
        V - the value type.
        Parameters:
        key - the key.
        value - the value.
        Returns:
        a Condition that matches the key in a consumer record.
        Since:
        2.2.12
      • timestamp

        public static org.assertj.core.api.Condition<org.apache.kafka.clients.consumer.ConsumerRecord<?,​?>> timestamp​(long value)
        Parameters:
        value - the timestamp.
        Returns:
        a Condition that matches the timestamp value in a consumer record.
        Since:
        1.3
      • timestamp

        public static org.assertj.core.api.Condition<org.apache.kafka.clients.consumer.ConsumerRecord<?,​?>> timestamp​(org.apache.kafka.common.record.TimestampType type,
                                                                                                                            long value)
        Parameters:
        type - the type of timestamp
        value - the timestamp.
        Returns:
        a Condition that matches the timestamp value in a consumer record.
        Since:
        1.3
      • partition

        public static org.assertj.core.api.Condition<org.apache.kafka.clients.consumer.ConsumerRecord<?,​?>> partition​(int partition)
        Parameters:
        partition - the partition.
        Returns:
        a Condition that matches the partition in a consumer record.