From 0e688f8162029ee56b7a16fe38a10e55e554c1d2 Mon Sep 17 00:00:00 2001 From: Islam Aleiv Date: Thu, 10 Oct 2024 23:14:01 +0200 Subject: [PATCH] Update mocks --- client/mocks/db.go | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/client/mocks/db.go b/client/mocks/db.go index 024d2ea31c..760519165b 100644 --- a/client/mocks/db.go +++ b/client/mocks/db.go @@ -13,6 +13,8 @@ import ( go_datastore "github.com/ipfs/go-datastore" + identity "github.com/sourcenetwork/defradb/acp/identity" + immutable "github.com/sourcenetwork/immutable" mock "github.com/stretchr/testify/mock" @@ -1049,6 +1051,62 @@ func (_c *DB_GetCollections_Call) RunAndReturn(run func(context.Context, client. return _c } +// GetNodeIdentity provides a mock function with given fields: _a0 +func (_m *DB) GetNodeIdentity(_a0 context.Context) (immutable.Option[identity.RawIdentity], error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetNodeIdentity") + } + + var r0 immutable.Option[identity.RawIdentity] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (immutable.Option[identity.RawIdentity], error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(context.Context) immutable.Option[identity.RawIdentity]); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(immutable.Option[identity.RawIdentity]) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DB_GetNodeIdentity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodeIdentity' +type DB_GetNodeIdentity_Call struct { + *mock.Call +} + +// GetNodeIdentity is a helper method to define mock.On call +// - _a0 context.Context +func (_e *DB_Expecter) GetNodeIdentity(_a0 interface{}) *DB_GetNodeIdentity_Call { + return &DB_GetNodeIdentity_Call{Call: _e.mock.On("GetNodeIdentity", _a0)} +} + +func (_c *DB_GetNodeIdentity_Call) Run(run func(_a0 context.Context)) *DB_GetNodeIdentity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *DB_GetNodeIdentity_Call) Return(_a0 immutable.Option[identity.RawIdentity], _a1 error) *DB_GetNodeIdentity_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *DB_GetNodeIdentity_Call) RunAndReturn(run func(context.Context) (immutable.Option[identity.RawIdentity], error)) *DB_GetNodeIdentity_Call { + _c.Call.Return(run) + return _c +} + // GetSchemaByVersionID provides a mock function with given fields: _a0, _a1 func (_m *DB) GetSchemaByVersionID(_a0 context.Context, _a1 string) (client.SchemaDescription, error) { ret := _m.Called(_a0, _a1)