クラス KafkaMatchers
java.lang.ObjectSE
org.springframework.kafka.test.hamcrest.KafkaMatchers
Hamcrest
Matcher のユーティリティ。- 作成者:
- Gary Russell, Biju Kunjummen
ネストされたクラスの概要
ネストされたクラス修飾子と型クラス説明static classstatic classstatic classstatic class方法の概要
修飾子と型メソッド説明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) トピックがCreateTimeで設定されていると仮定して、ConsumerRecordのタイムスタンプをテストするマッチャー。static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> hasTimestamp(org.apache.kafka.common.record.TimestampType type, long ts) ConsumerRecordのタイムスタンプをテストするマッチャーstatic <V> org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,V>> hasValue(V value)
方法の詳細
hasKey
public static <K> org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<K,?>> hasKey(K key) - 型パラメーター:
K- 型。- パラメーター:
key- キー- 戻り値:
- コンシューマーレコードのキーと一致するマッチャー。
hasValue
public static <V> org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,V>> hasValue(V value) - 型パラメーター:
V- 型。- パラメーター:
value- 値。- 戻り値:
- コンシューマーレコードの値と一致するマッチャー。
hasPartition
public static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> hasPartition(int partition) - パラメーター:
partition- パーティション。- 戻り値:
- コンシューマーレコードのパーティションに一致するマッチャー。
hasTimestamp
public static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> hasTimestamp(long ts) トピックがCreateTimeで設定されていると仮定して、ConsumerRecordのタイムスタンプをテストするマッチャー。- パラメーター:
ts- コンシューマーレコードのタイムスタンプ。- 戻り値:
- コンシューマーレコードのタイムスタンプと一致するマッチャー。
- 導入:
- 1.3
hasTimestamp
public static org.hamcrest.Matcher<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> hasTimestamp(org.apache.kafka.common.record.TimestampType type, long ts) ConsumerRecordのタイムスタンプをテストするマッチャー- パラメーター:
type- レコードのタイムスタンプ型ts- コンシューマーレコードのタイムスタンプ。- 戻り値:
- コンシューマーレコードのタイムスタンプと一致するマッチャー。
- 導入:
- 1.3