Line data Source code
1 : use super::*;
2 :
3 : #[test]
4 6 : fn test_node_metadata_v1_backward_compatibilty() {
5 6 : let v1 = serde_json::to_vec(&serde_json::json!({
6 6 : "host": "localhost",
7 6 : "port": 23,
8 6 : "http_host": "localhost",
9 6 : "http_port": 42,
10 6 : }));
11 6 :
12 6 : assert_eq!(
13 6 : serde_json::from_slice::<NodeMetadata>(&v1.unwrap()).unwrap(),
14 6 : NodeMetadata {
15 6 : postgres_host: "localhost".to_string(),
16 6 : postgres_port: 23,
17 6 : http_host: "localhost".to_string(),
18 6 : http_port: 42,
19 6 : other: HashMap::new(),
20 6 : }
21 6 : )
22 6 : }
|