From 16d91027b8494369ba10b404321cff173f47517f Mon Sep 17 00:00:00 2001 From: Gerard Snaauw <33763579+gerardsn@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:50:14 +0200 Subject: [PATCH] Migrate golang/mock to uber/mock (#2310) * migrate to uber/mock * update go-stoabs to 1.9.0 --- audit/test.go | 2 +- auth/api/auth/v1/api_test.go | 2 +- auth/auth_test.go | 2 +- auth/contract/signer_mock.go | 2 +- auth/services/irma/signer_test.go | 2 +- auth/services/mock.go | 2 +- auth/services/notary/notary_test.go | 2 +- auth/services/oauth/authz_server_test.go | 2 +- auth/services/oauth/mock.go | 2 +- auth/services/oauth/relying_party_test.go | 2 +- auth/services/selfsigned/signer_test.go | 2 +- auth/services/selfsigned/types/mock.go | 2 +- auth/services/selfsigned/web/handler_test.go | 2 +- auth/services/uzi/validator_test.go | 2 +- auth/services/x509/x509_validator_test.go | 2 +- auth/test.go | 2 +- cmd/root_test.go | 2 +- core/echo_mock.go | 46 +++++++++---------- core/engine_mock.go | 2 +- core/engine_test.go | 2 +- core/landingpage_test.go | 2 +- core/status/engine_test.go | 2 +- crypto/api/v1/api_test.go | 2 +- crypto/api/v1/generated_test.go | 2 +- crypto/crypto_test.go | 2 +- crypto/hash/test.go | 2 +- crypto/mock.go | 2 +- crypto/storage/spi/mock.go | 2 +- crypto/storage/spi/wrapper_test.go | 2 +- didman/api/v1/api_test.go | 2 +- didman/didman_test.go | 2 +- didman/mock.go | 2 +- events/conn_test.go | 2 +- events/events_mock.go | 2 +- events/mock.go | 2 +- events/stream_test.go | 2 +- go.mod | 4 +- go.sum | 9 ++-- http/echo_mock.go | 46 +++++++++---------- http/echo_test.go | 2 +- http/engine_test.go | 2 +- http/requestlogger_test.go | 2 +- makefile | 2 +- mock/mock_echo.go | 2 +- network/api/v1/api_test.go | 2 +- network/dag/mock.go | 2 +- network/dag/notifier_mock.go | 2 +- network/dag/notifier_test.go | 2 +- network/dag/pal_test.go | 2 +- network/dag/payloadstore_test.go | 2 +- network/dag/state_test.go | 2 +- network/dag/verifier_test.go | 2 +- network/mock.go | 2 +- network/network_test.go | 2 +- network/test.go | 2 +- network/transport/connection_manager_mock.go | 2 +- network/transport/grpc/authenticator_mock.go | 2 +- network/transport/grpc/authenticator_test.go | 2 +- network/transport/grpc/config_test.go | 2 +- .../transport/grpc/connection_list_mock.go | 2 +- .../transport/grpc/connection_manager_test.go | 2 +- network/transport/grpc/connection_mock.go | 2 +- network/transport/grpc/interface_mock.go | 2 +- network/transport/grpc/stats_test.go | 2 +- network/transport/grpc/tls_offloading_test.go | 2 +- network/transport/protocol_mock.go | 2 +- network/transport/v2/gossip/mock.go | 2 +- network/transport/v2/handlers_test.go | 2 +- network/transport/v2/protocol_test.go | 2 +- network/transport/v2/senders_mock.go | 2 +- network/transport/v2/senders_test.go | 2 +- pki/mock.go | 2 +- pki/validator_test.go | 2 +- storage/engine_test.go | 2 +- storage/mock.go | 2 +- test/matchers.go | 2 +- vcr/ambassador_test.go | 2 +- vcr/api/oidc4vci/v0/holder_test.go | 2 +- vcr/api/oidc4vci/v0/issuer_test.go | 2 +- vcr/api/vcr/v2/api_test.go | 2 +- vcr/api/vcr/v2/registry_test.go | 2 +- vcr/holder/holder_test.go | 2 +- vcr/holder/mock.go | 2 +- vcr/holder/openid_mock.go | 2 +- vcr/holder/openid_test.go | 2 +- vcr/issuer/issuer_test.go | 2 +- vcr/issuer/keyresolver_test.go | 2 +- vcr/issuer/leia_store_test.go | 2 +- vcr/issuer/mock.go | 16 +++---- vcr/issuer/network_publisher_test.go | 2 +- vcr/issuer/openid_mock.go | 2 +- vcr/issuer/openid_test.go | 2 +- vcr/mock.go | 2 +- vcr/oidc4vci/identifiers_mock.go | 2 +- vcr/oidc4vci/identifiers_test.go | 2 +- vcr/oidc4vci/issuer_client_mock.go | 2 +- vcr/oidc4vci/wallet_client_mock.go | 2 +- vcr/search_test.go | 2 +- vcr/signature/mock.go | 8 ++-- vcr/signature/proof/jsonld_test.go | 2 +- vcr/store_test.go | 2 +- vcr/test.go | 2 +- vcr/types/mock.go | 2 +- vcr/vcr_test.go | 2 +- vcr/verifier/mock.go | 10 ++-- vcr/verifier/verifier_test.go | 2 +- vdr/ambassador_mock.go | 2 +- vdr/ambassador_test.go | 2 +- vdr/api/v1/api_test.go | 2 +- vdr/did_owner_test.go | 2 +- vdr/didservice/creator_test.go | 2 +- vdr/didservice/finder_test.go | 2 +- vdr/didservice/manipulator_test.go | 2 +- vdr/didservice/resolvers_mock.go | 8 ++-- vdr/didservice/resolvers_test.go | 2 +- vdr/didstore/mock.go | 2 +- vdr/didstore/writer_test.go | 2 +- vdr/types/mock.go | 2 +- vdr/validators_test.go | 2 +- vdr/vdr_test.go | 2 +- 120 files changed, 185 insertions(+), 186 deletions(-) diff --git a/audit/test.go b/audit/test.go index 8f17c1178f..a7469d5c3e 100644 --- a/audit/test.go +++ b/audit/test.go @@ -20,12 +20,12 @@ package audit import ( "context" - "github.com/golang/mock/gomock" "github.com/labstack/echo/v4" "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "strings" "testing" ) diff --git a/auth/api/auth/v1/api_test.go b/auth/api/auth/v1/api_test.go index d98ac7d4fc..25810910b6 100644 --- a/auth/api/auth/v1/api_test.go +++ b/auth/api/auth/v1/api_test.go @@ -22,7 +22,6 @@ import ( "context" "errors" "fmt" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -38,6 +37,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "net/http" "net/url" "reflect" diff --git a/auth/auth_test.go b/auth/auth_test.go index a5dc64b387..a8b2a4a401 100644 --- a/auth/auth_test.go +++ b/auth/auth_test.go @@ -19,11 +19,11 @@ package auth import ( - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vdr/didstore" + "go.uber.org/mock/gomock" "testing" "github.com/nuts-foundation/nuts-node/core" diff --git a/auth/contract/signer_mock.go b/auth/contract/signer_mock.go index ce6358fea9..2a25b7987e 100644 --- a/auth/contract/signer_mock.go +++ b/auth/contract/signer_mock.go @@ -8,8 +8,8 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" vc "github.com/nuts-foundation/go-did/vc" + gomock "go.uber.org/mock/gomock" ) // MockSigner is a mock of Signer interface. diff --git a/auth/services/irma/signer_test.go b/auth/services/irma/signer_test.go index 118434b3fc..6cba581302 100644 --- a/auth/services/irma/signer_test.go +++ b/auth/services/irma/signer_test.go @@ -30,12 +30,12 @@ import ( "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vdr" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/auth/contract" "github.com/nuts-foundation/nuts-node/auth/services" irma "github.com/privacybydesign/irmago" irmaservercore "github.com/privacybydesign/irmago/server" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestSessionPtr_MarshalJSON(t *testing.T) { diff --git a/auth/services/mock.go b/auth/services/mock.go index fd42b2a16f..768eba9d08 100644 --- a/auth/services/mock.go +++ b/auth/services/mock.go @@ -9,11 +9,11 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" did "github.com/nuts-foundation/go-did/did" vc "github.com/nuts-foundation/go-did/vc" contract "github.com/nuts-foundation/nuts-node/auth/contract" core "github.com/nuts-foundation/nuts-node/core" + gomock "go.uber.org/mock/gomock" ) // MockSignedToken is a mock of SignedToken interface. diff --git a/auth/services/notary/notary_test.go b/auth/services/notary/notary_test.go index 7fd4fb8ab0..350cc1dc40 100644 --- a/auth/services/notary/notary_test.go +++ b/auth/services/notary/notary_test.go @@ -25,7 +25,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/auth/contract" @@ -41,6 +40,7 @@ import ( irma "github.com/privacybydesign/irmago" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var orgID = vdr.TestDIDA diff --git a/auth/services/oauth/authz_server_test.go b/auth/services/oauth/authz_server_test.go index 83fc68fc83..c19cae1449 100644 --- a/auth/services/oauth/authz_server_test.go +++ b/auth/services/oauth/authz_server_test.go @@ -31,7 +31,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/lestrrat-go/jwx/jwa" "github.com/lestrrat-go/jwx/jws" "github.com/lestrrat-go/jwx/jwt" @@ -52,6 +51,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var requesterSigningKey, _ = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) diff --git a/auth/services/oauth/mock.go b/auth/services/oauth/mock.go index 287f2d91a4..f09ac067f6 100644 --- a/auth/services/oauth/mock.go +++ b/auth/services/oauth/mock.go @@ -9,8 +9,8 @@ import ( url "net/url" reflect "reflect" - gomock "github.com/golang/mock/gomock" services "github.com/nuts-foundation/nuts-node/auth/services" + gomock "go.uber.org/mock/gomock" ) // MockRelyingParty is a mock of RelyingParty interface. diff --git a/auth/services/oauth/relying_party_test.go b/auth/services/oauth/relying_party_test.go index 688005a60b..84c83cbfe0 100644 --- a/auth/services/oauth/relying_party_test.go +++ b/auth/services/oauth/relying_party_test.go @@ -31,7 +31,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -44,6 +43,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestRelyingParty_RequestAccessToken(t *testing.T) { diff --git a/auth/services/selfsigned/signer_test.go b/auth/services/selfsigned/signer_test.go index 1cab07cda0..1b205e15cc 100644 --- a/auth/services/selfsigned/signer_test.go +++ b/auth/services/selfsigned/signer_test.go @@ -22,7 +22,6 @@ import ( "context" "encoding/json" "errors" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -35,6 +34,7 @@ import ( "github.com/nuts-foundation/nuts-node/vcr/verifier" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "os" "testing" ) diff --git a/auth/services/selfsigned/types/mock.go b/auth/services/selfsigned/types/mock.go index 6f1ad79d06..67eb86824a 100644 --- a/auth/services/selfsigned/types/mock.go +++ b/auth/services/selfsigned/types/mock.go @@ -8,7 +8,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSessionStore is a mock of SessionStore interface. diff --git a/auth/services/selfsigned/web/handler_test.go b/auth/services/selfsigned/web/handler_test.go index a5eaffc6ca..23983fe525 100644 --- a/auth/services/selfsigned/web/handler_test.go +++ b/auth/services/selfsigned/web/handler_test.go @@ -21,12 +21,12 @@ package web import ( "bytes" "fmt" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/auth/contract" "github.com/nuts-foundation/nuts-node/auth/services/selfsigned/types" "github.com/nuts-foundation/nuts-node/mock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "net/http" "testing" "time" diff --git a/auth/services/uzi/validator_test.go b/auth/services/uzi/validator_test.go index 743dff0502..dd852a14ed 100644 --- a/auth/services/uzi/validator_test.go +++ b/auth/services/uzi/validator_test.go @@ -27,8 +27,8 @@ import ( "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/auth/services" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/nuts-foundation/nuts-node/auth/contract" ) diff --git a/auth/services/x509/x509_validator_test.go b/auth/services/x509/x509_validator_test.go index 8d64f81ead..6fb4e39fdd 100644 --- a/auth/services/x509/x509_validator_test.go +++ b/auth/services/x509/x509_validator_test.go @@ -25,8 +25,8 @@ import ( "crypto/x509/pkix" "encoding/asn1" "encoding/base64" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "math/big" "testing" "time" diff --git a/auth/test.go b/auth/test.go index 2e331c9e68..51ca6515ed 100644 --- a/auth/test.go +++ b/auth/test.go @@ -21,11 +21,11 @@ package auth import ( "testing" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vdr/didstore" + "go.uber.org/mock/gomock" ) func TestConfig() Config { diff --git a/cmd/root_test.go b/cmd/root_test.go index 33bf4de365..21659fc535 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -28,10 +28,10 @@ import ( "path" "testing" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/test/io" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_rootCmd(t *testing.T) { diff --git a/core/echo_mock.go b/core/echo_mock.go index 480857ca36..47bcdafe46 100644 --- a/core/echo_mock.go +++ b/core/echo_mock.go @@ -7,8 +7,8 @@ package core import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - echo "github.com/labstack/echo/v4" + v4 "github.com/labstack/echo/v4" + gomock "go.uber.org/mock/gomock" ) // MockEchoRouter is a mock of EchoRouter interface. @@ -35,14 +35,14 @@ func (m *MockEchoRouter) EXPECT() *MockEchoRouterMockRecorder { } // Add mocks base method. -func (m *MockEchoRouter) Add(method, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route { +func (m *MockEchoRouter) Add(method, path string, handler v4.HandlerFunc, middleware ...v4.MiddlewareFunc) *v4.Route { m.ctrl.T.Helper() varargs := []interface{}{method, path, handler} for _, a := range middleware { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "Add", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -54,14 +54,14 @@ func (mr *MockEchoRouterMockRecorder) Add(method, path, handler interface{}, mid } // CONNECT mocks base method. -func (m_2 *MockEchoRouter) CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) CONNECT(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "CONNECT", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -73,14 +73,14 @@ func (mr *MockEchoRouterMockRecorder) CONNECT(path, h interface{}, m ...interfac } // DELETE mocks base method. -func (m_2 *MockEchoRouter) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) DELETE(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "DELETE", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -92,14 +92,14 @@ func (mr *MockEchoRouterMockRecorder) DELETE(path, h interface{}, m ...interface } // GET mocks base method. -func (m_2 *MockEchoRouter) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) GET(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "GET", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -111,14 +111,14 @@ func (mr *MockEchoRouterMockRecorder) GET(path, h interface{}, m ...interface{}) } // HEAD mocks base method. -func (m_2 *MockEchoRouter) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) HEAD(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "HEAD", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -130,14 +130,14 @@ func (mr *MockEchoRouterMockRecorder) HEAD(path, h interface{}, m ...interface{} } // OPTIONS mocks base method. -func (m_2 *MockEchoRouter) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) OPTIONS(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "OPTIONS", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -149,14 +149,14 @@ func (mr *MockEchoRouterMockRecorder) OPTIONS(path, h interface{}, m ...interfac } // PATCH mocks base method. -func (m_2 *MockEchoRouter) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) PATCH(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "PATCH", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -168,14 +168,14 @@ func (mr *MockEchoRouterMockRecorder) PATCH(path, h interface{}, m ...interface{ } // POST mocks base method. -func (m_2 *MockEchoRouter) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) POST(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "POST", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -187,14 +187,14 @@ func (mr *MockEchoRouterMockRecorder) POST(path, h interface{}, m ...interface{} } // PUT mocks base method. -func (m_2 *MockEchoRouter) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) PUT(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "PUT", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -206,14 +206,14 @@ func (mr *MockEchoRouterMockRecorder) PUT(path, h interface{}, m ...interface{}) } // TRACE mocks base method. -func (m_2 *MockEchoRouter) TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoRouter) TRACE(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "TRACE", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -225,7 +225,7 @@ func (mr *MockEchoRouterMockRecorder) TRACE(path, h interface{}, m ...interface{ } // Use mocks base method. -func (m *MockEchoRouter) Use(middleware ...echo.MiddlewareFunc) { +func (m *MockEchoRouter) Use(middleware ...v4.MiddlewareFunc) { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range middleware { diff --git a/core/engine_mock.go b/core/engine_mock.go index 2fbd1d620d..2cb0884c94 100644 --- a/core/engine_mock.go +++ b/core/engine_mock.go @@ -7,7 +7,7 @@ package core import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockRoutable is a mock of Routable interface. diff --git a/core/engine_test.go b/core/engine_test.go index 467012ae64..394d16a59c 100644 --- a/core/engine_test.go +++ b/core/engine_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/require" "testing" - "github.com/golang/mock/gomock" "github.com/spf13/pflag" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestNewSystem(t *testing.T) { diff --git a/core/landingpage_test.go b/core/landingpage_test.go index 972d43a955..3f44644583 100644 --- a/core/landingpage_test.go +++ b/core/landingpage_test.go @@ -19,7 +19,7 @@ package core import ( - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "testing" ) diff --git a/core/status/engine_test.go b/core/status/engine_test.go index b61e38f00f..3fa6f6a6db 100644 --- a/core/status/engine_test.go +++ b/core/status/engine_test.go @@ -19,11 +19,11 @@ package status import ( - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/mock" "github.com/nuts-foundation/nuts-node/test" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "net/http" "testing" ) diff --git a/crypto/api/v1/api_test.go b/crypto/api/v1/api_test.go index 67bb07c370..7af59456b2 100644 --- a/crypto/api/v1/api_test.go +++ b/crypto/api/v1/api_test.go @@ -28,8 +28,8 @@ import ( "net/http" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/nuts-foundation/nuts-node/crypto" ) diff --git a/crypto/api/v1/generated_test.go b/crypto/api/v1/generated_test.go index 9265f4858a..c4bd572559 100644 --- a/crypto/api/v1/generated_test.go +++ b/crypto/api/v1/generated_test.go @@ -26,9 +26,9 @@ import ( "github.com/nuts-foundation/nuts-node/core" - "github.com/golang/mock/gomock" "github.com/labstack/echo/v4" "github.com/magiconair/properties/assert" + "go.uber.org/mock/gomock" ) type testServerInterface struct { diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index c0109e026a..cf922ecf62 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -32,7 +32,7 @@ import ( "reflect" "testing" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/nuts-foundation/nuts-node/test/io" diff --git a/crypto/hash/test.go b/crypto/hash/test.go index f82f4f4cb2..639700967a 100644 --- a/crypto/hash/test.go +++ b/crypto/hash/test.go @@ -19,7 +19,7 @@ package hash import ( - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "math/rand" ) diff --git a/crypto/mock.go b/crypto/mock.go index 8070f6f64c..623701a94c 100644 --- a/crypto/mock.go +++ b/crypto/mock.go @@ -9,7 +9,7 @@ import ( crypto "crypto" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockKeyCreator is a mock of KeyCreator interface. diff --git a/crypto/storage/spi/mock.go b/crypto/storage/spi/mock.go index eec948c77e..12f583abc5 100644 --- a/crypto/storage/spi/mock.go +++ b/crypto/storage/spi/mock.go @@ -9,8 +9,8 @@ import ( crypto "crypto" reflect "reflect" - gomock "github.com/golang/mock/gomock" core "github.com/nuts-foundation/nuts-node/core" + gomock "go.uber.org/mock/gomock" ) // MockStorage is a mock of Storage interface. diff --git a/crypto/storage/spi/wrapper_test.go b/crypto/storage/spi/wrapper_test.go index 09260ad068..e3bf4e8afc 100644 --- a/crypto/storage/spi/wrapper_test.go +++ b/crypto/storage/spi/wrapper_test.go @@ -20,8 +20,8 @@ package spi import ( "context" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "regexp" "testing" ) diff --git a/didman/api/v1/api_test.go b/didman/api/v1/api_test.go index c9279c62a1..671005a27f 100644 --- a/didman/api/v1/api_test.go +++ b/didman/api/v1/api_test.go @@ -27,7 +27,6 @@ import ( "net/url" "testing" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/core" @@ -36,6 +35,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestWrapper_AddEndpoint(t *testing.T) { diff --git a/didman/didman_test.go b/didman/didman_test.go index 74f2f21dd4..fd963e0bc1 100644 --- a/didman/didman_test.go +++ b/didman/didman_test.go @@ -31,7 +31,6 @@ import ( "sync" "testing" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -45,6 +44,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var testDIDA = vdr.TestDIDA diff --git a/didman/mock.go b/didman/mock.go index 030834cb86..e23e044deb 100644 --- a/didman/mock.go +++ b/didman/mock.go @@ -9,9 +9,9 @@ import ( url "net/url" reflect "reflect" - gomock "github.com/golang/mock/gomock" go_did "github.com/nuts-foundation/go-did" did "github.com/nuts-foundation/go-did/did" + gomock "go.uber.org/mock/gomock" ) // MockDidman is a mock of Didman interface. diff --git a/events/conn_test.go b/events/conn_test.go index 91541b5c6d..b3a58d36be 100644 --- a/events/conn_test.go +++ b/events/conn_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestNATSConnectionPool_Acquire(t *testing.T) { diff --git a/events/events_mock.go b/events/events_mock.go index d57c0ee5a3..82b397a938 100644 --- a/events/events_mock.go +++ b/events/events_mock.go @@ -7,7 +7,7 @@ package events import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockEvent is a mock of Event interface. diff --git a/events/mock.go b/events/mock.go index 545f9597c2..658b109cdd 100644 --- a/events/mock.go +++ b/events/mock.go @@ -8,8 +8,8 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" nats_go "github.com/nats-io/nats.go" + gomock "go.uber.org/mock/gomock" ) // MockConn is a mock of Conn interface. diff --git a/events/stream_test.go b/events/stream_test.go index f3935b02f3..828617152e 100644 --- a/events/stream_test.go +++ b/events/stream_test.go @@ -23,9 +23,9 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestStream_Subscribe(t *testing.T) { diff --git a/go.mod b/go.mod index 81e8190721..a81d7cb5eb 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/chromedp/chromedp v0.9.1 github.com/deepmap/oapi-codegen v1.13.0 github.com/golang-jwt/jwt v3.2.2+incompatible - github.com/golang/mock v1.6.0 github.com/goodsign/monday v1.0.1 github.com/google/uuid v1.3.0 github.com/hashicorp/vault/api v1.9.2 @@ -23,7 +22,7 @@ require ( github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b github.com/nuts-foundation/go-did v0.5.1 github.com/nuts-foundation/go-leia/v3 v3.3.0 - github.com/nuts-foundation/go-stoabs v1.8.1 + github.com/nuts-foundation/go-stoabs v1.9.0 github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f github.com/privacybydesign/irmago v0.12.6 github.com/prometheus/client_golang v1.16.0 @@ -38,6 +37,7 @@ require ( go.etcd.io/bbolt v1.3.7 go.uber.org/atomic v1.11.0 go.uber.org/goleak v1.2.1 + go.uber.org/mock v0.1.0 golang.org/x/crypto v0.10.0 golang.org/x/time v0.3.0 google.golang.org/grpc v1.56.1 diff --git a/go.sum b/go.sum index 56532e5757..6d78bc4471 100644 --- a/go.sum +++ b/go.sum @@ -200,8 +200,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -455,8 +453,8 @@ github.com/nuts-foundation/go-did v0.5.1 h1:akc4OzNGHdnliJFoxnnSmUI7j1yKz/BHNi6s github.com/nuts-foundation/go-did v0.5.1/go.mod h1:Aw1pIRyB9naQ8z/dc4rrPhn+nHx5LUcGysBGlezL528= github.com/nuts-foundation/go-leia/v3 v3.3.0 h1:d0AIihk8nF6QCMpA9I01ZS+pp+GCgoJhblTNkyIZz40= github.com/nuts-foundation/go-leia/v3 v3.3.0/go.mod h1:Md202F2wpwkXGtOUzyqs0p1Y96+wOY8lpmDT9nuaxE0= -github.com/nuts-foundation/go-stoabs v1.8.1 h1:I6sS6eGBAltzpmN0IA78M4DqrPolzHUWp+1q7hAM0Uo= -github.com/nuts-foundation/go-stoabs v1.8.1/go.mod h1:LJ1+o9NehLuT2giEzeQdbqsIAqzrQVWYGo8oBwZKTZw= +github.com/nuts-foundation/go-stoabs v1.9.0 h1:zK+ugfolaJYyBvGwsRuavLVdycXk4Yw/1gI+tz17lWQ= +github.com/nuts-foundation/go-stoabs v1.9.0/go.mod h1:htbUqSZiaihqAvJfHwtAbQusGaJtIeWpm1pmKjBYXlM= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -621,6 +619,8 @@ go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/mock v0.1.0 h1:NEVjcPIj/L96qilPi+2M5l9zUkQksRaqNKphz3pStHI= +go.uber.org/mock v0.1.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -787,7 +787,6 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= diff --git a/http/echo_mock.go b/http/echo_mock.go index dd8932af1f..fc52a3ca7f 100644 --- a/http/echo_mock.go +++ b/http/echo_mock.go @@ -8,8 +8,8 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" - echo "github.com/labstack/echo/v4" + v4 "github.com/labstack/echo/v4" + gomock "go.uber.org/mock/gomock" ) // MockEchoServer is a mock of EchoServer interface. @@ -36,14 +36,14 @@ func (m *MockEchoServer) EXPECT() *MockEchoServerMockRecorder { } // Add mocks base method. -func (m *MockEchoServer) Add(method, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route { +func (m *MockEchoServer) Add(method, path string, handler v4.HandlerFunc, middleware ...v4.MiddlewareFunc) *v4.Route { m.ctrl.T.Helper() varargs := []interface{}{method, path, handler} for _, a := range middleware { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "Add", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -55,14 +55,14 @@ func (mr *MockEchoServerMockRecorder) Add(method, path, handler interface{}, mid } // CONNECT mocks base method. -func (m_2 *MockEchoServer) CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) CONNECT(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "CONNECT", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -74,14 +74,14 @@ func (mr *MockEchoServerMockRecorder) CONNECT(path, h interface{}, m ...interfac } // DELETE mocks base method. -func (m_2 *MockEchoServer) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) DELETE(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "DELETE", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -93,14 +93,14 @@ func (mr *MockEchoServerMockRecorder) DELETE(path, h interface{}, m ...interface } // GET mocks base method. -func (m_2 *MockEchoServer) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) GET(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "GET", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -112,14 +112,14 @@ func (mr *MockEchoServerMockRecorder) GET(path, h interface{}, m ...interface{}) } // HEAD mocks base method. -func (m_2 *MockEchoServer) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) HEAD(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "HEAD", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -131,14 +131,14 @@ func (mr *MockEchoServerMockRecorder) HEAD(path, h interface{}, m ...interface{} } // OPTIONS mocks base method. -func (m_2 *MockEchoServer) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) OPTIONS(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "OPTIONS", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -150,14 +150,14 @@ func (mr *MockEchoServerMockRecorder) OPTIONS(path, h interface{}, m ...interfac } // PATCH mocks base method. -func (m_2 *MockEchoServer) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) PATCH(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "PATCH", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -169,14 +169,14 @@ func (mr *MockEchoServerMockRecorder) PATCH(path, h interface{}, m ...interface{ } // POST mocks base method. -func (m_2 *MockEchoServer) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) POST(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "POST", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -188,14 +188,14 @@ func (mr *MockEchoServerMockRecorder) POST(path, h interface{}, m ...interface{} } // PUT mocks base method. -func (m_2 *MockEchoServer) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) PUT(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "PUT", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -235,14 +235,14 @@ func (mr *MockEchoServerMockRecorder) Start(address interface{}) *gomock.Call { } // TRACE mocks base method. -func (m_2 *MockEchoServer) TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route { +func (m_2 *MockEchoServer) TRACE(path string, h v4.HandlerFunc, m ...v4.MiddlewareFunc) *v4.Route { m_2.ctrl.T.Helper() varargs := []interface{}{path, h} for _, a := range m { varargs = append(varargs, a) } ret := m_2.ctrl.Call(m_2, "TRACE", varargs...) - ret0, _ := ret[0].(*echo.Route) + ret0, _ := ret[0].(*v4.Route) return ret0 } @@ -254,7 +254,7 @@ func (mr *MockEchoServerMockRecorder) TRACE(path, h interface{}, m ...interface{ } // Use mocks base method. -func (m *MockEchoServer) Use(middleware ...echo.MiddlewareFunc) { +func (m *MockEchoServer) Use(middleware ...v4.MiddlewareFunc) { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range middleware { diff --git a/http/echo_test.go b/http/echo_test.go index 9a232ac333..cb353773b4 100644 --- a/http/echo_test.go +++ b/http/echo_test.go @@ -20,10 +20,10 @@ package http import ( "errors" - "github.com/golang/mock/gomock" "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "net/http" "testing" ) diff --git a/http/engine_test.go b/http/engine_test.go index 399e8ef45f..1e7f244e01 100644 --- a/http/engine_test.go +++ b/http/engine_test.go @@ -37,7 +37,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/labstack/echo/v4" "github.com/lestrrat-go/jwx/jwa" @@ -51,6 +50,7 @@ import ( "github.com/sirupsen/logrus/hooks/writer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "golang.org/x/crypto/ssh" ) diff --git a/http/requestlogger_test.go b/http/requestlogger_test.go index 88c546f772..0b0afbd265 100644 --- a/http/requestlogger_test.go +++ b/http/requestlogger_test.go @@ -21,13 +21,13 @@ package http import ( "bytes" "errors" - "github.com/golang/mock/gomock" "github.com/labstack/echo/v4" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/mock" "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "net/http" "net/http/httptest" "testing" diff --git a/makefile b/makefile index 49d9f0df97..f7f14b1f73 100644 --- a/makefile +++ b/makefile @@ -4,7 +4,7 @@ run-generators: gen-mocks gen-api gen-protobuf install-tools: go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.13.0 - go install github.com/golang/mock/mockgen@v1.6.0 + go install go.uber.org/mock/mockgen@v0.1.0 go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0 diff --git a/mock/mock_echo.go b/mock/mock_echo.go index 3a50084730..4626c80d22 100644 --- a/mock/mock_echo.go +++ b/mock/mock_echo.go @@ -11,7 +11,7 @@ import ( url "net/url" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" v4 "github.com/labstack/echo/v4" ) diff --git a/network/api/v1/api_test.go b/network/api/v1/api_test.go index 77830ed8f8..344c35b08d 100644 --- a/network/api/v1/api_test.go +++ b/network/api/v1/api_test.go @@ -29,11 +29,11 @@ import ( "github.com/nuts-foundation/nuts-node/network/transport" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/crypto/hash" "github.com/nuts-foundation/nuts-node/network" "github.com/nuts-foundation/nuts-node/network/dag" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) var payload = []byte("Hello, World!") diff --git a/network/dag/mock.go b/network/dag/mock.go index 71470bfb0b..c195cef8c2 100644 --- a/network/dag/mock.go +++ b/network/dag/mock.go @@ -8,11 +8,11 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" go_stoabs "github.com/nuts-foundation/go-stoabs" core "github.com/nuts-foundation/nuts-node/core" hash "github.com/nuts-foundation/nuts-node/crypto/hash" tree "github.com/nuts-foundation/nuts-node/network/dag/tree" + gomock "go.uber.org/mock/gomock" ) // MockState is a mock of State interface. diff --git a/network/dag/notifier_mock.go b/network/dag/notifier_mock.go index 37b31d8dac..267152bbd5 100644 --- a/network/dag/notifier_mock.go +++ b/network/dag/notifier_mock.go @@ -7,9 +7,9 @@ package dag import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" go_stoabs "github.com/nuts-foundation/go-stoabs" hash "github.com/nuts-foundation/nuts-node/crypto/hash" + gomock "go.uber.org/mock/gomock" ) // MockNotifier is a mock of Notifier interface. diff --git a/network/dag/notifier_test.go b/network/dag/notifier_test.go index f3a419fe25..72197f98db 100644 --- a/network/dag/notifier_test.go +++ b/network/dag/notifier_test.go @@ -23,7 +23,6 @@ import ( "context" "encoding/json" "errors" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/go-stoabs/bbolt" "github.com/nuts-foundation/nuts-node/crypto/hash" @@ -33,6 +32,7 @@ import ( io_prometheus_client "github.com/prometheus/client_model/go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "path" "sync/atomic" "testing" diff --git a/network/dag/pal_test.go b/network/dag/pal_test.go index 8b8fe01af2..3b66a3f126 100644 --- a/network/dag/pal_test.go +++ b/network/dag/pal_test.go @@ -27,11 +27,11 @@ import ( "github.com/stretchr/testify/require" "testing" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestEncryptPal(t *testing.T) { diff --git a/network/dag/payloadstore_test.go b/network/dag/payloadstore_test.go index e948895660..2445049707 100644 --- a/network/dag/payloadstore_test.go +++ b/network/dag/payloadstore_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/require" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/crypto/hash" diff --git a/network/dag/state_test.go b/network/dag/state_test.go index 1f3ad3c24d..a7317470e0 100644 --- a/network/dag/state_test.go +++ b/network/dag/state_test.go @@ -24,12 +24,12 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/test" io_prometheus_client "github.com/prometheus/client_model/go" "github.com/stretchr/testify/require" "go.uber.org/atomic" + "go.uber.org/mock/gomock" "math" "path/filepath" "sort" diff --git a/network/dag/verifier_test.go b/network/dag/verifier_test.go index b31ec3f1b1..3ba628fc33 100644 --- a/network/dag/verifier_test.go +++ b/network/dag/verifier_test.go @@ -29,7 +29,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/lestrrat-go/jwx/jwk" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" @@ -38,6 +37,7 @@ import ( "github.com/nuts-foundation/nuts-node/crypto/hash" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_PrevTransactionVerifier(t *testing.T) { diff --git a/network/mock.go b/network/mock.go index 8dd31644a6..76eaf13b69 100644 --- a/network/mock.go +++ b/network/mock.go @@ -8,11 +8,11 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" did "github.com/nuts-foundation/go-did/did" hash "github.com/nuts-foundation/nuts-node/crypto/hash" dag "github.com/nuts-foundation/nuts-node/network/dag" transport "github.com/nuts-foundation/nuts-node/network/transport" + gomock "go.uber.org/mock/gomock" ) // MockTransactions is a mock of Transactions interface. diff --git a/network/network_test.go b/network/network_test.go index 0def6a650c..e9a0465ee1 100644 --- a/network/network_test.go +++ b/network/network_test.go @@ -37,7 +37,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nats-io/nats.go" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-stoabs" @@ -55,6 +54,7 @@ import ( vdrTypes "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var nodeDID, _ = did.ParseDID("did:nuts:test") diff --git a/network/test.go b/network/test.go index 1c6259b232..23bf05ccee 100644 --- a/network/test.go +++ b/network/test.go @@ -21,7 +21,6 @@ package network import ( "testing" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/events" @@ -31,6 +30,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/didservice" "github.com/nuts-foundation/nuts-node/vdr/didstore" "github.com/sirupsen/logrus" + "go.uber.org/mock/gomock" ) // NewTestNetworkInstance creates a new Transactions instance that writes it data to a test directory. diff --git a/network/transport/connection_manager_mock.go b/network/transport/connection_manager_mock.go index 884fb24a39..37e1631986 100644 --- a/network/transport/connection_manager_mock.go +++ b/network/transport/connection_manager_mock.go @@ -8,9 +8,9 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" did "github.com/nuts-foundation/go-did/did" core "github.com/nuts-foundation/nuts-node/core" + gomock "go.uber.org/mock/gomock" ) // MockConnectionManager is a mock of ConnectionManager interface. diff --git a/network/transport/grpc/authenticator_mock.go b/network/transport/grpc/authenticator_mock.go index 334ddac907..f148eb12ed 100644 --- a/network/transport/grpc/authenticator_mock.go +++ b/network/transport/grpc/authenticator_mock.go @@ -7,9 +7,9 @@ package grpc import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" did "github.com/nuts-foundation/go-did/did" transport "github.com/nuts-foundation/nuts-node/network/transport" + gomock "go.uber.org/mock/gomock" ) // MockAuthenticator is a mock of Authenticator interface. diff --git a/network/transport/grpc/authenticator_test.go b/network/transport/grpc/authenticator_test.go index d718b905e1..37c93f8276 100644 --- a/network/transport/grpc/authenticator_test.go +++ b/network/transport/grpc/authenticator_test.go @@ -25,12 +25,12 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/network/transport" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_tlsAuthenticator_Authenticate(t *testing.T) { diff --git a/network/transport/grpc/config_test.go b/network/transport/grpc/config_test.go index 8a054ba86a..1afb50f3dc 100644 --- a/network/transport/grpc/config_test.go +++ b/network/transport/grpc/config_test.go @@ -20,13 +20,13 @@ package grpc import ( "crypto/x509" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/network/transport" "github.com/nuts-foundation/nuts-node/pki" testPKI "github.com/nuts-foundation/nuts-node/test/pki" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "testing" ) diff --git a/network/transport/grpc/connection_list_mock.go b/network/transport/grpc/connection_list_mock.go index 44f6c47292..7a2c6c779a 100644 --- a/network/transport/grpc/connection_list_mock.go +++ b/network/transport/grpc/connection_list_mock.go @@ -7,7 +7,7 @@ package grpc import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockConnectionList is a mock of ConnectionList interface. diff --git a/network/transport/grpc/connection_manager_test.go b/network/transport/grpc/connection_manager_test.go index dd23909772..acc5080394 100644 --- a/network/transport/grpc/connection_manager_test.go +++ b/network/transport/grpc/connection_manager_test.go @@ -37,7 +37,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/network/transport" @@ -45,6 +44,7 @@ import ( "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/test" io2 "github.com/nuts-foundation/nuts-node/test/io" + "go.uber.org/mock/gomock" io_prometheus_client "github.com/prometheus/client_model/go" "github.com/stretchr/testify/assert" diff --git a/network/transport/grpc/connection_mock.go b/network/transport/grpc/connection_mock.go index 3e82610be1..777b61afdd 100644 --- a/network/transport/grpc/connection_mock.go +++ b/network/transport/grpc/connection_mock.go @@ -7,8 +7,8 @@ package grpc import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" transport "github.com/nuts-foundation/nuts-node/network/transport" + gomock "go.uber.org/mock/gomock" status "google.golang.org/grpc/status" ) diff --git a/network/transport/grpc/interface_mock.go b/network/transport/grpc/interface_mock.go index a4d81e98b2..e039807319 100644 --- a/network/transport/grpc/interface_mock.go +++ b/network/transport/grpc/interface_mock.go @@ -8,9 +8,9 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" core "github.com/nuts-foundation/nuts-node/core" transport "github.com/nuts-foundation/nuts-node/network/transport" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" metadata "google.golang.org/grpc/metadata" ) diff --git a/network/transport/grpc/stats_test.go b/network/transport/grpc/stats_test.go index c1d855fe9a..b98e059c4c 100644 --- a/network/transport/grpc/stats_test.go +++ b/network/transport/grpc/stats_test.go @@ -20,11 +20,11 @@ package grpc import ( "errors" - "github.com/golang/mock/gomock" "github.com/magiconair/properties/assert" "github.com/nuts-foundation/nuts-node/network/transport" "github.com/prometheus/client_golang/prometheus" io_prometheus_client "github.com/prometheus/client_model/go" + "go.uber.org/mock/gomock" "testing" ) diff --git a/network/transport/grpc/tls_offloading_test.go b/network/transport/grpc/tls_offloading_test.go index f84df203f4..810373f59e 100644 --- a/network/transport/grpc/tls_offloading_test.go +++ b/network/transport/grpc/tls_offloading_test.go @@ -21,9 +21,9 @@ package grpc import ( "context" "errors" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/pki" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" diff --git a/network/transport/protocol_mock.go b/network/transport/protocol_mock.go index 9cdad2d8c0..6be3b80aa3 100644 --- a/network/transport/protocol_mock.go +++ b/network/transport/protocol_mock.go @@ -7,8 +7,8 @@ package transport import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" core "github.com/nuts-foundation/nuts-node/core" + gomock "go.uber.org/mock/gomock" ) // MockProtocol is a mock of Protocol interface. diff --git a/network/transport/v2/gossip/mock.go b/network/transport/v2/gossip/mock.go index 511bec1d86..f3950c05ba 100644 --- a/network/transport/v2/gossip/mock.go +++ b/network/transport/v2/gossip/mock.go @@ -7,9 +7,9 @@ package gossip import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" hash "github.com/nuts-foundation/nuts-node/crypto/hash" transport "github.com/nuts-foundation/nuts-node/network/transport" + gomock "go.uber.org/mock/gomock" ) // MockManager is a mock of Manager interface. diff --git a/network/transport/v2/handlers_test.go b/network/transport/v2/handlers_test.go index f1c2b92518..efad8be8aa 100644 --- a/network/transport/v2/handlers_test.go +++ b/network/transport/v2/handlers_test.go @@ -26,10 +26,10 @@ import ( "github.com/nuts-foundation/nuts-node/network/dag/tree" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/network/transport/grpc" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/nuts-foundation/nuts-node/crypto/hash" "github.com/nuts-foundation/nuts-node/network/dag" diff --git a/network/transport/v2/protocol_test.go b/network/transport/v2/protocol_test.go index 2aef4c74d3..e84a299767 100644 --- a/network/transport/v2/protocol_test.go +++ b/network/transport/v2/protocol_test.go @@ -30,11 +30,11 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/network/transport/v2/gossip" "github.com/nuts-foundation/nuts-node/test/io" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" grpcLib "google.golang.org/grpc" "github.com/nuts-foundation/nuts-node/core" diff --git a/network/transport/v2/senders_mock.go b/network/transport/v2/senders_mock.go index b6fc542ff7..7d64b02a79 100644 --- a/network/transport/v2/senders_mock.go +++ b/network/transport/v2/senders_mock.go @@ -7,11 +7,11 @@ package v2 import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" hash "github.com/nuts-foundation/nuts-node/crypto/hash" tree "github.com/nuts-foundation/nuts-node/network/dag/tree" transport "github.com/nuts-foundation/nuts-node/network/transport" grpc "github.com/nuts-foundation/nuts-node/network/transport/grpc" + gomock "go.uber.org/mock/gomock" ) // MockmessageSender is a mock of messageSender interface. diff --git a/network/transport/v2/senders_test.go b/network/transport/v2/senders_test.go index c63f34af25..8739d667e6 100644 --- a/network/transport/v2/senders_test.go +++ b/network/transport/v2/senders_test.go @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "google.golang.org/protobuf/proto" "github.com/nuts-foundation/nuts-node/crypto/hash" diff --git a/pki/mock.go b/pki/mock.go index cfd13b1414..a59e3cbe52 100644 --- a/pki/mock.go +++ b/pki/mock.go @@ -10,8 +10,8 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" core "github.com/nuts-foundation/nuts-node/core" + gomock "go.uber.org/mock/gomock" ) // MockDenylist is a mock of Denylist interface. diff --git a/pki/validator_test.go b/pki/validator_test.go index 528b1f0a31..f4dc6a1778 100644 --- a/pki/validator_test.go +++ b/pki/validator_test.go @@ -27,9 +27,9 @@ import ( "crypto/x509" "encoding/pem" "errors" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/core" "go.uber.org/goleak" + "go.uber.org/mock/gomock" "math/big" "net/http" "os" diff --git a/storage/engine_test.go b/storage/engine_test.go index 28b8c95a82..5a4edb660a 100644 --- a/storage/engine_test.go +++ b/storage/engine_test.go @@ -20,12 +20,12 @@ package storage import ( "errors" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/test/io" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "testing" ) diff --git a/storage/mock.go b/storage/mock.go index 3a50811924..c7f85c0e8a 100644 --- a/storage/mock.go +++ b/storage/mock.go @@ -7,9 +7,9 @@ package storage import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" go_stoabs "github.com/nuts-foundation/go-stoabs" core "github.com/nuts-foundation/nuts-node/core" + gomock "go.uber.org/mock/gomock" ) // MockEngine is a mock of Engine interface. diff --git a/test/matchers.go b/test/matchers.go index d442857a27..324328337d 100644 --- a/test/matchers.go +++ b/test/matchers.go @@ -20,7 +20,7 @@ package test import ( "fmt" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "strings" ) diff --git a/vcr/ambassador_test.go b/vcr/ambassador_test.go index d525890f73..206888a40d 100644 --- a/vcr/ambassador_test.go +++ b/vcr/ambassador_test.go @@ -32,7 +32,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/crypto/hash" @@ -46,6 +45,7 @@ import ( "github.com/nuts-foundation/nuts-node/vcr/types" "github.com/nuts-foundation/nuts-node/vcr/verifier" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestNewAmbassador(t *testing.T) { diff --git a/vcr/api/oidc4vci/v0/holder_test.go b/vcr/api/oidc4vci/v0/holder_test.go index 9c53ee6414..0fb515d4a5 100644 --- a/vcr/api/oidc4vci/v0/holder_test.go +++ b/vcr/api/oidc4vci/v0/holder_test.go @@ -21,7 +21,6 @@ package v0 import ( "context" "encoding/json" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vcr/holder" @@ -29,6 +28,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "testing" ) diff --git a/vcr/api/oidc4vci/v0/issuer_test.go b/vcr/api/oidc4vci/v0/issuer_test.go index e052814623..192b4b13ef 100644 --- a/vcr/api/oidc4vci/v0/issuer_test.go +++ b/vcr/api/oidc4vci/v0/issuer_test.go @@ -20,7 +20,6 @@ package v0 import ( "context" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/vcr" @@ -29,6 +28,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "net/http" "testing" ) diff --git a/vcr/api/vcr/v2/api_test.go b/vcr/api/vcr/v2/api_test.go index c97aeac59b..a31e60a665 100644 --- a/vcr/api/vcr/v2/api_test.go +++ b/vcr/api/vcr/v2/api_test.go @@ -27,7 +27,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -43,6 +42,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestWrapper_IssueVC(t *testing.T) { diff --git a/vcr/api/vcr/v2/registry_test.go b/vcr/api/vcr/v2/registry_test.go index 3361bafc9f..68d7ee2cc2 100644 --- a/vcr/api/vcr/v2/registry_test.go +++ b/vcr/api/vcr/v2/registry_test.go @@ -29,8 +29,8 @@ import ( "github.com/stretchr/testify/require" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) const organizationQuery = ` diff --git a/vcr/holder/holder_test.go b/vcr/holder/holder_test.go index 882ccfa6df..cc5b0c9dd7 100644 --- a/vcr/holder/holder_test.go +++ b/vcr/holder/holder_test.go @@ -27,7 +27,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/crypto" @@ -37,6 +36,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) var testDID = vdr.TestDIDA diff --git a/vcr/holder/mock.go b/vcr/holder/mock.go index 1b8803ff90..0aef9b7ae3 100644 --- a/vcr/holder/mock.go +++ b/vcr/holder/mock.go @@ -8,9 +8,9 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" did "github.com/nuts-foundation/go-did/did" vc "github.com/nuts-foundation/go-did/vc" + gomock "go.uber.org/mock/gomock" ) // MockHolder is a mock of Holder interface. diff --git a/vcr/holder/openid_mock.go b/vcr/holder/openid_mock.go index 027c5b04eb..f72b598bb8 100644 --- a/vcr/holder/openid_mock.go +++ b/vcr/holder/openid_mock.go @@ -8,8 +8,8 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" oidc4vci "github.com/nuts-foundation/nuts-node/vcr/oidc4vci" + gomock "go.uber.org/mock/gomock" ) // MockOpenIDHandler is a mock of OpenIDHandler interface. diff --git a/vcr/holder/openid_test.go b/vcr/holder/openid_test.go index 619087f640..3b0ece5906 100644 --- a/vcr/holder/openid_test.go +++ b/vcr/holder/openid_test.go @@ -21,7 +21,6 @@ package holder import ( "context" "errors" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -34,6 +33,7 @@ import ( vdrTypes "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "net/http" "testing" "time" diff --git a/vcr/issuer/issuer_test.go b/vcr/issuer/issuer_test.go index b63226c42b..d026fdbe67 100644 --- a/vcr/issuer/issuer_test.go +++ b/vcr/issuer/issuer_test.go @@ -31,9 +31,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" diff --git a/vcr/issuer/keyresolver_test.go b/vcr/issuer/keyresolver_test.go index 342804feeb..47b0b53cf1 100644 --- a/vcr/issuer/keyresolver_test.go +++ b/vcr/issuer/keyresolver_test.go @@ -21,13 +21,13 @@ package issuer import ( "context" "errors" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "testing" ) diff --git a/vcr/issuer/leia_store_test.go b/vcr/issuer/leia_store_test.go index 849637bc1d..8ec17da6e2 100644 --- a/vcr/issuer/leia_store_test.go +++ b/vcr/issuer/leia_store_test.go @@ -24,11 +24,11 @@ import ( "encoding/json" "errors" "fmt" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/go-stoabs/bbolt" "github.com/nuts-foundation/nuts-node/vcr/types" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "path" "testing" diff --git a/vcr/issuer/mock.go b/vcr/issuer/mock.go index 3b099bf252..4686da0f8e 100644 --- a/vcr/issuer/mock.go +++ b/vcr/issuer/mock.go @@ -8,13 +8,13 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" - ssi "github.com/nuts-foundation/go-did" + go_did "github.com/nuts-foundation/go-did" did "github.com/nuts-foundation/go-did/did" vc "github.com/nuts-foundation/go-did/vc" core "github.com/nuts-foundation/nuts-node/core" crypto "github.com/nuts-foundation/nuts-node/crypto" credential "github.com/nuts-foundation/nuts-node/vcr/credential" + gomock "go.uber.org/mock/gomock" ) // MockPublisher is a mock of Publisher interface. @@ -145,7 +145,7 @@ func (mr *MockIssuerMockRecorder) Issue(ctx, unsignedCredential, publish, public } // Revoke mocks base method. -func (m *MockIssuer) Revoke(ctx context.Context, credentialID ssi.URI) (*credential.Revocation, error) { +func (m *MockIssuer) Revoke(ctx context.Context, credentialID go_did.URI) (*credential.Revocation, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Revoke", ctx, credentialID) ret0, _ := ret[0].(*credential.Revocation) @@ -160,7 +160,7 @@ func (mr *MockIssuerMockRecorder) Revoke(ctx, credentialID interface{}) *gomock. } // SearchCredential mocks base method. -func (m *MockIssuer) SearchCredential(credentialType ssi.URI, issuer did.DID, subject *ssi.URI) ([]vc.VerifiableCredential, error) { +func (m *MockIssuer) SearchCredential(credentialType go_did.URI, issuer did.DID, subject *go_did.URI) ([]vc.VerifiableCredential, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SearchCredential", credentialType, issuer, subject) ret0, _ := ret[0].([]vc.VerifiableCredential) @@ -226,7 +226,7 @@ func (mr *MockStoreMockRecorder) Diagnostics() *gomock.Call { } // GetCredential mocks base method. -func (m *MockStore) GetCredential(id ssi.URI) (*vc.VerifiableCredential, error) { +func (m *MockStore) GetCredential(id go_did.URI) (*vc.VerifiableCredential, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetCredential", id) ret0, _ := ret[0].(*vc.VerifiableCredential) @@ -241,7 +241,7 @@ func (mr *MockStoreMockRecorder) GetCredential(id interface{}) *gomock.Call { } // GetRevocation mocks base method. -func (m *MockStore) GetRevocation(id ssi.URI) (*credential.Revocation, error) { +func (m *MockStore) GetRevocation(id go_did.URI) (*credential.Revocation, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRevocation", id) ret0, _ := ret[0].(*credential.Revocation) @@ -256,7 +256,7 @@ func (mr *MockStoreMockRecorder) GetRevocation(id interface{}) *gomock.Call { } // SearchCredential mocks base method. -func (m *MockStore) SearchCredential(credentialType ssi.URI, issuer did.DID, subject *ssi.URI) ([]vc.VerifiableCredential, error) { +func (m *MockStore) SearchCredential(credentialType go_did.URI, issuer did.DID, subject *go_did.URI) ([]vc.VerifiableCredential, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SearchCredential", credentialType, issuer, subject) ret0, _ := ret[0].([]vc.VerifiableCredential) @@ -322,7 +322,7 @@ func (m *MockCredentialSearcher) EXPECT() *MockCredentialSearcherMockRecorder { } // SearchCredential mocks base method. -func (m *MockCredentialSearcher) SearchCredential(credentialType ssi.URI, issuer did.DID, subject *ssi.URI) ([]vc.VerifiableCredential, error) { +func (m *MockCredentialSearcher) SearchCredential(credentialType go_did.URI, issuer did.DID, subject *go_did.URI) ([]vc.VerifiableCredential, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SearchCredential", credentialType, issuer, subject) ret0, _ := ret[0].([]vc.VerifiableCredential) diff --git a/vcr/issuer/network_publisher_test.go b/vcr/issuer/network_publisher_test.go index 30f6a266b5..2ba09fb1a8 100644 --- a/vcr/issuer/network_publisher_test.go +++ b/vcr/issuer/network_publisher_test.go @@ -22,7 +22,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -36,6 +35,7 @@ import ( vdrTypes "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "testing" "time" ) diff --git a/vcr/issuer/openid_mock.go b/vcr/issuer/openid_mock.go index 8989987d57..f36d479e82 100644 --- a/vcr/issuer/openid_mock.go +++ b/vcr/issuer/openid_mock.go @@ -8,9 +8,9 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" vc "github.com/nuts-foundation/go-did/vc" oidc4vci "github.com/nuts-foundation/nuts-node/vcr/oidc4vci" + gomock "go.uber.org/mock/gomock" ) // MockOpenIDHandler is a mock of OpenIDHandler interface. diff --git a/vcr/issuer/openid_test.go b/vcr/issuer/openid_test.go index 9040de7002..ae98fd58d5 100644 --- a/vcr/issuer/openid_test.go +++ b/vcr/issuer/openid_test.go @@ -22,7 +22,6 @@ import ( "context" crypt "crypto" "errors" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/audit" @@ -32,6 +31,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "net/http" "testing" "time" diff --git a/vcr/mock.go b/vcr/mock.go index c9eae586f6..4b5eedce39 100644 --- a/vcr/mock.go +++ b/vcr/mock.go @@ -9,13 +9,13 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" go_did "github.com/nuts-foundation/go-did" did "github.com/nuts-foundation/go-did/did" vc "github.com/nuts-foundation/go-did/vc" holder "github.com/nuts-foundation/nuts-node/vcr/holder" issuer "github.com/nuts-foundation/nuts-node/vcr/issuer" verifier "github.com/nuts-foundation/nuts-node/vcr/verifier" + gomock "go.uber.org/mock/gomock" ) // MockFinder is a mock of Finder interface. diff --git a/vcr/oidc4vci/identifiers_mock.go b/vcr/oidc4vci/identifiers_mock.go index 2910606730..a4a15c0591 100644 --- a/vcr/oidc4vci/identifiers_mock.go +++ b/vcr/oidc4vci/identifiers_mock.go @@ -7,8 +7,8 @@ package oidc4vci import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" did "github.com/nuts-foundation/go-did/did" + gomock "go.uber.org/mock/gomock" ) // MockIdentifierResolver is a mock of IdentifierResolver interface. diff --git a/vcr/oidc4vci/identifiers_test.go b/vcr/oidc4vci/identifiers_test.go index 7e7d5275b0..c26ab60dee 100644 --- a/vcr/oidc4vci/identifiers_test.go +++ b/vcr/oidc4vci/identifiers_test.go @@ -21,7 +21,6 @@ package oidc4vci import ( "crypto/tls" "errors" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/jsonld" @@ -30,6 +29,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "net/http" "net/http/httptest" "net/url" diff --git a/vcr/oidc4vci/issuer_client_mock.go b/vcr/oidc4vci/issuer_client_mock.go index fac2724b43..c49860ff74 100644 --- a/vcr/oidc4vci/issuer_client_mock.go +++ b/vcr/oidc4vci/issuer_client_mock.go @@ -8,8 +8,8 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" vc "github.com/nuts-foundation/go-did/vc" + gomock "go.uber.org/mock/gomock" ) // MockIssuerAPIClient is a mock of IssuerAPIClient interface. diff --git a/vcr/oidc4vci/wallet_client_mock.go b/vcr/oidc4vci/wallet_client_mock.go index 8458278c7a..c5d9cb0338 100644 --- a/vcr/oidc4vci/wallet_client_mock.go +++ b/vcr/oidc4vci/wallet_client_mock.go @@ -8,7 +8,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockWalletAPIClient is a mock of WalletAPIClient interface. diff --git a/vcr/search_test.go b/vcr/search_test.go index 1d2df0dcb5..455bde663a 100644 --- a/vcr/search_test.go +++ b/vcr/search_test.go @@ -26,12 +26,12 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-leia/v3" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/vcr/types" "github.com/nuts-foundation/nuts-node/vcr/verifier" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestVCR_Search(t *testing.T) { diff --git a/vcr/signature/mock.go b/vcr/signature/mock.go index 077b68a85c..0f0dc7e371 100644 --- a/vcr/signature/mock.go +++ b/vcr/signature/mock.go @@ -8,9 +8,9 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" - ssi "github.com/nuts-foundation/go-did" + go_did "github.com/nuts-foundation/go-did" crypto "github.com/nuts-foundation/nuts-node/crypto" + gomock "go.uber.org/mock/gomock" ) // MockSuite is a mock of Suite interface. @@ -66,10 +66,10 @@ func (mr *MockSuiteMockRecorder) CanonicalizeDocument(doc interface{}) *gomock.C } // GetType mocks base method. -func (m *MockSuite) GetType() ssi.ProofType { +func (m *MockSuite) GetType() go_did.ProofType { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetType") - ret0, _ := ret[0].(ssi.ProofType) + ret0, _ := ret[0].(go_did.ProofType) return ret0 } diff --git a/vcr/signature/proof/jsonld_test.go b/vcr/signature/proof/jsonld_test.go index bb91c08a95..365169c445 100644 --- a/vcr/signature/proof/jsonld_test.go +++ b/vcr/signature/proof/jsonld_test.go @@ -27,12 +27,12 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/vcr/signature" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestLDProof_Verify(t *testing.T) { diff --git a/vcr/store_test.go b/vcr/store_test.go index c8753f302f..f984ee8253 100644 --- a/vcr/store_test.go +++ b/vcr/store_test.go @@ -29,9 +29,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/vc" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestVcr_StoreCredential(t *testing.T) { diff --git a/vcr/test.go b/vcr/test.go index 6ec7a43d82..601f039b23 100644 --- a/vcr/test.go +++ b/vcr/test.go @@ -20,7 +20,6 @@ package vcr import ( - "github.com/golang/mock/gomock" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/events" @@ -32,6 +31,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/didservice" "github.com/nuts-foundation/nuts-node/vdr/didstore" "github.com/nuts-foundation/nuts-node/vdr/types" + "go.uber.org/mock/gomock" "path" "testing" ) diff --git a/vcr/types/mock.go b/vcr/types/mock.go index 70e135798e..be0b565217 100644 --- a/vcr/types/mock.go +++ b/vcr/types/mock.go @@ -8,8 +8,8 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" vc "github.com/nuts-foundation/go-did/vc" + gomock "go.uber.org/mock/gomock" ) // MockWriter is a mock of Writer interface. diff --git a/vcr/vcr_test.go b/vcr/vcr_test.go index 74978f6389..e84fb3bbb0 100644 --- a/vcr/vcr_test.go +++ b/vcr/vcr_test.go @@ -37,7 +37,6 @@ import ( "github.com/nuts-foundation/nuts-node/vcr/verifier" "go.etcd.io/bbolt" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -48,6 +47,7 @@ import ( vcrTypes "github.com/nuts-foundation/nuts-node/vcr/types" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestVCR_Configure(t *testing.T) { diff --git a/vcr/verifier/mock.go b/vcr/verifier/mock.go index dc6f164ce6..7525468496 100644 --- a/vcr/verifier/mock.go +++ b/vcr/verifier/mock.go @@ -8,11 +8,11 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" - ssi "github.com/nuts-foundation/go-did" + go_did "github.com/nuts-foundation/go-did" vc "github.com/nuts-foundation/go-did/vc" core "github.com/nuts-foundation/nuts-node/core" credential "github.com/nuts-foundation/nuts-node/vcr/credential" + gomock "go.uber.org/mock/gomock" ) // MockVerifier is a mock of Verifier interface. @@ -39,7 +39,7 @@ func (m *MockVerifier) EXPECT() *MockVerifierMockRecorder { } // GetRevocation mocks base method. -func (m *MockVerifier) GetRevocation(id ssi.URI) (*credential.Revocation, error) { +func (m *MockVerifier) GetRevocation(id go_did.URI) (*credential.Revocation, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRevocation", id) ret0, _ := ret[0].(*credential.Revocation) @@ -54,7 +54,7 @@ func (mr *MockVerifierMockRecorder) GetRevocation(id interface{}) *gomock.Call { } // IsRevoked mocks base method. -func (m *MockVerifier) IsRevoked(credentialID ssi.URI) (bool, error) { +func (m *MockVerifier) IsRevoked(credentialID go_did.URI) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsRevoked", credentialID) ret0, _ := ret[0].(bool) @@ -177,7 +177,7 @@ func (mr *MockStoreMockRecorder) Diagnostics() *gomock.Call { } // GetRevocations mocks base method. -func (m *MockStore) GetRevocations(id ssi.URI) ([]*credential.Revocation, error) { +func (m *MockStore) GetRevocations(id go_did.URI) ([]*credential.Revocation, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRevocations", id) ret0, _ := ret[0].([]*credential.Revocation) diff --git a/vcr/verifier/verifier_test.go b/vcr/verifier/verifier_test.go index d348d535f1..2107ea2437 100644 --- a/vcr/verifier/verifier_test.go +++ b/vcr/verifier/verifier_test.go @@ -29,7 +29,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" @@ -43,6 +42,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr" vdrTypes "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func testCredential(t *testing.T) vc.VerifiableCredential { diff --git a/vdr/ambassador_mock.go b/vdr/ambassador_mock.go index a62ee3191c..b07e321dfe 100644 --- a/vdr/ambassador_mock.go +++ b/vdr/ambassador_mock.go @@ -7,7 +7,7 @@ package vdr import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAmbassador is a mock of Ambassador interface. diff --git a/vdr/ambassador_test.go b/vdr/ambassador_test.go index 3e0f173f0b..e0e49f7b22 100644 --- a/vdr/ambassador_test.go +++ b/vdr/ambassador_test.go @@ -32,7 +32,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/lestrrat-go/jwx/jwk" "github.com/nats-io/nats.go" ssi "github.com/nuts-foundation/go-did" @@ -46,6 +45,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) // mockKeyCreator creates a single new key diff --git a/vdr/api/v1/api_test.go b/vdr/api/v1/api_test.go index 05c3f559ae..575f346dce 100644 --- a/vdr/api/v1/api_test.go +++ b/vdr/api/v1/api_test.go @@ -23,7 +23,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/crypto/hash" @@ -31,6 +30,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestWrapper_CreateDID(t *testing.T) { diff --git a/vdr/did_owner_test.go b/vdr/did_owner_test.go index 70fb6234c1..589dfeb9ff 100644 --- a/vdr/did_owner_test.go +++ b/vdr/did_owner_test.go @@ -21,12 +21,12 @@ package vdr import ( "context" "errors" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "testing" ) diff --git a/vdr/didservice/creator_test.go b/vdr/didservice/creator_test.go index 0ec6b9fbaf..92d69b85cc 100644 --- a/vdr/didservice/creator_test.go +++ b/vdr/didservice/creator_test.go @@ -26,11 +26,11 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/lestrrat-go/jwx/jwk" "github.com/nuts-foundation/go-did/did" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" nutsCrypto "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/vdr/types" diff --git a/vdr/didservice/finder_test.go b/vdr/didservice/finder_test.go index e7bcd6f7e9..c7c0a5fb49 100644 --- a/vdr/didservice/finder_test.go +++ b/vdr/didservice/finder_test.go @@ -25,10 +25,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/golang/mock/gomock" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestIsActive(t *testing.T) { diff --git a/vdr/didservice/manipulator_test.go b/vdr/didservice/manipulator_test.go index 7dd3dd164f..d9ef1eae7c 100644 --- a/vdr/didservice/manipulator_test.go +++ b/vdr/didservice/manipulator_test.go @@ -23,13 +23,13 @@ import ( "github.com/nuts-foundation/nuts-node/audit" "testing" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) // manipulatorTestContext contains the controller and mocks needed for testing the Manipulator diff --git a/vdr/didservice/resolvers_mock.go b/vdr/didservice/resolvers_mock.go index 26836d9fe7..925fffbbca 100644 --- a/vdr/didservice/resolvers_mock.go +++ b/vdr/didservice/resolvers_mock.go @@ -7,9 +7,9 @@ package didservice import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - ssi "github.com/nuts-foundation/go-did" + go_did "github.com/nuts-foundation/go-did" did "github.com/nuts-foundation/go-did/did" + gomock "go.uber.org/mock/gomock" ) // MockServiceResolver is a mock of ServiceResolver interface. @@ -36,7 +36,7 @@ func (m *MockServiceResolver) EXPECT() *MockServiceResolverMockRecorder { } // Resolve mocks base method. -func (m *MockServiceResolver) Resolve(query ssi.URI, maxDepth int) (did.Service, error) { +func (m *MockServiceResolver) Resolve(query go_did.URI, maxDepth int) (did.Service, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Resolve", query, maxDepth) ret0, _ := ret[0].(did.Service) @@ -51,7 +51,7 @@ func (mr *MockServiceResolverMockRecorder) Resolve(query, maxDepth interface{}) } // ResolveEx mocks base method. -func (m *MockServiceResolver) ResolveEx(endpoint ssi.URI, depth, maxDepth int, documentCache map[string]*did.Document) (did.Service, error) { +func (m *MockServiceResolver) ResolveEx(endpoint go_did.URI, depth, maxDepth int, documentCache map[string]*did.Document) (did.Service, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ResolveEx", endpoint, depth, maxDepth, documentCache) ret0, _ := ret[0].(did.Service) diff --git a/vdr/didservice/resolvers_test.go b/vdr/didservice/resolvers_test.go index 3560429aba..ce5fd0206d 100644 --- a/vdr/didservice/resolvers_test.go +++ b/vdr/didservice/resolvers_test.go @@ -24,7 +24,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto/hash" @@ -32,6 +31,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestResolveSigningKey(t *testing.T) { diff --git a/vdr/didstore/mock.go b/vdr/didstore/mock.go index 6959679b7d..c2e4253876 100644 --- a/vdr/didstore/mock.go +++ b/vdr/didstore/mock.go @@ -7,9 +7,9 @@ package didstore import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" did "github.com/nuts-foundation/go-did/did" types "github.com/nuts-foundation/nuts-node/vdr/types" + gomock "go.uber.org/mock/gomock" ) // MockStore is a mock of Store interface. diff --git a/vdr/didstore/writer_test.go b/vdr/didstore/writer_test.go index 6ba00ea2e7..7602f22c2c 100644 --- a/vdr/didstore/writer_test.go +++ b/vdr/didstore/writer_test.go @@ -22,13 +22,13 @@ import ( "context" "encoding/json" "fmt" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/crypto/hash" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "testing" "time" ) diff --git a/vdr/types/mock.go b/vdr/types/mock.go index 0d464cf2db..f20de1db94 100644 --- a/vdr/types/mock.go +++ b/vdr/types/mock.go @@ -10,11 +10,11 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" go_did "github.com/nuts-foundation/go-did" did "github.com/nuts-foundation/go-did/did" crypto0 "github.com/nuts-foundation/nuts-node/crypto" hash "github.com/nuts-foundation/nuts-node/crypto/hash" + gomock "go.uber.org/mock/gomock" ) // MockDocResolver is a mock of DocResolver interface. diff --git a/vdr/validators_test.go b/vdr/validators_test.go index 5d951f8f51..a760c75a4d 100644 --- a/vdr/validators_test.go +++ b/vdr/validators_test.go @@ -25,12 +25,12 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/vdr/didservice" "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_verificationMethodValidator(t *testing.T) { diff --git a/vdr/vdr_test.go b/vdr/vdr_test.go index 34a9781922..b88991948e 100644 --- a/vdr/vdr_test.go +++ b/vdr/vdr_test.go @@ -25,7 +25,6 @@ import ( "github.com/nuts-foundation/nuts-node/audit" "testing" - "github.com/golang/mock/gomock" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto" @@ -36,6 +35,7 @@ import ( "github.com/nuts-foundation/nuts-node/vdr/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) const expectedPayloadType = "application/did+json"