in core/sdk/src/stream_builder/config/config_iggy_consumer.rs [386:440]
fn should_be_new() {
let config = IggyConsumerConfig::new(
Identifier::from_str_value("test_stream").unwrap(),
"test_stream".to_string(),
Identifier::from_str_value("test_topic").unwrap(),
"test_topic".to_string(),
AutoCommit::When(AutoCommitWhen::PollingMessages),
100,
false,
false,
"test_consumer".to_string(),
ConsumerKind::ConsumerGroup,
IggyDuration::from_str("5ms").unwrap(),
PollingStrategy::last(),
1,
None,
None,
IggyDuration::new_from_secs(1),
Some(3),
IggyDuration::new_from_secs(3),
);
assert_eq!(
config.stream_id(),
&Identifier::from_str_value("test_stream").unwrap(),
);
assert_eq!(config.stream_name(), "test_stream");
assert_eq!(
config.topic_id(),
&Identifier::from_str_value("test_topic").unwrap()
);
assert_eq!(config.topic_name(), "test_topic");
assert_eq!(
config.auto_commit(),
AutoCommit::When(AutoCommitWhen::PollingMessages)
);
assert_eq!(config.batch_size(), 100);
assert!(!config.create_stream_if_not_exists());
assert!(!config.create_topic_if_not_exists());
assert_eq!(config.consumer_name(), "test_consumer");
assert_eq!(config.consumer_kind(), ConsumerKind::ConsumerGroup);
assert_eq!(
config.polling_interval(),
IggyDuration::from_str("5ms").unwrap()
);
assert_eq!(config.polling_strategy(), PollingStrategy::last());
assert_eq!(config.partitions_count(), 1);
assert_eq!(config.replication_factor(), None);
assert_eq!(
config.polling_retry_interval(),
IggyDuration::new_from_secs(1)
);
assert_eq!(config.init_retries(), Some(3));
assert_eq!(config.init_interval(), IggyDuration::new_from_secs(3));
}