// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "cloud.google.com/go/spanner" "github.com/google/syzkaller/pkg/coveragedb/spannerclient" mock "github.com/stretchr/testify/mock" ) // NewReadOnlyTransaction creates a new instance of ReadOnlyTransaction. 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 NewReadOnlyTransaction(t interface { mock.TestingT Cleanup(func()) }) *ReadOnlyTransaction { mock := &ReadOnlyTransaction{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // ReadOnlyTransaction is an autogenerated mock type for the ReadOnlyTransaction type type ReadOnlyTransaction struct { mock.Mock } type ReadOnlyTransaction_Expecter struct { mock *mock.Mock } func (_m *ReadOnlyTransaction) EXPECT() *ReadOnlyTransaction_Expecter { return &ReadOnlyTransaction_Expecter{mock: &_m.Mock} } // Query provides a mock function for the type ReadOnlyTransaction func (_mock *ReadOnlyTransaction) Query(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator { ret := _mock.Called(ctx, statement) if len(ret) == 0 { panic("no return value specified for Query") } var r0 spannerclient.RowIterator if returnFunc, ok := ret.Get(0).(func(context.Context, spanner.Statement) spannerclient.RowIterator); ok { r0 = returnFunc(ctx, statement) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(spannerclient.RowIterator) } } return r0 } // ReadOnlyTransaction_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' type ReadOnlyTransaction_Query_Call struct { *mock.Call } // Query is a helper method to define mock.On call // - ctx context.Context // - statement spanner.Statement func (_e *ReadOnlyTransaction_Expecter) Query(ctx interface{}, statement interface{}) *ReadOnlyTransaction_Query_Call { return &ReadOnlyTransaction_Query_Call{Call: _e.mock.On("Query", ctx, statement)} } func (_c *ReadOnlyTransaction_Query_Call) Run(run func(ctx context.Context, statement spanner.Statement)) *ReadOnlyTransaction_Query_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 spanner.Statement if args[1] != nil { arg1 = args[1].(spanner.Statement) } run( arg0, arg1, ) }) return _c } func (_c *ReadOnlyTransaction_Query_Call) Return(rowIterator spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { _c.Call.Return(rowIterator) return _c } func (_c *ReadOnlyTransaction_Query_Call) RunAndReturn(run func(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { _c.Call.Return(run) return _c }