From df62fcc2e5c841a4cfd893d99fad22d90d34e792 Mon Sep 17 00:00:00 2001 From: Nitin Vavdiya Date: Fri, 6 Sep 2024 11:27:05 +0530 Subject: [PATCH] fix: tests --- .../managedidentitywallets/utils/TestUtils.java | 10 +++++----- .../revocation/services/HttpClientServiceTest.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/miw/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java b/miw/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java index 246eab4e..7e9e6289 100644 --- a/miw/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java +++ b/miw/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java @@ -280,7 +280,7 @@ public static Map getCredentialAsMap(String holderBpn, String ho public static VerifiableCredentialStatusList2021Entry getStatusListEntry(int index) { return new VerifiableCredentialStatusList2021Entry(Map.of( "id", "https://example.com/credentials/bpn123456789000/revocation/3#" + index, - "type", "BitstringStatusListEntry", + "type", "StatusList2021Entry", "statusPurpose", "revocation", "statusListIndex", String.valueOf(index), "statusListCredential", "https://example.com/credentials/bpn123456789000/revocation/3" @@ -291,7 +291,7 @@ public static VerifiableCredentialStatusList2021Entry getStatusListEntry() { int index = RandomUtils.nextInt(1, 100); return new VerifiableCredentialStatusList2021Entry(Map.of( "id", "https://example.com/credentials/bpn123456789000/revocation/3#" + index, - "type", "BitstringStatusListEntry", + "type", "StatusList2021Entry", "statusPurpose", "revocation", "statusListIndex", String.valueOf(index), "statusListCredential", "https://example.com/credentials/bpn123456789000/revocation/3" @@ -318,7 +318,7 @@ public static void mockGetStatusListVC(RevocationClient revocationClient, Object String vcString = """ { "type": [ - "VerifiableCredential" + "VerifiableCredential","StatusList2021Credential" ], "@context": [ "https://www.w3.org/2018/credentials/v1", @@ -338,7 +338,7 @@ public static void mockGetStatusListVC(RevocationClient revocationClient, Object }, "credentialSubject": { "id": "did:key:z6MkhGTzcvb8BXh5aeoaFvb3XJ3MBmfLRamdYdXyV1pxJBce", - "type": "BitstringStatusList", + "type": "StatusList2021", "statusPurpose": "revocation", "encodedList": "##encodedList" } @@ -377,7 +377,7 @@ public static void mockGetStatusListVC(RevocationClient revocationClient, Object }, "credentialSubject": { "id": "did:key:z6MkhGTzcvb8BXh5aeoaFvb3XJ3MBmfLRamdYdXyV1pxJBce", - "type": "StatusList2021Credential", + "type": "StatusList2021", "statusPurpose": "revocation", "encodedList": "H4sIAAAAAAAA/+3BMQEAAAjAoEqzfzk/SwjUmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIDXFiqoX4AAAAIA" } diff --git a/revocation-service/src/test/java/org/eclipse/tractusx/managedidentitywallets/revocation/services/HttpClientServiceTest.java b/revocation-service/src/test/java/org/eclipse/tractusx/managedidentitywallets/revocation/services/HttpClientServiceTest.java index 31d929f9..01439c23 100644 --- a/revocation-service/src/test/java/org/eclipse/tractusx/managedidentitywallets/revocation/services/HttpClientServiceTest.java +++ b/revocation-service/src/test/java/org/eclipse/tractusx/managedidentitywallets/revocation/services/HttpClientServiceTest.java @@ -126,7 +126,7 @@ void testSignStatusListVC_Success() { tokenResponse.setAccessToken("123456"); wm1.stubFor(post("/token").willReturn(jsonResponse(tokenResponse, 200))); wm1.stubFor( - post("/api/credentials?revocable=false") + post("/api/credentials?revocable=false&asJwt=false") .willReturn(jsonResponse(statusListCredential.getCredential(), 200))); VerifiableCredential signedCredential = assertDoesNotThrow(