From b5e19dc0f626ab43e8d5ed4bfda7f5a21d242fcc Mon Sep 17 00:00:00 2001 From: Yasir Date: Tue, 12 Nov 2024 23:41:52 +0300 Subject: [PATCH] Add test for statusListIndex serialization in StatusList2021Entry --- .../src/revocation/status_list_2021/entry.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/identity_credential/src/revocation/status_list_2021/entry.rs b/identity_credential/src/revocation/status_list_2021/entry.rs index 54eb67d1d..92415d06b 100644 --- a/identity_credential/src/revocation/status_list_2021/entry.rs +++ b/identity_credential/src/revocation/status_list_2021/entry.rs @@ -153,4 +153,13 @@ mod tests { }); serde_json::from_value::(status).expect("wrong type"); } + + #[test] + fn test_status_list_index_serialization() { + let base_url = Url::parse("https://example.com/credentials/status/3").unwrap(); + + let entry1 = StatusList2021Entry::new(base_url.clone(), StatusPurpose::Revocation, 94567, None); + let json1 = serde_json::to_value(&entry1).unwrap(); + assert_eq!(json1["statusListIndex"], "94567"); + } }