Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Nov 13, 2023
1 parent 1e7ae47 commit 8de1e41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions vcr/pe/presentation_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"}}}
Expand Down
4 changes: 2 additions & 2 deletions vcr/pe/presentation_submission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit 8de1e41

Please sign in to comment.