func ConvertEventExtensionsToString(t testing.TB, e event.Event) event.Event {
	out := e.Clone()
	for k, v := range e.Extensions() {
		var vParsed interface{}
		var err error
		switch v := v.(type) {
		case json.RawMessage:
			err = json.Unmarshal(v, &vParsed)
			require.NoError(t, err)
		default:
			vParsed, err = types.Format(v)
			require.NoError(t, err)
		}
		out.SetExtension(k, vParsed)
	}
	return out
}
ConvertEventExtensionsToString returns a copy of the event.Event where all extensions are converted to strings. Fails the test if conversion fails
package test
import (
	"context"
	"encoding/json"
	"fmt"
	"reflect"
	"testing"
	"github.com/stretchr/testify/require"
	"github.com/cloudevents/sdk-go/v2/binding"
	"github.com/cloudevents/sdk-go/v2/binding/format"
	"github.com/cloudevents/sdk-go/v2/event"
	"github.com/cloudevents/sdk-go/v2/types"
)
func WithoutExtensions(events []event.Event) []event.Event {
	result := make([]event.Event, len(events))
	for i, e := range events {
		result[i] = e
		result[i].Context = e.Context.Clone()
		ctx := reflect.ValueOf(result[i].Context).Elem()
		ext := ctx.FieldByName("Extensions")
		ext.Set(reflect.Zero(ext.Type()))
	}
	return result
}
func MustJSON(t testing.TB, e event.Event) []byte {
	b, err := format.JSON.Marshal(&e)
	require.NoError(t, err)
	return b
}
func MustToEvent(t testing.TB, ctx context.Context, m binding.Message) event.Event {
	e, err := binding.ToEvent(ctx, m)
	require.NoError(t, err)
	return *e
}