From 34d115ffa95f88f95953bcafa4ff17c32f026151 Mon Sep 17 00:00:00 2001 From: ecrupper Date: Wed, 22 May 2024 10:16:15 -0500 Subject: [PATCH] more fixes --- database/integration_test.go | 6 +++--- database/jwk/get_test.go | 2 +- database/testutils/mock_args.go | 2 +- go.mod | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/database/integration_test.go b/database/integration_test.go index 7284d1177..713eee0fc 100644 --- a/database/integration_test.go +++ b/database/integration_test.go @@ -894,8 +894,8 @@ func testJWKs(t *testing.T, db Interface, resources *Resources) { t.Errorf("unable to list jwks: %v", err) } - if diff := cmp.Diff(resources.JWKs, list); diff != "" { - t.Errorf("ListJWKs() mismatch (-want +got):\n%s", diff) + if !reflect.DeepEqual(resources.JWKs, list) { + t.Errorf("ListJWKs() mismatch, want %v, got %v", resources.JWKs, list) } methods["ListJWKs"] = true @@ -910,7 +910,7 @@ func testJWKs(t *testing.T, db Interface, resources *Resources) { t.Errorf("unable to get jwk %s: %v", jkPub.KeyID(), err) } - if !cmp.Equal(jkPub, got, testutils.JwkOpts) { + if !cmp.Equal(jkPub, got, testutils.JwkKeyOpts) { t.Errorf("GetJWK() is %v, want %v", got, jkPub) } } diff --git a/database/jwk/get_test.go b/database/jwk/get_test.go index 819cc1ee9..2cb131bae 100644 --- a/database/jwk/get_test.go +++ b/database/jwk/get_test.go @@ -79,7 +79,7 @@ func TestJWK_Engine_GetJWK(t *testing.T) { t.Errorf("GetActiveJWK for %s returned err: %v", test.name, err) } - if diff := cmp.Diff(test.want, got, testutils.JwkOpts); diff != "" { + if diff := cmp.Diff(test.want, got, testutils.JwkKeyOpts); diff != "" { t.Errorf("GetActiveJWK mismatch (-want +got):\n%s", diff) } }) diff --git a/database/testutils/mock_args.go b/database/testutils/mock_args.go index 8cff1b813..e6d8a9324 100644 --- a/database/testutils/mock_args.go +++ b/database/testutils/mock_args.go @@ -38,7 +38,7 @@ func (t NowTimestamp) Match(v driver.Value) bool { return now-ts < 10 } -var JwkOpts = cmp.Options{ +var JwkKeyOpts = cmp.Options{ cmp.FilterValues(func(x, y interface{}) bool { _, xOk := x.(jwk.RSAPublicKey) _, yOk := y.(jwk.RSAPublicKey) diff --git a/go.mod b/go.mod index fd440fca1..f9837b3eb 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,6 @@ require ( github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/option v1.0.1 // indirect - github.com/stretchr/testify v1.9.0 // indirect ) require (