Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
kination committed May 27, 2021
1 parent 768b2c9 commit 15cfaef
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tests/test_metadata.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! Test metadata fetch, group membership, consumer metadata.
use std::time::Duration;

use rdkafka::config::ClientConfig;
use rdkafka::consumer::{Consumer, StreamConsumer};
use rdkafka::error::KafkaError;
use rdkafka::topic_partition_list::TopicPartitionList;
use std::collections::HashMap;
use std::time::Duration;

use rdkafka_sys::types::RDKafkaConfRes;

Expand Down Expand Up @@ -187,3 +187,22 @@ async fn test_client_config() {
))
);
}

#[tokio::test]
async fn test_client_config_set_map() {
let config_map: HashMap<String, String> = [
("session.timeout.ms".into(), "6000".into()),
("enable.auto.commit".into(), "false".into()),
("auto.offset.reset".into(), "earliest".into()),
]
.iter()
.cloned()
.collect();

let mut config: ClientConfig = ClientConfig::new();
config.set_map(config_map);

assert_eq!(config.get("session.timeout.ms").unwrap(), "6000");
assert_eq!(config.get("enable.auto.commit").unwrap(), "false");
assert_eq!(config.get("auto.offset.reset").unwrap(), "earliest");
}

0 comments on commit 15cfaef

Please sign in to comment.