#![cfg(feature = "entra-sdk")]
use std::sync::Arc;
use agent_framework_azure::{SdkTokenCredential, TokenCredential};
#[tokio::test]
#[ignore = "requires outbound network to login.microsoftonline.com"]
async fn an_https_handshake_to_entra_completes() {
let cred = azure_identity::ClientSecretCredential::new(
"cc7d0b33-84c6-4bd1-bbfc-1b5b1cd8ca3a",
"00000000-0000-0000-0000-000000000000".into(),
"not-a-real-secret".into(),
None,
)
.expect("credential constructs");
let adapter: Arc<dyn TokenCredential> = Arc::new(SdkTokenCredential::azure_openai(cred));
let err = adapter
.get_token()
.await
.expect_err("bogus credentials cannot yield a token")
.to_string();
assert!(
err.contains("AADSTS"),
"expected a real Entra rejection, which proves the handshake completed; \
got {err:?} — a JSON parse error here means reqwest 0.13 has no TLS backend"
);
}