From 11c37673a6add53d5b29fa03fa7b1270985b2ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Nordstr=C3=B6m?= Date: Mon, 23 Sep 2024 21:55:31 +0200 Subject: [PATCH] make tokenCacheMock consistent naming with struct --- libs/auth/oauth_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/auth/oauth_test.go b/libs/auth/oauth_test.go index fd245c67..a8a1da70 100644 --- a/libs/auth/oauth_test.go +++ b/libs/auth/oauth_test.go @@ -53,9 +53,9 @@ func TestOidcForWorkspace(t *testing.T) { } type tokenCacheMock struct { - store func(key string, t *oauth2.Token) error - lookup func(key string) (*oauth2.Token, error) - deleteKey func(key string) error + store func(key string, t *oauth2.Token) error + lookup func(key string) (*oauth2.Token, error) + delete func(key string) error } func (m *tokenCacheMock) Store(key string, t *oauth2.Token) error { @@ -73,10 +73,10 @@ func (m *tokenCacheMock) Lookup(key string) (*oauth2.Token, error) { } func (m *tokenCacheMock) Delete(key string) error { - if m.deleteKey == nil { + if m.delete == nil { panic("no deleteKey mock") } - return m.deleteKey(key) + return m.delete(key) } func TestLoad(t *testing.T) { @@ -246,7 +246,7 @@ func TestClearToken(t *testing.T) { assert.Equal(t, "https://abc/oidc/accounts/xyz", key) return &oauth2.Token{}, ErrNotConfigured }, - deleteKey: func(key string) error { + delete: func(key string) error { assert.Equal(t, "https://abc/oidc/accounts/xyz", key) return nil }, @@ -269,7 +269,7 @@ func TestClearTokenNotExist(t *testing.T) { assert.Equal(t, "https://abc/oidc/accounts/xyz", key) return &oauth2.Token{}, ErrNotConfigured }, - deleteKey: func(key string) error { + delete: func(key string) error { assert.Equal(t, "https://abc/oidc/accounts/xyz", key) return ErrNotConfigured },