Add dumb test that extracts event from queue

This commit is contained in:
Matias Fontanini
2018-10-21 15:17:48 -07:00
parent c7e1dcb60a
commit 71fb76b8e1

View File

@@ -241,3 +241,18 @@ TEST_CASE("consume batch", "[consumer]") {
CHECK(all_messages[0].get_payload() == payload);
CHECK(all_messages[1].get_payload() == payload);
}
TEST_CASE("Event consumption", "[consumer]") {
// Create a consumer and subscribe to the topic
Consumer consumer(make_consumer_config());
consumer.subscribe({ KAFKA_TOPICS[0] });
vector<rd_kafka_event_type_t> types = {
RD_KAFKA_EVENT_NONE
};
Queue queue = consumer.get_main_queue();
for (const auto type : types) {
const Event event = queue.next_event();
CHECK(event.get_type() == type);
}
}