github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/pkg/coveragedb/mocks/SpannerClient.go (about)

     1  // Code generated by mockery; DO NOT EDIT.
     2  // github.com/vektra/mockery
     3  // template: testify
     4  
     5  package mocks
     6  
     7  import (
     8  	"context"
     9  	"time"
    10  
    11  	"cloud.google.com/go/spanner"
    12  	"github.com/google/syzkaller/pkg/coveragedb/spannerclient"
    13  	mock "github.com/stretchr/testify/mock"
    14  )
    15  
    16  // 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.
    17  // The first argument is typically a *testing.T value.
    18  func NewSpannerClient(t interface {
    19  	mock.TestingT
    20  	Cleanup(func())
    21  }) *SpannerClient {
    22  	mock := &SpannerClient{}
    23  	mock.Mock.Test(t)
    24  
    25  	t.Cleanup(func() { mock.AssertExpectations(t) })
    26  
    27  	return mock
    28  }
    29  
    30  // SpannerClient is an autogenerated mock type for the SpannerClient type
    31  type SpannerClient struct {
    32  	mock.Mock
    33  }
    34  
    35  type SpannerClient_Expecter struct {
    36  	mock *mock.Mock
    37  }
    38  
    39  func (_m *SpannerClient) EXPECT() *SpannerClient_Expecter {
    40  	return &SpannerClient_Expecter{mock: &_m.Mock}
    41  }
    42  
    43  // Apply provides a mock function for the type SpannerClient
    44  func (_mock *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error) {
    45  	var tmpRet mock.Arguments
    46  	if len(opts) > 0 {
    47  		tmpRet = _mock.Called(ctx, ms, opts)
    48  	} else {
    49  		tmpRet = _mock.Called(ctx, ms)
    50  	}
    51  	ret := tmpRet
    52  
    53  	if len(ret) == 0 {
    54  		panic("no return value specified for Apply")
    55  	}
    56  
    57  	var r0 time.Time
    58  	var r1 error
    59  	if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) (time.Time, error)); ok {
    60  		return returnFunc(ctx, ms, opts...)
    61  	}
    62  	if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) time.Time); ok {
    63  		r0 = returnFunc(ctx, ms, opts...)
    64  	} else {
    65  		r0 = ret.Get(0).(time.Time)
    66  	}
    67  	if returnFunc, ok := ret.Get(1).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) error); ok {
    68  		r1 = returnFunc(ctx, ms, opts...)
    69  	} else {
    70  		r1 = ret.Error(1)
    71  	}
    72  	return r0, r1
    73  }
    74  
    75  // SpannerClient_Apply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Apply'
    76  type SpannerClient_Apply_Call struct {
    77  	*mock.Call
    78  }
    79  
    80  // Apply is a helper method to define mock.On call
    81  //   - ctx context.Context
    82  //   - ms []*spanner.Mutation
    83  //   - opts ...spanner.ApplyOption
    84  func (_e *SpannerClient_Expecter) Apply(ctx interface{}, ms interface{}, opts ...interface{}) *SpannerClient_Apply_Call {
    85  	return &SpannerClient_Apply_Call{Call: _e.mock.On("Apply",
    86  		append([]interface{}{ctx, ms}, opts...)...)}
    87  }
    88  
    89  func (_c *SpannerClient_Apply_Call) Run(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption)) *SpannerClient_Apply_Call {
    90  	_c.Call.Run(func(args mock.Arguments) {
    91  		var arg0 context.Context
    92  		if args[0] != nil {
    93  			arg0 = args[0].(context.Context)
    94  		}
    95  		var arg1 []*spanner.Mutation
    96  		if args[1] != nil {
    97  			arg1 = args[1].([]*spanner.Mutation)
    98  		}
    99  		var arg2 []spanner.ApplyOption
   100  		var variadicArgs []spanner.ApplyOption
   101  		if len(args) > 2 {
   102  			variadicArgs = args[2].([]spanner.ApplyOption)
   103  		}
   104  		arg2 = variadicArgs
   105  		run(
   106  			arg0,
   107  			arg1,
   108  			arg2...,
   109  		)
   110  	})
   111  	return _c
   112  }
   113  
   114  func (_c *SpannerClient_Apply_Call) Return(commitTimestamp time.Time, err error) *SpannerClient_Apply_Call {
   115  	_c.Call.Return(commitTimestamp, err)
   116  	return _c
   117  }
   118  
   119  func (_c *SpannerClient_Apply_Call) RunAndReturn(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error)) *SpannerClient_Apply_Call {
   120  	_c.Call.Return(run)
   121  	return _c
   122  }
   123  
   124  // Close provides a mock function for the type SpannerClient
   125  func (_mock *SpannerClient) Close() {
   126  	_mock.Called()
   127  	return
   128  }
   129  
   130  // SpannerClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
   131  type SpannerClient_Close_Call struct {
   132  	*mock.Call
   133  }
   134  
   135  // Close is a helper method to define mock.On call
   136  func (_e *SpannerClient_Expecter) Close() *SpannerClient_Close_Call {
   137  	return &SpannerClient_Close_Call{Call: _e.mock.On("Close")}
   138  }
   139  
   140  func (_c *SpannerClient_Close_Call) Run(run func()) *SpannerClient_Close_Call {
   141  	_c.Call.Run(func(args mock.Arguments) {
   142  		run()
   143  	})
   144  	return _c
   145  }
   146  
   147  func (_c *SpannerClient_Close_Call) Return() *SpannerClient_Close_Call {
   148  	_c.Call.Return()
   149  	return _c
   150  }
   151  
   152  func (_c *SpannerClient_Close_Call) RunAndReturn(run func()) *SpannerClient_Close_Call {
   153  	_c.Run(run)
   154  	return _c
   155  }
   156  
   157  // Single provides a mock function for the type SpannerClient
   158  func (_mock *SpannerClient) Single() spannerclient.ReadOnlyTransaction {
   159  	ret := _mock.Called()
   160  
   161  	if len(ret) == 0 {
   162  		panic("no return value specified for Single")
   163  	}
   164  
   165  	var r0 spannerclient.ReadOnlyTransaction
   166  	if returnFunc, ok := ret.Get(0).(func() spannerclient.ReadOnlyTransaction); ok {
   167  		r0 = returnFunc()
   168  	} else {
   169  		if ret.Get(0) != nil {
   170  			r0 = ret.Get(0).(spannerclient.ReadOnlyTransaction)
   171  		}
   172  	}
   173  	return r0
   174  }
   175  
   176  // SpannerClient_Single_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Single'
   177  type SpannerClient_Single_Call struct {
   178  	*mock.Call
   179  }
   180  
   181  // Single is a helper method to define mock.On call
   182  func (_e *SpannerClient_Expecter) Single() *SpannerClient_Single_Call {
   183  	return &SpannerClient_Single_Call{Call: _e.mock.On("Single")}
   184  }
   185  
   186  func (_c *SpannerClient_Single_Call) Run(run func()) *SpannerClient_Single_Call {
   187  	_c.Call.Run(func(args mock.Arguments) {
   188  		run()
   189  	})
   190  	return _c
   191  }
   192  
   193  func (_c *SpannerClient_Single_Call) Return(readOnlyTransaction spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call {
   194  	_c.Call.Return(readOnlyTransaction)
   195  	return _c
   196  }
   197  
   198  func (_c *SpannerClient_Single_Call) RunAndReturn(run func() spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call {
   199  	_c.Call.Return(run)
   200  	return _c
   201  }