Skip to content

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
waltkb committed Jul 31, 2024
1 parent d7849ab commit 8fe68ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions waltid-services/waltid-e2e-tests/src/test/kotlin/E2ETest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class E2ETest {
unmatchedCredentialsForPresentationDefinition(presentationDefinition)

test("Use presentation request") {
usePresentationRequest(UsePresentationRequest(did, resolvedPresentationOffer, listOf(newCredentialId)))
usePresentationRequest(UsePresentationRequest(did, resolvedPresentationOffer, listOf(newCredentialId))).expectSuccess()
}

presentationSession = sessionApi.get(verificationId)
Expand Down Expand Up @@ -286,8 +286,7 @@ class E2ETest {
selectedCredentials = listOf(newCredential.id),
disclosures = newCredential.disclosures?.let { mapOf(newCredential.id to listOf(it)) },
),
expectStatus = HttpResponse::expectFailure,
)
).expectFailure()

presentationSession = sessionApi.get(verificationId)
assert(presentationSession.tokenResponse?.vpToken?.jsonPrimitive?.contentOrNull?.expectLooksLikeJwt() != null) { "Received no valid token response!" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ class ExchangeApi(private val client: HttpClient, val wallet: UUID) {

suspend fun usePresentationRequest(
request: UsePresentationRequest,
expectStatus: suspend HttpResponse.() -> HttpResponse = { this.expectSuccess() },
) =
client.post("/wallet-api/wallet/$wallet/exchange/usePresentationRequest") {
setBody(request)
}.expectStatus()
}
}

0 comments on commit 8fe68ad

Please sign in to comment.