diff --git a/vcr/pe/presentation_definition_test.go b/vcr/pe/presentation_definition_test.go index 39707c8dc3..3ecd2fd6b4 100644 --- a/vcr/pe/presentation_definition_test.go +++ b/vcr/pe/presentation_definition_test.go @@ -24,7 +24,7 @@ import ( "crypto/rand" "embed" "encoding/json" - "os" + "github.com/nuts-foundation/nuts-node/vcr/credential" "testing" "github.com/lestrrat-go/jwx/v2/jwa" @@ -77,9 +77,7 @@ func init() { func TestMatch(t *testing.T) { // Create a JSON-LD VC - jsonldVC := vc.VerifiableCredential{} - vcJSON, _ := os.ReadFile("../test/vc.json") - _ = json.Unmarshal(vcJSON, &jsonldVC) + jsonldVC := credential.ValidNutsOrganizationCredential(t) // Create a JWT VC privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) @@ -363,9 +361,7 @@ txJy6M1-lD7a5HTzanYTWBPAUHDZGyGKXdJw-W_x0IWChBzI8t3kpG253fg6V3tPgHeKXE94fz_QpYfg }) t.Run("JSON-LD", func(t *testing.T) { - verifiableCredential := vc.VerifiableCredential{} - vcJSON, _ := os.ReadFile("../test/vc.json") - _ = json.Unmarshal(vcJSON, &verifiableCredential) + verifiableCredential := credential.ValidNutsOrganizationCredential(t) t.Run("format with matching ldp_vc", func(t *testing.T) { asMap := map[string]map[string][]string{"jwt_vc": {"alg": {"ES256K", "ES384"}}, "ldp_vc": {"proof_type": {"JsonWebSignature2020"}}} diff --git a/vcr/pe/presentation_submission_test.go b/vcr/pe/presentation_submission_test.go index 6c9f31c5e2..faa4aded9f 100644 --- a/vcr/pe/presentation_submission_test.go +++ b/vcr/pe/presentation_submission_test.go @@ -46,8 +46,8 @@ func TestPresentationSubmissionBuilder_Build(t *testing.T) { holder2 := did.MustParseDID("did:example:2") id1 := ssi.MustParseURI("1") id2 := ssi.MustParseURI("2") - vc1 := vc.VerifiableCredential{ID: &id1} - vc2 := vc.VerifiableCredential{ID: &id2} + vc1 := credentialToJSONLD(vc.VerifiableCredential{ID: &id1}) + vc2 := credentialToJSONLD(vc.VerifiableCredential{ID: &id2}) t.Run("ok - single wallet", func(t *testing.T) { presentationDefinition := PresentationDefinition{}