diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2023-11-30 19:45:24 +1100 |
|---|---|---|
| committer | James Elliott <james-d-elliott@users.noreply.github.com> | 2024-03-04 20:29:12 +1100 |
| commit | e4e878f05f8ae1e1784b3ac190459b2d506f796c (patch) | |
| tree | ed8f5b927156300dddff33f3e14bc732803ea405 /internal/handlers/handler_firstfactor_test.go | |
| parent | 61c30b373f8c5ee14321e82c8d7210aae7d260c3 (diff) | |
build(deps): use go.uber.org/mock
Use the new go.uber.org/mock which is currently maintained.
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/handlers/handler_firstfactor_test.go')
| -rw-r--r-- | internal/handlers/handler_firstfactor_test.go | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/internal/handlers/handler_firstfactor_test.go b/internal/handlers/handler_firstfactor_test.go index 3c046ea4a..6d17a71b9 100644 --- a/internal/handlers/handler_firstfactor_test.go +++ b/internal/handlers/handler_firstfactor_test.go @@ -5,12 +5,10 @@ import ( "net/url" "testing" - "github.com/golang/mock/gomock" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/valyala/fasthttp" + "go.uber.org/mock/gomock" "github.com/authelia/authelia/v4/internal/authentication" "github.com/authelia/authelia/v4/internal/authorization" @@ -464,25 +462,3 @@ func TestFirstFactorSuite(t *testing.T) { suite.Run(t, new(FirstFactorSuite)) suite.Run(t, new(FirstFactorRedirectionSuite)) } - -func AssertLogEntryMessageAndError(t *testing.T, entry *logrus.Entry, message, err string) { - require.NotNil(t, entry) - - assert.Equal(t, message, entry.Message) - - v, ok := entry.Data["error"] - - if err == "" { - assert.False(t, ok) - assert.Nil(t, v) - } else { - assert.True(t, ok) - require.NotNil(t, v) - - theErr, ok := v.(error) - assert.True(t, ok) - require.NotNil(t, theErr) - - assert.EqualError(t, theErr, err) - } -} |
