()
| 180 | |
| 181 | #[test] |
| 182 | fn roundtrip_join_request() { |
| 183 | let req = JoinRequest { |
| 184 | node_id: 42, |
| 185 | listen_addr: "10.0.0.5:9400".into(), |
| 186 | wire_version: crate::topology::CLUSTER_WIRE_FORMAT_VERSION, |
| 187 | spiffe_id: Some("spiffe://cluster.local/node/42".into()), |
| 188 | spki_pin: Some(vec![0xabu8; 32]), |
| 189 | }; |
| 190 | match roundtrip(RaftRpc::JoinRequest(req)) { |
| 191 | RaftRpc::JoinRequest(d) => { |
| 192 | assert_eq!(d.node_id, 42); |
| 193 | assert_eq!(d.listen_addr, "10.0.0.5:9400"); |
| 194 | assert_eq!( |
| 195 | d.spiffe_id.as_deref(), |
| 196 | Some("spiffe://cluster.local/node/42") |
| 197 | ); |
| 198 | assert_eq!(d.spki_pin.as_deref(), Some([0xabu8; 32].as_ref())); |
| 199 | } |
| 200 | other => panic!("expected JoinRequest, got {other:?}"), |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | #[test] |
| 205 | fn roundtrip_join_response() { |
nothing calls this directly
no test coverage detected