From d2c42b8af79dc08d5807fe3cb36a521ec0002a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Tue, 5 Jul 2022 15:45:53 -0400 Subject: [PATCH] feat(ci): update mockery from `2.10` to `2.14` (#2642) * feat: update mockery to from 2.10 to 2.14 * chore: update devnet/ mocks --- .github/workflows/mocks.yml | 2 +- .../cmd/scale-down-ecs-service/mocks/ecsapi.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/block_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/block_finality_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/block_producer_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/core_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/network_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/rpcapi.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/runtime_storage_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/storage_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/sync_state_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/system_api.go | 17 ++++++++++++++++- dot/rpc/modules/mocks/transaction_state_api.go | 17 ++++++++++++++++- dot/state/mock_observer.go | 17 ++++++++++++++++- dot/sync/mocks/block_state.go | 17 ++++++++++++++++- lib/babe/mocks/block_import_handler.go | 17 ++++++++++++++++- lib/grandpa/mocks/network.go | 17 ++++++++++++++++- lib/runtime/mock_memory_test.go | 17 ++++++++++++++++- lib/runtime/mocks/instance.go | 17 ++++++++++++++++- lib/runtime/mocks/transaction_state.go | 17 ++++++++++++++++- lib/runtime/mocks/version.go | 17 ++++++++++++++++- lib/services/mocks/service.go | 17 ++++++++++++++++- 22 files changed, 337 insertions(+), 22 deletions(-) diff --git a/.github/workflows/mocks.yml b/.github/workflows/mocks.yml index f995c269f0..be8e92ce2a 100644 --- a/.github/workflows/mocks.yml +++ b/.github/workflows/mocks.yml @@ -21,7 +21,7 @@ jobs: stable: true check-latest: true - - run: go install github.com/vektra/mockery/v2@v2.10 + - run: go install github.com/vektra/mockery/v2@v2.14 - run: go install github.com/golang/mock/mockgen@v1.6 diff --git a/devnet/cmd/scale-down-ecs-service/mocks/ecsapi.go b/devnet/cmd/scale-down-ecs-service/mocks/ecsapi.go index c3dd446d7a..8922cbacd0 100644 --- a/devnet/cmd/scale-down-ecs-service/mocks/ecsapi.go +++ b/devnet/cmd/scale-down-ecs-service/mocks/ecsapi.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -4492,3 +4492,18 @@ func (_m *ECSAPI) WaitUntilTasksStoppedWithContext(_a0 context.Context, _a1 *ecs return r0 } + +type mockConstructorTestingTNewECSAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewECSAPI creates a new instance of ECSAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewECSAPI(t mockConstructorTestingTNewECSAPI) *ECSAPI { + mock := &ECSAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/block_api.go b/dot/rpc/modules/mocks/block_api.go index 7fa7736ddb..3486e2691a 100644 --- a/dot/rpc/modules/mocks/block_api.go +++ b/dot/rpc/modules/mocks/block_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -313,3 +313,18 @@ func (_m *BlockAPI) UnregisterRuntimeUpdatedChannel(id uint32) bool { return r0 } + +type mockConstructorTestingTNewBlockAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewBlockAPI creates a new instance of BlockAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBlockAPI(t mockConstructorTestingTNewBlockAPI) *BlockAPI { + mock := &BlockAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/block_finality_api.go b/dot/rpc/modules/mocks/block_finality_api.go index 21117ca358..4f4746bf3e 100644 --- a/dot/rpc/modules/mocks/block_finality_api.go +++ b/dot/rpc/modules/mocks/block_finality_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -89,3 +89,18 @@ func (_m *BlockFinalityAPI) PreVotes() []ed25519.PublicKeyBytes { return r0 } + +type mockConstructorTestingTNewBlockFinalityAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewBlockFinalityAPI creates a new instance of BlockFinalityAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBlockFinalityAPI(t mockConstructorTestingTNewBlockFinalityAPI) *BlockFinalityAPI { + mock := &BlockFinalityAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/block_producer_api.go b/dot/rpc/modules/mocks/block_producer_api.go index fd40639138..46172626b1 100644 --- a/dot/rpc/modules/mocks/block_producer_api.go +++ b/dot/rpc/modules/mocks/block_producer_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -64,3 +64,18 @@ func (_m *BlockProducerAPI) SlotDuration() uint64 { return r0 } + +type mockConstructorTestingTNewBlockProducerAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewBlockProducerAPI creates a new instance of BlockProducerAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBlockProducerAPI(t mockConstructorTestingTNewBlockProducerAPI) *BlockProducerAPI { + mock := &BlockProducerAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/core_api.go b/dot/rpc/modules/mocks/core_api.go index 59105fbd01..5233ebade4 100644 --- a/dot/rpc/modules/mocks/core_api.go +++ b/dot/rpc/modules/mocks/core_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -199,3 +199,18 @@ func (_m *CoreAPI) QueryStorage(from common.Hash, to common.Hash, keys ...string return r0, r1 } + +type mockConstructorTestingTNewCoreAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewCoreAPI creates a new instance of CoreAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewCoreAPI(t mockConstructorTestingTNewCoreAPI) *CoreAPI { + mock := &CoreAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/network_api.go b/dot/rpc/modules/mocks/network_api.go index 76871f8469..52a90b48f8 100644 --- a/dot/rpc/modules/mocks/network_api.go +++ b/dot/rpc/modules/mocks/network_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -165,3 +165,18 @@ func (_m *NetworkAPI) Stop() error { return r0 } + +type mockConstructorTestingTNewNetworkAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewNetworkAPI creates a new instance of NetworkAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewNetworkAPI(t mockConstructorTestingTNewNetworkAPI) *NetworkAPI { + mock := &NetworkAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/rpcapi.go b/dot/rpc/modules/mocks/rpcapi.go index a65beb315e..bf73160143 100644 --- a/dot/rpc/modules/mocks/rpcapi.go +++ b/dot/rpc/modules/mocks/rpcapi.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -29,3 +29,18 @@ func (_m *RPCAPI) Methods() []string { return r0 } + +type mockConstructorTestingTNewRPCAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewRPCAPI creates a new instance of RPCAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewRPCAPI(t mockConstructorTestingTNewRPCAPI) *RPCAPI { + mock := &RPCAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/runtime_storage_api.go b/dot/rpc/modules/mocks/runtime_storage_api.go index 840c96d059..276a95b2c7 100644 --- a/dot/rpc/modules/mocks/runtime_storage_api.go +++ b/dot/rpc/modules/mocks/runtime_storage_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -82,3 +82,18 @@ func (_m *RuntimeStorageAPI) SetPersistent(k []byte, v []byte) error { return r0 } + +type mockConstructorTestingTNewRuntimeStorageAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewRuntimeStorageAPI creates a new instance of RuntimeStorageAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewRuntimeStorageAPI(t mockConstructorTestingTNewRuntimeStorageAPI) *RuntimeStorageAPI { + mock := &RuntimeStorageAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/storage_api.go b/dot/rpc/modules/mocks/storage_api.go index 8cb3fbe5bf..b1cff488fc 100644 --- a/dot/rpc/modules/mocks/storage_api.go +++ b/dot/rpc/modules/mocks/storage_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -186,3 +186,18 @@ func (_m *StorageAPI) RegisterStorageObserver(observer state.Observer) { func (_m *StorageAPI) UnregisterStorageObserver(observer state.Observer) { _m.Called(observer) } + +type mockConstructorTestingTNewStorageAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewStorageAPI creates a new instance of StorageAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewStorageAPI(t mockConstructorTestingTNewStorageAPI) *StorageAPI { + mock := &StorageAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/sync_state_api.go b/dot/rpc/modules/mocks/sync_state_api.go index 0e9e8c078b..471978c218 100644 --- a/dot/rpc/modules/mocks/sync_state_api.go +++ b/dot/rpc/modules/mocks/sync_state_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -34,3 +34,18 @@ func (_m *SyncStateAPI) GenSyncSpec(raw bool) (*genesis.Genesis, error) { return r0, r1 } + +type mockConstructorTestingTNewSyncStateAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewSyncStateAPI creates a new instance of SyncStateAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSyncStateAPI(t mockConstructorTestingTNewSyncStateAPI) *SyncStateAPI { + mock := &SyncStateAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/system_api.go b/dot/rpc/modules/mocks/system_api.go index 21889736fb..e656e30253 100644 --- a/dot/rpc/modules/mocks/system_api.go +++ b/dot/rpc/modules/mocks/system_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -80,3 +80,18 @@ func (_m *SystemAPI) SystemVersion() string { return r0 } + +type mockConstructorTestingTNewSystemAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewSystemAPI creates a new instance of SystemAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSystemAPI(t mockConstructorTestingTNewSystemAPI) *SystemAPI { + mock := &SystemAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/rpc/modules/mocks/transaction_state_api.go b/dot/rpc/modules/mocks/transaction_state_api.go index 82fc6e7553..1379fafa58 100644 --- a/dot/rpc/modules/mocks/transaction_state_api.go +++ b/dot/rpc/modules/mocks/transaction_state_api.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -100,3 +100,18 @@ func (_m *TransactionStateAPI) Pop() *transaction.ValidTransaction { return r0 } + +type mockConstructorTestingTNewTransactionStateAPI interface { + mock.TestingT + Cleanup(func()) +} + +// NewTransactionStateAPI creates a new instance of TransactionStateAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTransactionStateAPI(t mockConstructorTestingTNewTransactionStateAPI) *TransactionStateAPI { + mock := &TransactionStateAPI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/state/mock_observer.go b/dot/state/mock_observer.go index dfdb42adcc..e998b2d89c 100644 --- a/dot/state/mock_observer.go +++ b/dot/state/mock_observer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package state @@ -43,3 +43,18 @@ func (_m *MockObserver) GetID() uint { func (_m *MockObserver) Update(result *SubscriptionResult) { _m.Called(result) } + +type mockConstructorTestingTNewMockObserver interface { + mock.TestingT + Cleanup(func()) +} + +// NewMockObserver creates a new instance of MockObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockObserver(t mockConstructorTestingTNewMockObserver) *MockObserver { + mock := &MockObserver{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/dot/sync/mocks/block_state.go b/dot/sync/mocks/block_state.go index 2f9d48d9af..5307fbd0d0 100644 --- a/dot/sync/mocks/block_state.go +++ b/dot/sync/mocks/block_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -542,3 +542,18 @@ func (_m *BlockState) SubChain(start common.Hash, end common.Hash) ([]common.Has return r0, r1 } + +type mockConstructorTestingTNewBlockState interface { + mock.TestingT + Cleanup(func()) +} + +// NewBlockState creates a new instance of BlockState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBlockState(t mockConstructorTestingTNewBlockState) *BlockState { + mock := &BlockState{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/lib/babe/mocks/block_import_handler.go b/lib/babe/mocks/block_import_handler.go index c4c61cf002..4627a3f898 100644 --- a/lib/babe/mocks/block_import_handler.go +++ b/lib/babe/mocks/block_import_handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -26,3 +26,18 @@ func (_m *BlockImportHandler) HandleBlockProduced(block *types.Block, state *sto return r0 } + +type mockConstructorTestingTNewBlockImportHandler interface { + mock.TestingT + Cleanup(func()) +} + +// NewBlockImportHandler creates a new instance of BlockImportHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBlockImportHandler(t mockConstructorTestingTNewBlockImportHandler) *BlockImportHandler { + mock := &BlockImportHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/lib/grandpa/mocks/network.go b/lib/grandpa/mocks/network.go index 5d7e607e03..1dc56facd9 100644 --- a/lib/grandpa/mocks/network.go +++ b/lib/grandpa/mocks/network.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -48,3 +48,18 @@ func (_m *Network) SendMessage(to peer.ID, msg network.NotificationsMessage) err return r0 } + +type mockConstructorTestingTNewNetwork interface { + mock.TestingT + Cleanup(func()) +} + +// NewNetwork creates a new instance of Network. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewNetwork(t mockConstructorTestingTNewNetwork) *Network { + mock := &Network{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/lib/runtime/mock_memory_test.go b/lib/runtime/mock_memory_test.go index 9fca62f217..44305bb7d3 100644 --- a/lib/runtime/mock_memory_test.go +++ b/lib/runtime/mock_memory_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package runtime @@ -52,3 +52,18 @@ func (_m *mockMemory) Length() uint32 { return r0 } + +type mockConstructorTestingTnewMockMemory interface { + mock.TestingT + Cleanup(func()) +} + +// newMockMemory creates a new instance of mockMemory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func newMockMemory(t mockConstructorTestingTnewMockMemory) *mockMemory { + mock := &mockMemory{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/lib/runtime/mocks/instance.go b/lib/runtime/mocks/instance.go index c8f2353909..b7e9ecc2d7 100644 --- a/lib/runtime/mocks/instance.go +++ b/lib/runtime/mocks/instance.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -452,3 +452,18 @@ func (_m *Instance) Version() (runtime.Version, error) { return r0, r1 } + +type mockConstructorTestingTNewInstance interface { + mock.TestingT + Cleanup(func()) +} + +// NewInstance creates a new instance of Instance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewInstance(t mockConstructorTestingTNewInstance) *Instance { + mock := &Instance{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/lib/runtime/mocks/transaction_state.go b/lib/runtime/mocks/transaction_state.go index f7dd59036c..686cb78741 100644 --- a/lib/runtime/mocks/transaction_state.go +++ b/lib/runtime/mocks/transaction_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -29,3 +29,18 @@ func (_m *TransactionState) AddToPool(vt *transaction.ValidTransaction) common.H return r0 } + +type mockConstructorTestingTNewTransactionState interface { + mock.TestingT + Cleanup(func()) +} + +// NewTransactionState creates a new instance of TransactionState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTransactionState(t mockConstructorTestingTNewTransactionState) *TransactionState { + mock := &TransactionState{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/lib/runtime/mocks/version.go b/lib/runtime/mocks/version.go index 1999794717..264ceab55e 100644 --- a/lib/runtime/mocks/version.go +++ b/lib/runtime/mocks/version.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -138,3 +138,18 @@ func (_m *Version) TransactionVersion() uint32 { return r0 } + +type mockConstructorTestingTNewVersion interface { + mock.TestingT + Cleanup(func()) +} + +// NewVersion creates a new instance of Version. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewVersion(t mockConstructorTestingTNewVersion) *Version { + mock := &Version{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/lib/services/mocks/service.go b/lib/services/mocks/service.go index d6af8c0324..d2c6c71b15 100644 --- a/lib/services/mocks/service.go +++ b/lib/services/mocks/service.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.6. DO NOT EDIT. +// Code generated by mockery v2.14.0. DO NOT EDIT. package mocks @@ -36,3 +36,18 @@ func (_m *Service) Stop() error { return r0 } + +type mockConstructorTestingTNewService interface { + mock.TestingT + Cleanup(func()) +} + +// NewService creates a new instance of Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewService(t mockConstructorTestingTNewService) *Service { + mock := &Service{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}