File: authorization_test.go

package info (click to toggle)
golang-github-zitadel-oidc 3.44.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,520 kB
  • sloc: makefile: 5
file content (27 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//go:build go1.20

package oidc

import (
	"log/slog"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestAuthRequest_LogValue(t *testing.T) {
	a := &AuthRequest{
		Scopes:       SpaceDelimitedArray{"a", "b"},
		ResponseType: "respType",
		ClientID:     "123",
		RedirectURI:  "http://example.com/callback",
	}
	want := slog.GroupValue(
		slog.Any("scopes", SpaceDelimitedArray{"a", "b"}),
		slog.String("response_type", "respType"),
		slog.String("client_id", "123"),
		slog.String("redirect_uri", "http://example.com/callback"),
	)
	got := a.LogValue()
	assert.Equal(t, want, got)
}