diff --git a/services/graph/mocks/key_value.go b/services/graph/mocks/key_value.go new file mode 100644 index 000000000..a5b1108c9 --- /dev/null +++ b/services/graph/mocks/key_value.go @@ -0,0 +1,1172 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/nats-io/nats.go" + mock "github.com/stretchr/testify/mock" +) + +// NewKeyValue creates a new instance of KeyValue. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewKeyValue(t interface { + mock.TestingT + Cleanup(func()) +}) *KeyValue { + mock := &KeyValue{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// KeyValue is an autogenerated mock type for the KeyValue type +type KeyValue struct { + mock.Mock +} + +type KeyValue_Expecter struct { + mock *mock.Mock +} + +func (_m *KeyValue) EXPECT() *KeyValue_Expecter { + return &KeyValue_Expecter{mock: &_m.Mock} +} + +// Bucket provides a mock function for the type KeyValue +func (_mock *KeyValue) Bucket() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Bucket") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// KeyValue_Bucket_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bucket' +type KeyValue_Bucket_Call struct { + *mock.Call +} + +// Bucket is a helper method to define mock.On call +func (_e *KeyValue_Expecter) Bucket() *KeyValue_Bucket_Call { + return &KeyValue_Bucket_Call{Call: _e.mock.On("Bucket")} +} + +func (_c *KeyValue_Bucket_Call) Run(run func()) *KeyValue_Bucket_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValue_Bucket_Call) Return(s string) *KeyValue_Bucket_Call { + _c.Call.Return(s) + return _c +} + +func (_c *KeyValue_Bucket_Call) RunAndReturn(run func() string) *KeyValue_Bucket_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function for the type KeyValue +func (_mock *KeyValue) Create(key string, value []byte) (uint64, error) { + ret := _mock.Called(key, value) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 uint64 + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, []byte) (uint64, error)); ok { + return returnFunc(key, value) + } + if returnFunc, ok := ret.Get(0).(func(string, []byte) uint64); ok { + r0 = returnFunc(key, value) + } else { + r0 = ret.Get(0).(uint64) + } + if returnFunc, ok := ret.Get(1).(func(string, []byte) error); ok { + r1 = returnFunc(key, value) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type KeyValue_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - key string +// - value []byte +func (_e *KeyValue_Expecter) Create(key interface{}, value interface{}) *KeyValue_Create_Call { + return &KeyValue_Create_Call{Call: _e.mock.On("Create", key, value)} +} + +func (_c *KeyValue_Create_Call) Run(run func(key string, value []byte)) *KeyValue_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []byte + if args[1] != nil { + arg1 = args[1].([]byte) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *KeyValue_Create_Call) Return(revision uint64, err error) *KeyValue_Create_Call { + _c.Call.Return(revision, err) + return _c +} + +func (_c *KeyValue_Create_Call) RunAndReturn(run func(key string, value []byte) (uint64, error)) *KeyValue_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function for the type KeyValue +func (_mock *KeyValue) Delete(key string, opts ...nats.DeleteOpt) error { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(key, opts) + } else { + tmpRet = _mock.Called(key) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string, ...nats.DeleteOpt) error); ok { + r0 = returnFunc(key, opts...) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// KeyValue_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type KeyValue_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - key string +// - opts ...nats.DeleteOpt +func (_e *KeyValue_Expecter) Delete(key interface{}, opts ...interface{}) *KeyValue_Delete_Call { + return &KeyValue_Delete_Call{Call: _e.mock.On("Delete", + append([]interface{}{key}, opts...)...)} +} + +func (_c *KeyValue_Delete_Call) Run(run func(key string, opts ...nats.DeleteOpt)) *KeyValue_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []nats.DeleteOpt + var variadicArgs []nats.DeleteOpt + if len(args) > 1 { + variadicArgs = args[1].([]nats.DeleteOpt) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *KeyValue_Delete_Call) Return(err error) *KeyValue_Delete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *KeyValue_Delete_Call) RunAndReturn(run func(key string, opts ...nats.DeleteOpt) error) *KeyValue_Delete_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function for the type KeyValue +func (_mock *KeyValue) Get(key string) (nats.KeyValueEntry, error) { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 nats.KeyValueEntry + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (nats.KeyValueEntry, error)); ok { + return returnFunc(key) + } + if returnFunc, ok := ret.Get(0).(func(string) nats.KeyValueEntry); ok { + r0 = returnFunc(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(nats.KeyValueEntry) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(key) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type KeyValue_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key string +func (_e *KeyValue_Expecter) Get(key interface{}) *KeyValue_Get_Call { + return &KeyValue_Get_Call{Call: _e.mock.On("Get", key)} +} + +func (_c *KeyValue_Get_Call) Run(run func(key string)) *KeyValue_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *KeyValue_Get_Call) Return(entry nats.KeyValueEntry, err error) *KeyValue_Get_Call { + _c.Call.Return(entry, err) + return _c +} + +func (_c *KeyValue_Get_Call) RunAndReturn(run func(key string) (nats.KeyValueEntry, error)) *KeyValue_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetRevision provides a mock function for the type KeyValue +func (_mock *KeyValue) GetRevision(key string, revision uint64) (nats.KeyValueEntry, error) { + ret := _mock.Called(key, revision) + + if len(ret) == 0 { + panic("no return value specified for GetRevision") + } + + var r0 nats.KeyValueEntry + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, uint64) (nats.KeyValueEntry, error)); ok { + return returnFunc(key, revision) + } + if returnFunc, ok := ret.Get(0).(func(string, uint64) nats.KeyValueEntry); ok { + r0 = returnFunc(key, revision) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(nats.KeyValueEntry) + } + } + if returnFunc, ok := ret.Get(1).(func(string, uint64) error); ok { + r1 = returnFunc(key, revision) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_GetRevision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRevision' +type KeyValue_GetRevision_Call struct { + *mock.Call +} + +// GetRevision is a helper method to define mock.On call +// - key string +// - revision uint64 +func (_e *KeyValue_Expecter) GetRevision(key interface{}, revision interface{}) *KeyValue_GetRevision_Call { + return &KeyValue_GetRevision_Call{Call: _e.mock.On("GetRevision", key, revision)} +} + +func (_c *KeyValue_GetRevision_Call) Run(run func(key string, revision uint64)) *KeyValue_GetRevision_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 uint64 + if args[1] != nil { + arg1 = args[1].(uint64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *KeyValue_GetRevision_Call) Return(entry nats.KeyValueEntry, err error) *KeyValue_GetRevision_Call { + _c.Call.Return(entry, err) + return _c +} + +func (_c *KeyValue_GetRevision_Call) RunAndReturn(run func(key string, revision uint64) (nats.KeyValueEntry, error)) *KeyValue_GetRevision_Call { + _c.Call.Return(run) + return _c +} + +// History provides a mock function for the type KeyValue +func (_mock *KeyValue) History(key string, opts ...nats.WatchOpt) ([]nats.KeyValueEntry, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(key, opts) + } else { + tmpRet = _mock.Called(key) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for History") + } + + var r0 []nats.KeyValueEntry + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, ...nats.WatchOpt) ([]nats.KeyValueEntry, error)); ok { + return returnFunc(key, opts...) + } + if returnFunc, ok := ret.Get(0).(func(string, ...nats.WatchOpt) []nats.KeyValueEntry); ok { + r0 = returnFunc(key, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]nats.KeyValueEntry) + } + } + if returnFunc, ok := ret.Get(1).(func(string, ...nats.WatchOpt) error); ok { + r1 = returnFunc(key, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_History_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'History' +type KeyValue_History_Call struct { + *mock.Call +} + +// History is a helper method to define mock.On call +// - key string +// - opts ...nats.WatchOpt +func (_e *KeyValue_Expecter) History(key interface{}, opts ...interface{}) *KeyValue_History_Call { + return &KeyValue_History_Call{Call: _e.mock.On("History", + append([]interface{}{key}, opts...)...)} +} + +func (_c *KeyValue_History_Call) Run(run func(key string, opts ...nats.WatchOpt)) *KeyValue_History_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []nats.WatchOpt + var variadicArgs []nats.WatchOpt + if len(args) > 1 { + variadicArgs = args[1].([]nats.WatchOpt) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *KeyValue_History_Call) Return(keyValueEntrys []nats.KeyValueEntry, err error) *KeyValue_History_Call { + _c.Call.Return(keyValueEntrys, err) + return _c +} + +func (_c *KeyValue_History_Call) RunAndReturn(run func(key string, opts ...nats.WatchOpt) ([]nats.KeyValueEntry, error)) *KeyValue_History_Call { + _c.Call.Return(run) + return _c +} + +// Keys provides a mock function for the type KeyValue +func (_mock *KeyValue) Keys(opts ...nats.WatchOpt) ([]string, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(opts) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Keys") + } + + var r0 []string + var r1 error + if returnFunc, ok := ret.Get(0).(func(...nats.WatchOpt) ([]string, error)); ok { + return returnFunc(opts...) + } + if returnFunc, ok := ret.Get(0).(func(...nats.WatchOpt) []string); ok { + r0 = returnFunc(opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + if returnFunc, ok := ret.Get(1).(func(...nats.WatchOpt) error); ok { + r1 = returnFunc(opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_Keys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Keys' +type KeyValue_Keys_Call struct { + *mock.Call +} + +// Keys is a helper method to define mock.On call +// - opts ...nats.WatchOpt +func (_e *KeyValue_Expecter) Keys(opts ...interface{}) *KeyValue_Keys_Call { + return &KeyValue_Keys_Call{Call: _e.mock.On("Keys", + append([]interface{}{}, opts...)...)} +} + +func (_c *KeyValue_Keys_Call) Run(run func(opts ...nats.WatchOpt)) *KeyValue_Keys_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []nats.WatchOpt + var variadicArgs []nats.WatchOpt + if len(args) > 0 { + variadicArgs = args[0].([]nats.WatchOpt) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *KeyValue_Keys_Call) Return(strings []string, err error) *KeyValue_Keys_Call { + _c.Call.Return(strings, err) + return _c +} + +func (_c *KeyValue_Keys_Call) RunAndReturn(run func(opts ...nats.WatchOpt) ([]string, error)) *KeyValue_Keys_Call { + _c.Call.Return(run) + return _c +} + +// ListKeys provides a mock function for the type KeyValue +func (_mock *KeyValue) ListKeys(opts ...nats.WatchOpt) (nats.KeyLister, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(opts) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for ListKeys") + } + + var r0 nats.KeyLister + var r1 error + if returnFunc, ok := ret.Get(0).(func(...nats.WatchOpt) (nats.KeyLister, error)); ok { + return returnFunc(opts...) + } + if returnFunc, ok := ret.Get(0).(func(...nats.WatchOpt) nats.KeyLister); ok { + r0 = returnFunc(opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(nats.KeyLister) + } + } + if returnFunc, ok := ret.Get(1).(func(...nats.WatchOpt) error); ok { + r1 = returnFunc(opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_ListKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListKeys' +type KeyValue_ListKeys_Call struct { + *mock.Call +} + +// ListKeys is a helper method to define mock.On call +// - opts ...nats.WatchOpt +func (_e *KeyValue_Expecter) ListKeys(opts ...interface{}) *KeyValue_ListKeys_Call { + return &KeyValue_ListKeys_Call{Call: _e.mock.On("ListKeys", + append([]interface{}{}, opts...)...)} +} + +func (_c *KeyValue_ListKeys_Call) Run(run func(opts ...nats.WatchOpt)) *KeyValue_ListKeys_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []nats.WatchOpt + var variadicArgs []nats.WatchOpt + if len(args) > 0 { + variadicArgs = args[0].([]nats.WatchOpt) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *KeyValue_ListKeys_Call) Return(keyLister nats.KeyLister, err error) *KeyValue_ListKeys_Call { + _c.Call.Return(keyLister, err) + return _c +} + +func (_c *KeyValue_ListKeys_Call) RunAndReturn(run func(opts ...nats.WatchOpt) (nats.KeyLister, error)) *KeyValue_ListKeys_Call { + _c.Call.Return(run) + return _c +} + +// Purge provides a mock function for the type KeyValue +func (_mock *KeyValue) Purge(key string, opts ...nats.DeleteOpt) error { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(key, opts) + } else { + tmpRet = _mock.Called(key) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Purge") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string, ...nats.DeleteOpt) error); ok { + r0 = returnFunc(key, opts...) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// KeyValue_Purge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Purge' +type KeyValue_Purge_Call struct { + *mock.Call +} + +// Purge is a helper method to define mock.On call +// - key string +// - opts ...nats.DeleteOpt +func (_e *KeyValue_Expecter) Purge(key interface{}, opts ...interface{}) *KeyValue_Purge_Call { + return &KeyValue_Purge_Call{Call: _e.mock.On("Purge", + append([]interface{}{key}, opts...)...)} +} + +func (_c *KeyValue_Purge_Call) Run(run func(key string, opts ...nats.DeleteOpt)) *KeyValue_Purge_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []nats.DeleteOpt + var variadicArgs []nats.DeleteOpt + if len(args) > 1 { + variadicArgs = args[1].([]nats.DeleteOpt) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *KeyValue_Purge_Call) Return(err error) *KeyValue_Purge_Call { + _c.Call.Return(err) + return _c +} + +func (_c *KeyValue_Purge_Call) RunAndReturn(run func(key string, opts ...nats.DeleteOpt) error) *KeyValue_Purge_Call { + _c.Call.Return(run) + return _c +} + +// PurgeDeletes provides a mock function for the type KeyValue +func (_mock *KeyValue) PurgeDeletes(opts ...nats.PurgeOpt) error { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(opts) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for PurgeDeletes") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(...nats.PurgeOpt) error); ok { + r0 = returnFunc(opts...) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// KeyValue_PurgeDeletes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PurgeDeletes' +type KeyValue_PurgeDeletes_Call struct { + *mock.Call +} + +// PurgeDeletes is a helper method to define mock.On call +// - opts ...nats.PurgeOpt +func (_e *KeyValue_Expecter) PurgeDeletes(opts ...interface{}) *KeyValue_PurgeDeletes_Call { + return &KeyValue_PurgeDeletes_Call{Call: _e.mock.On("PurgeDeletes", + append([]interface{}{}, opts...)...)} +} + +func (_c *KeyValue_PurgeDeletes_Call) Run(run func(opts ...nats.PurgeOpt)) *KeyValue_PurgeDeletes_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []nats.PurgeOpt + var variadicArgs []nats.PurgeOpt + if len(args) > 0 { + variadicArgs = args[0].([]nats.PurgeOpt) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *KeyValue_PurgeDeletes_Call) Return(err error) *KeyValue_PurgeDeletes_Call { + _c.Call.Return(err) + return _c +} + +func (_c *KeyValue_PurgeDeletes_Call) RunAndReturn(run func(opts ...nats.PurgeOpt) error) *KeyValue_PurgeDeletes_Call { + _c.Call.Return(run) + return _c +} + +// Put provides a mock function for the type KeyValue +func (_mock *KeyValue) Put(key string, value []byte) (uint64, error) { + ret := _mock.Called(key, value) + + if len(ret) == 0 { + panic("no return value specified for Put") + } + + var r0 uint64 + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, []byte) (uint64, error)); ok { + return returnFunc(key, value) + } + if returnFunc, ok := ret.Get(0).(func(string, []byte) uint64); ok { + r0 = returnFunc(key, value) + } else { + r0 = ret.Get(0).(uint64) + } + if returnFunc, ok := ret.Get(1).(func(string, []byte) error); ok { + r1 = returnFunc(key, value) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type KeyValue_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - key string +// - value []byte +func (_e *KeyValue_Expecter) Put(key interface{}, value interface{}) *KeyValue_Put_Call { + return &KeyValue_Put_Call{Call: _e.mock.On("Put", key, value)} +} + +func (_c *KeyValue_Put_Call) Run(run func(key string, value []byte)) *KeyValue_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []byte + if args[1] != nil { + arg1 = args[1].([]byte) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *KeyValue_Put_Call) Return(revision uint64, err error) *KeyValue_Put_Call { + _c.Call.Return(revision, err) + return _c +} + +func (_c *KeyValue_Put_Call) RunAndReturn(run func(key string, value []byte) (uint64, error)) *KeyValue_Put_Call { + _c.Call.Return(run) + return _c +} + +// PutString provides a mock function for the type KeyValue +func (_mock *KeyValue) PutString(key string, value string) (uint64, error) { + ret := _mock.Called(key, value) + + if len(ret) == 0 { + panic("no return value specified for PutString") + } + + var r0 uint64 + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, string) (uint64, error)); ok { + return returnFunc(key, value) + } + if returnFunc, ok := ret.Get(0).(func(string, string) uint64); ok { + r0 = returnFunc(key, value) + } else { + r0 = ret.Get(0).(uint64) + } + if returnFunc, ok := ret.Get(1).(func(string, string) error); ok { + r1 = returnFunc(key, value) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_PutString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutString' +type KeyValue_PutString_Call struct { + *mock.Call +} + +// PutString is a helper method to define mock.On call +// - key string +// - value string +func (_e *KeyValue_Expecter) PutString(key interface{}, value interface{}) *KeyValue_PutString_Call { + return &KeyValue_PutString_Call{Call: _e.mock.On("PutString", key, value)} +} + +func (_c *KeyValue_PutString_Call) Run(run func(key string, value string)) *KeyValue_PutString_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *KeyValue_PutString_Call) Return(revision uint64, err error) *KeyValue_PutString_Call { + _c.Call.Return(revision, err) + return _c +} + +func (_c *KeyValue_PutString_Call) RunAndReturn(run func(key string, value string) (uint64, error)) *KeyValue_PutString_Call { + _c.Call.Return(run) + return _c +} + +// Status provides a mock function for the type KeyValue +func (_mock *KeyValue) Status() (nats.KeyValueStatus, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Status") + } + + var r0 nats.KeyValueStatus + var r1 error + if returnFunc, ok := ret.Get(0).(func() (nats.KeyValueStatus, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() nats.KeyValueStatus); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(nats.KeyValueStatus) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type KeyValue_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +func (_e *KeyValue_Expecter) Status() *KeyValue_Status_Call { + return &KeyValue_Status_Call{Call: _e.mock.On("Status")} +} + +func (_c *KeyValue_Status_Call) Run(run func()) *KeyValue_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValue_Status_Call) Return(keyValueStatus nats.KeyValueStatus, err error) *KeyValue_Status_Call { + _c.Call.Return(keyValueStatus, err) + return _c +} + +func (_c *KeyValue_Status_Call) RunAndReturn(run func() (nats.KeyValueStatus, error)) *KeyValue_Status_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function for the type KeyValue +func (_mock *KeyValue) Update(key string, value []byte, last uint64) (uint64, error) { + ret := _mock.Called(key, value, last) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 uint64 + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, []byte, uint64) (uint64, error)); ok { + return returnFunc(key, value, last) + } + if returnFunc, ok := ret.Get(0).(func(string, []byte, uint64) uint64); ok { + r0 = returnFunc(key, value, last) + } else { + r0 = ret.Get(0).(uint64) + } + if returnFunc, ok := ret.Get(1).(func(string, []byte, uint64) error); ok { + r1 = returnFunc(key, value, last) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type KeyValue_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - key string +// - value []byte +// - last uint64 +func (_e *KeyValue_Expecter) Update(key interface{}, value interface{}, last interface{}) *KeyValue_Update_Call { + return &KeyValue_Update_Call{Call: _e.mock.On("Update", key, value, last)} +} + +func (_c *KeyValue_Update_Call) Run(run func(key string, value []byte, last uint64)) *KeyValue_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []byte + if args[1] != nil { + arg1 = args[1].([]byte) + } + var arg2 uint64 + if args[2] != nil { + arg2 = args[2].(uint64) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *KeyValue_Update_Call) Return(revision uint64, err error) *KeyValue_Update_Call { + _c.Call.Return(revision, err) + return _c +} + +func (_c *KeyValue_Update_Call) RunAndReturn(run func(key string, value []byte, last uint64) (uint64, error)) *KeyValue_Update_Call { + _c.Call.Return(run) + return _c +} + +// Watch provides a mock function for the type KeyValue +func (_mock *KeyValue) Watch(keys string, opts ...nats.WatchOpt) (nats.KeyWatcher, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(keys, opts) + } else { + tmpRet = _mock.Called(keys) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Watch") + } + + var r0 nats.KeyWatcher + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, ...nats.WatchOpt) (nats.KeyWatcher, error)); ok { + return returnFunc(keys, opts...) + } + if returnFunc, ok := ret.Get(0).(func(string, ...nats.WatchOpt) nats.KeyWatcher); ok { + r0 = returnFunc(keys, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(nats.KeyWatcher) + } + } + if returnFunc, ok := ret.Get(1).(func(string, ...nats.WatchOpt) error); ok { + r1 = returnFunc(keys, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_Watch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Watch' +type KeyValue_Watch_Call struct { + *mock.Call +} + +// Watch is a helper method to define mock.On call +// - keys string +// - opts ...nats.WatchOpt +func (_e *KeyValue_Expecter) Watch(keys interface{}, opts ...interface{}) *KeyValue_Watch_Call { + return &KeyValue_Watch_Call{Call: _e.mock.On("Watch", + append([]interface{}{keys}, opts...)...)} +} + +func (_c *KeyValue_Watch_Call) Run(run func(keys string, opts ...nats.WatchOpt)) *KeyValue_Watch_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []nats.WatchOpt + var variadicArgs []nats.WatchOpt + if len(args) > 1 { + variadicArgs = args[1].([]nats.WatchOpt) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *KeyValue_Watch_Call) Return(keyWatcher nats.KeyWatcher, err error) *KeyValue_Watch_Call { + _c.Call.Return(keyWatcher, err) + return _c +} + +func (_c *KeyValue_Watch_Call) RunAndReturn(run func(keys string, opts ...nats.WatchOpt) (nats.KeyWatcher, error)) *KeyValue_Watch_Call { + _c.Call.Return(run) + return _c +} + +// WatchAll provides a mock function for the type KeyValue +func (_mock *KeyValue) WatchAll(opts ...nats.WatchOpt) (nats.KeyWatcher, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(opts) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for WatchAll") + } + + var r0 nats.KeyWatcher + var r1 error + if returnFunc, ok := ret.Get(0).(func(...nats.WatchOpt) (nats.KeyWatcher, error)); ok { + return returnFunc(opts...) + } + if returnFunc, ok := ret.Get(0).(func(...nats.WatchOpt) nats.KeyWatcher); ok { + r0 = returnFunc(opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(nats.KeyWatcher) + } + } + if returnFunc, ok := ret.Get(1).(func(...nats.WatchOpt) error); ok { + r1 = returnFunc(opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_WatchAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchAll' +type KeyValue_WatchAll_Call struct { + *mock.Call +} + +// WatchAll is a helper method to define mock.On call +// - opts ...nats.WatchOpt +func (_e *KeyValue_Expecter) WatchAll(opts ...interface{}) *KeyValue_WatchAll_Call { + return &KeyValue_WatchAll_Call{Call: _e.mock.On("WatchAll", + append([]interface{}{}, opts...)...)} +} + +func (_c *KeyValue_WatchAll_Call) Run(run func(opts ...nats.WatchOpt)) *KeyValue_WatchAll_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []nats.WatchOpt + var variadicArgs []nats.WatchOpt + if len(args) > 0 { + variadicArgs = args[0].([]nats.WatchOpt) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *KeyValue_WatchAll_Call) Return(keyWatcher nats.KeyWatcher, err error) *KeyValue_WatchAll_Call { + _c.Call.Return(keyWatcher, err) + return _c +} + +func (_c *KeyValue_WatchAll_Call) RunAndReturn(run func(opts ...nats.WatchOpt) (nats.KeyWatcher, error)) *KeyValue_WatchAll_Call { + _c.Call.Return(run) + return _c +} + +// WatchFiltered provides a mock function for the type KeyValue +func (_mock *KeyValue) WatchFiltered(keys []string, opts ...nats.WatchOpt) (nats.KeyWatcher, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(keys, opts) + } else { + tmpRet = _mock.Called(keys) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for WatchFiltered") + } + + var r0 nats.KeyWatcher + var r1 error + if returnFunc, ok := ret.Get(0).(func([]string, ...nats.WatchOpt) (nats.KeyWatcher, error)); ok { + return returnFunc(keys, opts...) + } + if returnFunc, ok := ret.Get(0).(func([]string, ...nats.WatchOpt) nats.KeyWatcher); ok { + r0 = returnFunc(keys, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(nats.KeyWatcher) + } + } + if returnFunc, ok := ret.Get(1).(func([]string, ...nats.WatchOpt) error); ok { + r1 = returnFunc(keys, opts...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// KeyValue_WatchFiltered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchFiltered' +type KeyValue_WatchFiltered_Call struct { + *mock.Call +} + +// WatchFiltered is a helper method to define mock.On call +// - keys []string +// - opts ...nats.WatchOpt +func (_e *KeyValue_Expecter) WatchFiltered(keys interface{}, opts ...interface{}) *KeyValue_WatchFiltered_Call { + return &KeyValue_WatchFiltered_Call{Call: _e.mock.On("WatchFiltered", + append([]interface{}{keys}, opts...)...)} +} + +func (_c *KeyValue_WatchFiltered_Call) Run(run func(keys []string, opts ...nats.WatchOpt)) *KeyValue_WatchFiltered_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []string + if args[0] != nil { + arg0 = args[0].([]string) + } + var arg1 []nats.WatchOpt + var variadicArgs []nats.WatchOpt + if len(args) > 1 { + variadicArgs = args[1].([]nats.WatchOpt) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *KeyValue_WatchFiltered_Call) Return(keyWatcher nats.KeyWatcher, err error) *KeyValue_WatchFiltered_Call { + _c.Call.Return(keyWatcher, err) + return _c +} + +func (_c *KeyValue_WatchFiltered_Call) RunAndReturn(run func(keys []string, opts ...nats.WatchOpt) (nats.KeyWatcher, error)) *KeyValue_WatchFiltered_Call { + _c.Call.Return(run) + return _c +} diff --git a/services/graph/mocks/key_value_entry.go b/services/graph/mocks/key_value_entry.go new file mode 100644 index 000000000..369c5006e --- /dev/null +++ b/services/graph/mocks/key_value_entry.go @@ -0,0 +1,349 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "time" + + "github.com/nats-io/nats.go" + mock "github.com/stretchr/testify/mock" +) + +// NewKeyValueEntry creates a new instance of KeyValueEntry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewKeyValueEntry(t interface { + mock.TestingT + Cleanup(func()) +}) *KeyValueEntry { + mock := &KeyValueEntry{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// KeyValueEntry is an autogenerated mock type for the KeyValueEntry type +type KeyValueEntry struct { + mock.Mock +} + +type KeyValueEntry_Expecter struct { + mock *mock.Mock +} + +func (_m *KeyValueEntry) EXPECT() *KeyValueEntry_Expecter { + return &KeyValueEntry_Expecter{mock: &_m.Mock} +} + +// Bucket provides a mock function for the type KeyValueEntry +func (_mock *KeyValueEntry) Bucket() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Bucket") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// KeyValueEntry_Bucket_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bucket' +type KeyValueEntry_Bucket_Call struct { + *mock.Call +} + +// Bucket is a helper method to define mock.On call +func (_e *KeyValueEntry_Expecter) Bucket() *KeyValueEntry_Bucket_Call { + return &KeyValueEntry_Bucket_Call{Call: _e.mock.On("Bucket")} +} + +func (_c *KeyValueEntry_Bucket_Call) Run(run func()) *KeyValueEntry_Bucket_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValueEntry_Bucket_Call) Return(s string) *KeyValueEntry_Bucket_Call { + _c.Call.Return(s) + return _c +} + +func (_c *KeyValueEntry_Bucket_Call) RunAndReturn(run func() string) *KeyValueEntry_Bucket_Call { + _c.Call.Return(run) + return _c +} + +// Created provides a mock function for the type KeyValueEntry +func (_mock *KeyValueEntry) Created() time.Time { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Created") + } + + var r0 time.Time + if returnFunc, ok := ret.Get(0).(func() time.Time); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(time.Time) + } + return r0 +} + +// KeyValueEntry_Created_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Created' +type KeyValueEntry_Created_Call struct { + *mock.Call +} + +// Created is a helper method to define mock.On call +func (_e *KeyValueEntry_Expecter) Created() *KeyValueEntry_Created_Call { + return &KeyValueEntry_Created_Call{Call: _e.mock.On("Created")} +} + +func (_c *KeyValueEntry_Created_Call) Run(run func()) *KeyValueEntry_Created_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValueEntry_Created_Call) Return(time1 time.Time) *KeyValueEntry_Created_Call { + _c.Call.Return(time1) + return _c +} + +func (_c *KeyValueEntry_Created_Call) RunAndReturn(run func() time.Time) *KeyValueEntry_Created_Call { + _c.Call.Return(run) + return _c +} + +// Delta provides a mock function for the type KeyValueEntry +func (_mock *KeyValueEntry) Delta() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Delta") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// KeyValueEntry_Delta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delta' +type KeyValueEntry_Delta_Call struct { + *mock.Call +} + +// Delta is a helper method to define mock.On call +func (_e *KeyValueEntry_Expecter) Delta() *KeyValueEntry_Delta_Call { + return &KeyValueEntry_Delta_Call{Call: _e.mock.On("Delta")} +} + +func (_c *KeyValueEntry_Delta_Call) Run(run func()) *KeyValueEntry_Delta_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValueEntry_Delta_Call) Return(v uint64) *KeyValueEntry_Delta_Call { + _c.Call.Return(v) + return _c +} + +func (_c *KeyValueEntry_Delta_Call) RunAndReturn(run func() uint64) *KeyValueEntry_Delta_Call { + _c.Call.Return(run) + return _c +} + +// Key provides a mock function for the type KeyValueEntry +func (_mock *KeyValueEntry) Key() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Key") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// KeyValueEntry_Key_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Key' +type KeyValueEntry_Key_Call struct { + *mock.Call +} + +// Key is a helper method to define mock.On call +func (_e *KeyValueEntry_Expecter) Key() *KeyValueEntry_Key_Call { + return &KeyValueEntry_Key_Call{Call: _e.mock.On("Key")} +} + +func (_c *KeyValueEntry_Key_Call) Run(run func()) *KeyValueEntry_Key_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValueEntry_Key_Call) Return(s string) *KeyValueEntry_Key_Call { + _c.Call.Return(s) + return _c +} + +func (_c *KeyValueEntry_Key_Call) RunAndReturn(run func() string) *KeyValueEntry_Key_Call { + _c.Call.Return(run) + return _c +} + +// Operation provides a mock function for the type KeyValueEntry +func (_mock *KeyValueEntry) Operation() nats.KeyValueOp { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Operation") + } + + var r0 nats.KeyValueOp + if returnFunc, ok := ret.Get(0).(func() nats.KeyValueOp); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(nats.KeyValueOp) + } + return r0 +} + +// KeyValueEntry_Operation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operation' +type KeyValueEntry_Operation_Call struct { + *mock.Call +} + +// Operation is a helper method to define mock.On call +func (_e *KeyValueEntry_Expecter) Operation() *KeyValueEntry_Operation_Call { + return &KeyValueEntry_Operation_Call{Call: _e.mock.On("Operation")} +} + +func (_c *KeyValueEntry_Operation_Call) Run(run func()) *KeyValueEntry_Operation_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValueEntry_Operation_Call) Return(keyValueOp nats.KeyValueOp) *KeyValueEntry_Operation_Call { + _c.Call.Return(keyValueOp) + return _c +} + +func (_c *KeyValueEntry_Operation_Call) RunAndReturn(run func() nats.KeyValueOp) *KeyValueEntry_Operation_Call { + _c.Call.Return(run) + return _c +} + +// Revision provides a mock function for the type KeyValueEntry +func (_mock *KeyValueEntry) Revision() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Revision") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// KeyValueEntry_Revision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revision' +type KeyValueEntry_Revision_Call struct { + *mock.Call +} + +// Revision is a helper method to define mock.On call +func (_e *KeyValueEntry_Expecter) Revision() *KeyValueEntry_Revision_Call { + return &KeyValueEntry_Revision_Call{Call: _e.mock.On("Revision")} +} + +func (_c *KeyValueEntry_Revision_Call) Run(run func()) *KeyValueEntry_Revision_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValueEntry_Revision_Call) Return(v uint64) *KeyValueEntry_Revision_Call { + _c.Call.Return(v) + return _c +} + +func (_c *KeyValueEntry_Revision_Call) RunAndReturn(run func() uint64) *KeyValueEntry_Revision_Call { + _c.Call.Return(run) + return _c +} + +// Value provides a mock function for the type KeyValueEntry +func (_mock *KeyValueEntry) Value() []byte { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Value") + } + + var r0 []byte + if returnFunc, ok := ret.Get(0).(func() []byte); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + return r0 +} + +// KeyValueEntry_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value' +type KeyValueEntry_Value_Call struct { + *mock.Call +} + +// Value is a helper method to define mock.On call +func (_e *KeyValueEntry_Expecter) Value() *KeyValueEntry_Value_Call { + return &KeyValueEntry_Value_Call{Call: _e.mock.On("Value")} +} + +func (_c *KeyValueEntry_Value_Call) Run(run func()) *KeyValueEntry_Value_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *KeyValueEntry_Value_Call) Return(bytes []byte) *KeyValueEntry_Value_Call { + _c.Call.Return(bytes) + return _c +} + +func (_c *KeyValueEntry_Value_Call) RunAndReturn(run func() []byte) *KeyValueEntry_Value_Call { + _c.Call.Return(run) + return _c +}