// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "cloud.google.com/go/spanner" "github.com/google/syzkaller/pkg/coveragedb/spannerclient" mock "github.com/stretchr/testify/mock" ) // NewSpannerClient creates a new instance of SpannerClient. 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 NewSpannerClient(t interface { mock.TestingT Cleanup(func()) }) *SpannerClient { mock := &SpannerClient{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // SpannerClient is an autogenerated mock type for the SpannerClient type type SpannerClient struct { mock.Mock } type SpannerClient_Expecter struct { mock *mock.Mock } func (_m *SpannerClient) EXPECT() *SpannerClient_Expecter { return &SpannerClient_Expecter{mock: &_m.Mock} } // Apply provides a mock function for the type SpannerClient func (_mock *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error) { var tmpRet mock.Arguments if len(opts) > 0 { tmpRet = _mock.Called(ctx, ms, opts) } else { tmpRet = _mock.Called(ctx, ms) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for Apply") } var r0 time.Time var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) (time.Time, error)); ok { return returnFunc(ctx, ms, opts...) } if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) time.Time); ok { r0 = returnFunc(ctx, ms, opts...) } else { r0 = ret.Get(0).(time.Time) } if returnFunc, ok := ret.Get(1).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) error); ok { r1 = returnFunc(ctx, ms, opts...) } else { r1 = ret.Error(1) } return r0, r1 } // SpannerClient_Apply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Apply' type SpannerClient_Apply_Call struct { *mock.Call } // Apply is a helper method to define mock.On call // - ctx context.Context // - ms []*spanner.Mutation // - opts ...spanner.ApplyOption func (_e *SpannerClient_Expecter) Apply(ctx interface{}, ms interface{}, opts ...interface{}) *SpannerClient_Apply_Call { return &SpannerClient_Apply_Call{Call: _e.mock.On("Apply", append([]interface{}{ctx, ms}, opts...)...)} } func (_c *SpannerClient_Apply_Call) Run(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption)) *SpannerClient_Apply_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 []*spanner.Mutation if args[1] != nil { arg1 = args[1].([]*spanner.Mutation) } var arg2 []spanner.ApplyOption var variadicArgs []spanner.ApplyOption if len(args) > 2 { variadicArgs = args[2].([]spanner.ApplyOption) } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *SpannerClient_Apply_Call) Return(commitTimestamp time.Time, err error) *SpannerClient_Apply_Call { _c.Call.Return(commitTimestamp, err) return _c } func (_c *SpannerClient_Apply_Call) RunAndReturn(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error)) *SpannerClient_Apply_Call { _c.Call.Return(run) return _c } // Close provides a mock function for the type SpannerClient func (_mock *SpannerClient) Close() { _mock.Called() return } // SpannerClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' type SpannerClient_Close_Call struct { *mock.Call } // Close is a helper method to define mock.On call func (_e *SpannerClient_Expecter) Close() *SpannerClient_Close_Call { return &SpannerClient_Close_Call{Call: _e.mock.On("Close")} } func (_c *SpannerClient_Close_Call) Run(run func()) *SpannerClient_Close_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *SpannerClient_Close_Call) Return() *SpannerClient_Close_Call { _c.Call.Return() return _c } func (_c *SpannerClient_Close_Call) RunAndReturn(run func()) *SpannerClient_Close_Call { _c.Run(run) return _c } // Single provides a mock function for the type SpannerClient func (_mock *SpannerClient) Single() spannerclient.ReadOnlyTransaction { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Single") } var r0 spannerclient.ReadOnlyTransaction if returnFunc, ok := ret.Get(0).(func() spannerclient.ReadOnlyTransaction); ok { r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(spannerclient.ReadOnlyTransaction) } } return r0 } // SpannerClient_Single_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Single' type SpannerClient_Single_Call struct { *mock.Call } // Single is a helper method to define mock.On call func (_e *SpannerClient_Expecter) Single() *SpannerClient_Single_Call { return &SpannerClient_Single_Call{Call: _e.mock.On("Single")} } func (_c *SpannerClient_Single_Call) Run(run func()) *SpannerClient_Single_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *SpannerClient_Single_Call) Return(readOnlyTransaction spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call { _c.Call.Return(readOnlyTransaction) return _c } func (_c *SpannerClient_Single_Call) RunAndReturn(run func() spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call { _c.Call.Return(run) return _c }