From 7ee93b47e163a2e4259a8a5bdadd4392a6e5f1b0 Mon Sep 17 00:00:00 2001 From: Nander Stabel Date: Sat, 5 Oct 2024 22:56:04 +0200 Subject: [PATCH] test: update test --- agent_api_rest/src/issuance/credentials.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/agent_api_rest/src/issuance/credentials.rs b/agent_api_rest/src/issuance/credentials.rs index 4a254a2..586842e 100644 --- a/agent_api_rest/src/issuance/credentials.rs +++ b/agent_api_rest/src/issuance/credentials.rs @@ -198,10 +198,7 @@ pub mod tests { "name": "UniCore" }, "issuanceDate": "2010-01-01T00:00:00Z", - "credentialSubject": { - "first_name": "Ferris", - "last_name": "Rustacean" - } + "credentialSubject": CREDENTIAL_SUBJECT.clone() }); } @@ -216,10 +213,8 @@ pub mod tests { serde_json::to_vec(&json!({ "offerId": OFFER_ID, "credential": { - "credentialSubject": { - "first_name": "Ferris", - "last_name": "Rustacean" - }}, + "credentialSubject": CREDENTIAL_SUBJECT.clone() + }, "credentialConfigurationId": CREDENTIAL_CONFIGURATION_ID })) .unwrap(), @@ -261,7 +256,7 @@ pub mod tests { let body = axum::body::to_bytes(response.into_body(), usize::MAX).await.unwrap(); let body: Value = serde_json::from_slice(&body).unwrap(); - assert_eq!(body, CREDENTIAL.clone()); + assert_eq!(body["data"]["raw"], CREDENTIAL.clone()); } #[tokio::test]