クラス KafkaMatchers
java.lang.ObjectSE
org.springframework.kafka.test.hamcrest.KafkaMatchers
Hamcrest
Matcher
のユーティリティ。- 作成者:
- Gary Russell, Biju Kunjummen
ネストされたクラスのサマリー
ネストされたクラス修飾子と型クラス説明static class
static class
static class
static 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