TBD54566975 / web5-spec

Web5 Spec
https://tbd54566975.github.io/web5-spec/
Apache License 2.0
7 stars 5 forks source link

adding test vector #72

Closed nitro-neal closed 10 months ago

nitro-neal commented 10 months ago

Here is an example of what the test may look similar to that implements thsi test vector:

    @Test
    fun `web5-test-vectors/presentation-exchange/wa-license.json`() {
     val jsonString = get("https://raw.githubusercontent.com/TBD54566975/sdk-development/392de55c0992e5457d8d881f37299984f17d168c/web5-test-vectors/presentation-exchange/wa-license.json")

      val pd = jsonMapper.readValue(
        readPd(jsonString.vectors[0].presentationDefinition),
        PresentationDefinitionV2::class.java
      )

      val vcJwt = jsonString.vectors[0].credentialJwt

      val presentationResult = PresentationExchange.createPresentationFromCredentials([vcJwt], pd);

     assertEquals(presentationResult.toString(), jsonString.vectors[0].output)
    }

our PresentationExchange function takes in : presentationDefinition and credentialJwt from the test vector, and it should generate the output from the test vector

andresuribe87 commented 10 months ago

This is awesome @nitro-neal

A couple of pieces of feedback.

Let me know if that all makes sense!

nitro-neal commented 10 months ago

Sounds good and makes sense to me! Added README and I will add the errors when I complete what my error object will look like