oidc: add regression tests for token claim json

this helps to verify that the same JSON is produced,
after these types are refactored.
This commit is contained in:
Tim Möhlmann 2023-02-17 18:45:40 +02:00
parent 4dca29f1f9
commit 11682a2cc8
8 changed files with 392 additions and 0 deletions

View file

@ -0,0 +1,24 @@
//go:build create_regression_data
package oidc
import (
"os"
"testing"
"github.com/stretchr/testify/require"
)
// Test_create_regression generates the regression data.
// It is excluded from regular testing, unless
// called with the create_regression_data tag:
// go test -tags="create_regression_data" ./pkg/oidc
func Test_create_regression(t *testing.T) {
for _, obj := range regressionData {
file, err := os.Create(jsonFilename(obj))
require.NoError(t, err)
defer file.Close()
encodeJSON(t, file, obj)
}
}