From 85a88de24d74654589163c9293cd57806dc702b8 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Tue, 12 Apr 2022 13:02:12 +1000 Subject: [PATCH] test(oidc): fix disabled tests (#3173) --- internal/oidc/store_test.go | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/internal/oidc/store_test.go b/internal/oidc/store_test.go index f73e2d8c1..412b81551 100644 --- a/internal/oidc/store_test.go +++ b/internal/oidc/store_test.go @@ -1,6 +1,15 @@ package oidc -/* +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/authelia/authelia/v4/internal/authorization" + "github.com/authelia/authelia/v4/internal/configuration/schema" +) func TestOpenIDConnectStore_GetClientPolicy(t *testing.T) { s := NewOpenIDConnectStore(&schema.OpenIDConnectConfiguration{ @@ -21,7 +30,7 @@ func TestOpenIDConnectStore_GetClientPolicy(t *testing.T) { Secret: "mysecret", }, }, - }) + }, nil) policyOne := s.GetClientPolicy("myclient") assert.Equal(t, authorization.OneFactor, policyOne) @@ -45,7 +54,7 @@ func TestOpenIDConnectStore_GetInternalClient(t *testing.T) { Secret: "mysecret", }, }, - }) + }, nil) client, err := s.GetClient(context.Background(), "myinvalidclient") assert.EqualError(t, err, "not_found") @@ -69,7 +78,7 @@ func TestOpenIDConnectStore_GetInternalClient_ValidClient(t *testing.T) { s := NewOpenIDConnectStore(&schema.OpenIDConnectConfiguration{ IssuerPrivateKey: exampleIssuerPrivateKey, Clients: []schema.OpenIDConnectClientConfiguration{c1}, - }) + }, nil) client, err := s.GetFullClient(c1.ID) require.NoError(t, err) @@ -96,7 +105,7 @@ func TestOpenIDConnectStore_GetInternalClient_InvalidClient(t *testing.T) { s := NewOpenIDConnectStore(&schema.OpenIDConnectConfiguration{ IssuerPrivateKey: exampleIssuerPrivateKey, Clients: []schema.OpenIDConnectClientConfiguration{c1}, - }) + }, nil) client, err := s.GetFullClient("another-client") assert.Nil(t, client) @@ -115,12 +124,11 @@ func TestOpenIDConnectStore_IsValidClientID(t *testing.T) { Secret: "mysecret", }, }, - }) + }, nil) validClient := s.IsValidClientID("myclient") invalidClient := s.IsValidClientID("myinvalidclient") assert.True(t, validClient) assert.False(t, invalidClient) -}. -*/ +}