github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/pkg/persistence/automock/persistence_tx.go (about)

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package automock
     4  
     5  import (
     6  	context "context"
     7  
     8  	mock "github.com/stretchr/testify/mock"
     9  
    10  	sql "database/sql"
    11  )
    12  
    13  // PersistenceTx is an autogenerated mock type for the PersistenceTx type
    14  type PersistenceTx struct {
    15  	mock.Mock
    16  }
    17  
    18  // Commit provides a mock function with given fields:
    19  func (_m *PersistenceTx) Commit() error {
    20  	ret := _m.Called()
    21  
    22  	var r0 error
    23  	if rf, ok := ret.Get(0).(func() error); ok {
    24  		r0 = rf()
    25  	} else {
    26  		r0 = ret.Error(0)
    27  	}
    28  
    29  	return r0
    30  }
    31  
    32  // ExecContext provides a mock function with given fields: ctx, query, args
    33  func (_m *PersistenceTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
    34  	var _ca []interface{}
    35  	_ca = append(_ca, ctx, query)
    36  	_ca = append(_ca, args...)
    37  	ret := _m.Called(_ca...)
    38  
    39  	var r0 sql.Result
    40  	if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) sql.Result); ok {
    41  		r0 = rf(ctx, query, args...)
    42  	} else {
    43  		if ret.Get(0) != nil {
    44  			r0 = ret.Get(0).(sql.Result)
    45  		}
    46  	}
    47  
    48  	var r1 error
    49  	if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok {
    50  		r1 = rf(ctx, query, args...)
    51  	} else {
    52  		r1 = ret.Error(1)
    53  	}
    54  
    55  	return r0, r1
    56  }
    57  
    58  // GetContext provides a mock function with given fields: ctx, dest, query, args
    59  func (_m *PersistenceTx) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
    60  	var _ca []interface{}
    61  	_ca = append(_ca, ctx, dest, query)
    62  	_ca = append(_ca, args...)
    63  	ret := _m.Called(_ca...)
    64  
    65  	var r0 error
    66  	if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok {
    67  		r0 = rf(ctx, dest, query, args...)
    68  	} else {
    69  		r0 = ret.Error(0)
    70  	}
    71  
    72  	return r0
    73  }
    74  
    75  // NamedExecContext provides a mock function with given fields: ctx, query, arg
    76  func (_m *PersistenceTx) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) {
    77  	ret := _m.Called(ctx, query, arg)
    78  
    79  	var r0 sql.Result
    80  	if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) sql.Result); ok {
    81  		r0 = rf(ctx, query, arg)
    82  	} else {
    83  		if ret.Get(0) != nil {
    84  			r0 = ret.Get(0).(sql.Result)
    85  		}
    86  	}
    87  
    88  	var r1 error
    89  	if rf, ok := ret.Get(1).(func(context.Context, string, interface{}) error); ok {
    90  		r1 = rf(ctx, query, arg)
    91  	} else {
    92  		r1 = ret.Error(1)
    93  	}
    94  
    95  	return r0, r1
    96  }
    97  
    98  // Rollback provides a mock function with given fields:
    99  func (_m *PersistenceTx) Rollback() error {
   100  	ret := _m.Called()
   101  
   102  	var r0 error
   103  	if rf, ok := ret.Get(0).(func() error); ok {
   104  		r0 = rf()
   105  	} else {
   106  		r0 = ret.Error(0)
   107  	}
   108  
   109  	return r0
   110  }
   111  
   112  // SelectContext provides a mock function with given fields: ctx, dest, query, args
   113  func (_m *PersistenceTx) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
   114  	var _ca []interface{}
   115  	_ca = append(_ca, ctx, dest, query)
   116  	_ca = append(_ca, args...)
   117  	ret := _m.Called(_ca...)
   118  
   119  	var r0 error
   120  	if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok {
   121  		r0 = rf(ctx, dest, query, args...)
   122  	} else {
   123  		r0 = ret.Error(0)
   124  	}
   125  
   126  	return r0
   127  }
   128  
   129  type mockConstructorTestingTNewPersistenceTx interface {
   130  	mock.TestingT
   131  	Cleanup(func())
   132  }
   133  
   134  // NewPersistenceTx creates a new instance of PersistenceTx. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   135  func NewPersistenceTx(t mockConstructorTestingTNewPersistenceTx) *PersistenceTx {
   136  	mock := &PersistenceTx{}
   137  	mock.Mock.Test(t)
   138  
   139  	t.Cleanup(func() { mock.AssertExpectations(t) })
   140  
   141  	return mock
   142  }