#[cfg(test)] mod tests { use json::object; use df_helper::files::file; use df_helper::kafka::kafka::Kafka; #[test] fn post() { let kafka_conf = file::file_content_get_json("tests/config/kafka.json"); let kafka = Kafka::connect(kafka_conf); // let data = object! { // name:1213, // cont:"123123" // }; // let res = kafka.set("tests", "", 11.into()); // println!("{}", res); // let res = kafka.set("tests", "", data.clone()); // println!("{}", res); // let res = kafka.set("tests", "", data.clone()); // println!("{}", res); // let res = kafka.set("tests", "", 22.into()); // println!("{}", res); let data = kafka.get("tests", "name", true); println!("{:#}", data); } #[test] fn key() { let kafka_conf = file::file_content_get_json("tests/config/kafka.json"); let kafka = Kafka::connect(kafka_conf); let data = object! { name:33333, cont:"4444444" }; let res = kafka.set("tests", "name", 33.into()); println!("{}", res); let res = kafka.set("tests", "name", data.clone()); println!("{}", res); let res = kafka.set("tests", "name", data.clone()); println!("{}", res); let res = kafka.set("tests", "name", 44.into()); println!("{}", res); let data = kafka.get("tests", "name", false); println!("{:#}", data); } }