diff --git a/test/bdd/pkg/v1/oidc4vc/oidc4vci.go b/test/bdd/pkg/v1/oidc4vc/oidc4vci.go index 6d4c4bf67..2a253fec5 100644 --- a/test/bdd/pkg/v1/oidc4vc/oidc4vci.go +++ b/test/bdd/pkg/v1/oidc4vc/oidc4vci.go @@ -1184,9 +1184,19 @@ func (s *Steps) setExpectedCredentialsAmountForVP(expectedCredentialsAmount stri } func checkEventInteractionDetailsClaim(event *spi.Event) error { - eventData, ok := event.Data.(map[string]interface{}) - if !ok { - return fmt.Errorf("event payload has unexpected type: %v", event.Data) + var eventData map[string]interface{} + + if v, t := event.Data.(map[string]interface{}); t { + eventData = v + } else { + jsonData, err := base64.StdEncoding.DecodeString(event.Data.(string)) + if err != nil { + return fmt.Errorf("failed to decode event %v: %w", event.Data, err) + } + + if err = json.Unmarshal(jsonData, &eventData); err != nil { + return fmt.Errorf("invalid event payload %v: %w", event.Data, err) + } } interactionDetails, ok := eventData["interaction_details"].(map[string]interface{}) @@ -1468,7 +1478,10 @@ func (s *Steps) waitForOIDC4CIEvent(eventType spi.EventType) error { } switch eventType { - case spi.IssuerOIDCInteractionAckSucceeded, spi.IssuerOIDCInteractionAckFailed, spi.IssuerOIDCInteractionAckRejected: + case spi.IssuerOIDCInteractionAckSucceeded, + spi.IssuerOIDCInteractionAckFailed, + spi.IssuerOIDCInteractionAckRejected, + spi.IssuerOIDCInteractionAckExpired: if err = checkEventInteractionDetailsClaim(event); err != nil { return err } diff --git a/test/bdd/pkg/v1/oidc4vc/oidc4vp.go b/test/bdd/pkg/v1/oidc4vc/oidc4vp.go index 4e153347f..3ffba6857 100644 --- a/test/bdd/pkg/v1/oidc4vc/oidc4vp.go +++ b/test/bdd/pkg/v1/oidc4vc/oidc4vp.go @@ -354,7 +354,10 @@ func (s *Steps) waitForOIDC4VPEvent(eventType string) error { s.vpClaimsTransactionID = event.TransactionID switch spi.EventType(eventType) { - case spi.VerifierOIDCInteractionSucceeded, spi.VerifierOIDCInteractionNoConsent, spi.VerifierOIDCInteractionNoMatchFound: + case spi.VerifierOIDCInteractionSucceeded, + spi.VerifierOIDCInteractionNoConsent, + spi.VerifierOIDCInteractionNoMatchFound, + spi.VerifierOIDCInteractionExpired: if err = checkEventInteractionDetailsClaim(event); err != nil { return err }