From badd0b6a055fbdebe4c79e5a5fb7f63aa9f0cc4e Mon Sep 17 00:00:00 2001 From: Matthew Scheirer Date: Sun, 17 Sep 2017 22:44:44 -0400 Subject: [PATCH] Moar tests! --- src/discovery.rs | 5 +++-- src/issuer.rs | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/discovery.rs b/src/discovery.rs index 9e5cc0a..b63f9f1 100644 --- a/src/discovery.rs +++ b/src/discovery.rs @@ -110,6 +110,7 @@ pub fn jwks(client: &Client, url: Url) -> Result, Error> { #[test] fn config_google() { + // Formatting this took time off my lifespan... let cfg = r#"{ "issuer": "https://accounts.google.com", "authorization_endpoint": "https://accounts.google.com/o/oauth2/v2/auth", "token_endpoint": "https://www.googleapis.com/oauth2/v4/token", @@ -129,7 +130,7 @@ fn config_google() { "sub" ], "code_challenge_methods_supported": [ "plain", "S256" ] }"#; - println!("{:?}", ::serde_json::from_str::(cfg).unwrap()); + ::serde_json::from_str::(cfg).unwrap(); } #[test] @@ -142,5 +143,5 @@ fn config_minimum() { "subject_types_supported": [ "public" ], "id_token_signing_alg_values_supported": [ "RS256" ] }"#; - println!("{:?}", ::serde_json::from_str::(cfg).unwrap()); + ::serde_json::from_str::(cfg).unwrap(); } diff --git a/src/issuer.rs b/src/issuer.rs index 5e3dc4d..5a29f72 100644 --- a/src/issuer.rs +++ b/src/issuer.rs @@ -11,11 +11,23 @@ pub fn paypal() -> Url { } pub fn salesforce() -> Url { - Url::parse("http://login.salesforce.com").unwrap() + Url::parse("https://login.salesforce.com").unwrap() } #[test] fn google_disco() { let client = ::reqwest::Client::new().unwrap(); - let config = ::discovery::discover(&client, google()).unwrap(); + ::discovery::discover(&client, google()).unwrap(); +} + +#[test] +fn paypal_disco() { + let client = ::reqwest::Client::new().unwrap(); + ::discovery::discover(&client, paypal()).unwrap(); +} + +#[test] +fn salesforce_disco() { + let client = ::reqwest::Client::new().unwrap(); + ::discovery::discover(&client, salesforce()).unwrap(); } \ No newline at end of file