()
| 128 | |
| 129 | #[test] |
| 130 | fn test_convenience_functions() { |
| 131 | // Test that convenience functions work without panicking |
| 132 | let ip: IpAddr = "192.168.1.200".parse().unwrap(); |
| 133 | |
| 134 | events::connection_accepted(ip, true); |
| 135 | events::connection_rejected(ip, "rate limit exceeded"); |
| 136 | events::authentication_success(ip, "testuser", "testdb"); |
| 137 | events::sql_injection_attempt( |
| 138 | Some(ip), |
| 139 | Some("session_123".to_string()), |
| 140 | "SELECT * FROM users WHERE id = 1 OR 1=1", |
| 141 | "OR 1=1", |
| 142 | ); |
| 143 | events::rate_limit_exceeded(Some(ip), "per-ip", 100); |
| 144 | events::circuit_breaker_opened(5, 3); |
| 145 | events::protocol_violation(Some(ip), "invalid message format"); |
| 146 | events::query_executed( |
| 147 | Some(ip), |
| 148 | Some("session_123".to_string()), |
| 149 | Some("testuser".to_string()), |
| 150 | Some("testdb".to_string()), |
| 151 | "SELECT COUNT(*) FROM users", |
| 152 | 50, |
| 153 | ); |
| 154 | |
| 155 | // If we get here without panicking, the convenience functions work |
| 156 | assert!(true); |
| 157 | } |
| 158 | |
| 159 | #[test] |
| 160 | fn test_timestamp_formatting() { |
nothing calls this directly
no test coverage detected