()
| 76 | |
| 77 | #[test] |
| 78 | fn test_base_event_builder() { |
| 79 | let ctx = test_sandbox_context(); |
| 80 | let event = BaseEventBuilder::new(&ctx) |
| 81 | .severity(SeverityId::Informational) |
| 82 | .status(StatusId::Success) |
| 83 | .activity_name("Network Namespace Created") |
| 84 | .message("Network namespace created") |
| 85 | .unmapped("namespace", serde_json::json!("openshell-sandbox-abc123")) |
| 86 | .unmapped("host_ip", serde_json::json!("10.42.0.1")) |
| 87 | .build(); |
| 88 | |
| 89 | let json = event.to_json().unwrap(); |
| 90 | assert_eq!(json["class_uid"], 0); |
| 91 | assert_eq!(json["activity_name"], "Network Namespace Created"); |
| 92 | assert_eq!(json["message"], "Network namespace created"); |
| 93 | assert_eq!(json["unmapped"]["namespace"], "openshell-sandbox-abc123"); |
| 94 | } |
| 95 | } |
nothing calls this directly
no test coverage detected