From e07b943fe34cfa038c5439bbd0c6854e14a2e137 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:08:04 +0000 Subject: [PATCH] feat: add coverage for the case we do not have any authenticator --- internal/authenticator/builder_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index cf7a4e8..a832daf 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -9,6 +9,24 @@ import ( "go.uber.org/zap" ) +func TestBuilderWithoutAuthenticator(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{}, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrNoAuthenticator) +} + func TestBuilderInternalAuthenticator(t *testing.T) { t.Parallel()