in nfm-controller/src/reports/publisher_endpoint.rs [402:445]
fn test_proxy_configuration() {
let creds = Credentials::new("AKID", "SECRET", Some("TOKEN".into()), None, "test");
let provider = SharedCredentialsProvider::new(creds);
let mock_clock = FakeClock {
now_us: 1718716821050,
};
// Test empty proxy string
assert!(matches!(
ReportPublisherOTLP::new_without_proxy(
"http://localhost".to_string(),
"us-west-1".to_string(),
provider.clone(),
mock_clock.clone(),
ReportCompression::None,
),
ReportPublisherOTLP { .. }
));
// Test valid https proxy - should create successfully
assert!(matches!(
ReportPublisherOTLP::new(
"http://localhost".to_string(),
"us-west-1".to_string(),
provider.clone(),
mock_clock.clone(),
ReportCompression::None,
"https://127.0.0.1:8443".to_string(),
),
ReportPublisherOTLP { .. }
));
// Test valid http proxy - should create successfully
assert!(matches!(
ReportPublisherOTLP::new(
"http://localhost".to_string(),
"us-west-1".to_string(),
provider.clone(),
mock_clock.clone(),
ReportCompression::None,
"http://127.0.0.1".to_string(),
),
ReportPublisherOTLP { .. }
));
}