-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add unittests for all serialized responses and primary json / y…
…aml structures
- Loading branch information
Benjamin Sommerfeld
committed
Oct 18, 2024
1 parent
3445108
commit 5126629
Showing
22 changed files
with
7,186 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,32 @@ pub struct JwtClaims { | |
pub struct BearerResponse { | ||
pub access_token: String, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
|
||
use super::*; | ||
use crate::models::tests::read_json_from_file; | ||
|
||
#[test] | ||
fn serialize_domain_list() { | ||
// Read the JSON contents of the file as an instance of `User`. | ||
let vobj: BearerResponse = | ||
read_json_from_file("test/test_auth_bearer_response.json").unwrap(); | ||
assert_eq!(vobj.access_token, "das.ist.ein.token"); | ||
} | ||
#[test] | ||
fn serialize_jwt_claims() { | ||
let vobj: JwtClaims = read_json_from_file("test/test_auth_jwt_response.json").unwrap(); | ||
|
||
assert_eq!( | ||
vobj.aud, | ||
"https://ims-na1.adobelogin.com/c/4df5gh....." | ||
); | ||
assert_eq!(vobj.exp, 1550001438); | ||
assert_eq!(vobj.iss, "C74F69D7594880280.....@AdobeOrg"); | ||
assert_eq!(vobj.sub, "[email protected]"); | ||
assert_eq!(vobj.scope_ent_aem_cloud_api, false); | ||
assert_eq!(vobj.scope_ent_cloudmgr_sdk, true); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"access_token": "das.ist.ein.token", | ||
"token_type": "bearer", | ||
"expires_in": 14 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"exp": 1550001438, | ||
"iss": "C74F69D7594880280.....@AdobeOrg", | ||
"sub": "[email protected]", | ||
"https://ims-na1.adobelogin.com/s/ent_dataservices_sdk": true, | ||
"aud": "https://ims-na1.adobelogin.com/c/4df5gh.....", | ||
"scope_ent_cloudmgr_sdk":true, | ||
"scope_ent_aem_cloud_api": false | ||
} |
Oops, something went wrong.