| 146 | |
| 147 | #[test] |
| 148 | fn domain_alias_info_roundtrip() { |
| 149 | let info = DomainAliasInfo { |
| 150 | id: Uuid::new_v4(), |
| 151 | org_id: Uuid::new_v4(), |
| 152 | domain: "eng.acme.com".into(), |
| 153 | status: "pending".into(), |
| 154 | verification_method: "dns-txt".into(), |
| 155 | verification_token: Some("tok_abc".into()), |
| 156 | }; |
| 157 | let json = serde_json::to_string(&info).unwrap(); |
| 158 | let de: DomainAliasInfo = serde_json::from_str(&json).unwrap(); |
| 159 | assert_eq!(de.domain, "eng.acme.com"); |
| 160 | assert_eq!(de.status, "pending"); |
| 161 | assert_eq!(de.verification_method, "dns-txt"); |
| 162 | assert_eq!(de.verification_token.as_deref(), Some("tok_abc")); |
| 163 | } |
| 164 | } |