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