github.com/grafana/pyroscope@v1.18.0/pkg/test/mocks/mockscheduler/mock_job_store.go (about)

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package mockscheduler
     4  
     5  import (
     6  	iter "github.com/grafana/pyroscope/pkg/iter"
     7  	mock "github.com/stretchr/testify/mock"
     8  	bbolt "go.etcd.io/bbolt"
     9  
    10  	raft_log "github.com/grafana/pyroscope/api/gen/proto/go/metastore/v1/raft_log"
    11  )
    12  
    13  // MockJobStore is an autogenerated mock type for the JobStore type
    14  type MockJobStore struct {
    15  	mock.Mock
    16  }
    17  
    18  type MockJobStore_Expecter struct {
    19  	mock *mock.Mock
    20  }
    21  
    22  func (_m *MockJobStore) EXPECT() *MockJobStore_Expecter {
    23  	return &MockJobStore_Expecter{mock: &_m.Mock}
    24  }
    25  
    26  // CreateBuckets provides a mock function with given fields: _a0
    27  func (_m *MockJobStore) CreateBuckets(_a0 *bbolt.Tx) error {
    28  	ret := _m.Called(_a0)
    29  
    30  	if len(ret) == 0 {
    31  		panic("no return value specified for CreateBuckets")
    32  	}
    33  
    34  	var r0 error
    35  	if rf, ok := ret.Get(0).(func(*bbolt.Tx) error); ok {
    36  		r0 = rf(_a0)
    37  	} else {
    38  		r0 = ret.Error(0)
    39  	}
    40  
    41  	return r0
    42  }
    43  
    44  // MockJobStore_CreateBuckets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateBuckets'
    45  type MockJobStore_CreateBuckets_Call struct {
    46  	*mock.Call
    47  }
    48  
    49  // CreateBuckets is a helper method to define mock.On call
    50  //   - _a0 *bbolt.Tx
    51  func (_e *MockJobStore_Expecter) CreateBuckets(_a0 interface{}) *MockJobStore_CreateBuckets_Call {
    52  	return &MockJobStore_CreateBuckets_Call{Call: _e.mock.On("CreateBuckets", _a0)}
    53  }
    54  
    55  func (_c *MockJobStore_CreateBuckets_Call) Run(run func(_a0 *bbolt.Tx)) *MockJobStore_CreateBuckets_Call {
    56  	_c.Call.Run(func(args mock.Arguments) {
    57  		run(args[0].(*bbolt.Tx))
    58  	})
    59  	return _c
    60  }
    61  
    62  func (_c *MockJobStore_CreateBuckets_Call) Return(_a0 error) *MockJobStore_CreateBuckets_Call {
    63  	_c.Call.Return(_a0)
    64  	return _c
    65  }
    66  
    67  func (_c *MockJobStore_CreateBuckets_Call) RunAndReturn(run func(*bbolt.Tx) error) *MockJobStore_CreateBuckets_Call {
    68  	_c.Call.Return(run)
    69  	return _c
    70  }
    71  
    72  // DeleteJobPlan provides a mock function with given fields: tx, name
    73  func (_m *MockJobStore) DeleteJobPlan(tx *bbolt.Tx, name string) error {
    74  	ret := _m.Called(tx, name)
    75  
    76  	if len(ret) == 0 {
    77  		panic("no return value specified for DeleteJobPlan")
    78  	}
    79  
    80  	var r0 error
    81  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) error); ok {
    82  		r0 = rf(tx, name)
    83  	} else {
    84  		r0 = ret.Error(0)
    85  	}
    86  
    87  	return r0
    88  }
    89  
    90  // MockJobStore_DeleteJobPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJobPlan'
    91  type MockJobStore_DeleteJobPlan_Call struct {
    92  	*mock.Call
    93  }
    94  
    95  // DeleteJobPlan is a helper method to define mock.On call
    96  //   - tx *bbolt.Tx
    97  //   - name string
    98  func (_e *MockJobStore_Expecter) DeleteJobPlan(tx interface{}, name interface{}) *MockJobStore_DeleteJobPlan_Call {
    99  	return &MockJobStore_DeleteJobPlan_Call{Call: _e.mock.On("DeleteJobPlan", tx, name)}
   100  }
   101  
   102  func (_c *MockJobStore_DeleteJobPlan_Call) Run(run func(tx *bbolt.Tx, name string)) *MockJobStore_DeleteJobPlan_Call {
   103  	_c.Call.Run(func(args mock.Arguments) {
   104  		run(args[0].(*bbolt.Tx), args[1].(string))
   105  	})
   106  	return _c
   107  }
   108  
   109  func (_c *MockJobStore_DeleteJobPlan_Call) Return(_a0 error) *MockJobStore_DeleteJobPlan_Call {
   110  	_c.Call.Return(_a0)
   111  	return _c
   112  }
   113  
   114  func (_c *MockJobStore_DeleteJobPlan_Call) RunAndReturn(run func(*bbolt.Tx, string) error) *MockJobStore_DeleteJobPlan_Call {
   115  	_c.Call.Return(run)
   116  	return _c
   117  }
   118  
   119  // DeleteJobState provides a mock function with given fields: tx, name
   120  func (_m *MockJobStore) DeleteJobState(tx *bbolt.Tx, name string) error {
   121  	ret := _m.Called(tx, name)
   122  
   123  	if len(ret) == 0 {
   124  		panic("no return value specified for DeleteJobState")
   125  	}
   126  
   127  	var r0 error
   128  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) error); ok {
   129  		r0 = rf(tx, name)
   130  	} else {
   131  		r0 = ret.Error(0)
   132  	}
   133  
   134  	return r0
   135  }
   136  
   137  // MockJobStore_DeleteJobState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJobState'
   138  type MockJobStore_DeleteJobState_Call struct {
   139  	*mock.Call
   140  }
   141  
   142  // DeleteJobState is a helper method to define mock.On call
   143  //   - tx *bbolt.Tx
   144  //   - name string
   145  func (_e *MockJobStore_Expecter) DeleteJobState(tx interface{}, name interface{}) *MockJobStore_DeleteJobState_Call {
   146  	return &MockJobStore_DeleteJobState_Call{Call: _e.mock.On("DeleteJobState", tx, name)}
   147  }
   148  
   149  func (_c *MockJobStore_DeleteJobState_Call) Run(run func(tx *bbolt.Tx, name string)) *MockJobStore_DeleteJobState_Call {
   150  	_c.Call.Run(func(args mock.Arguments) {
   151  		run(args[0].(*bbolt.Tx), args[1].(string))
   152  	})
   153  	return _c
   154  }
   155  
   156  func (_c *MockJobStore_DeleteJobState_Call) Return(_a0 error) *MockJobStore_DeleteJobState_Call {
   157  	_c.Call.Return(_a0)
   158  	return _c
   159  }
   160  
   161  func (_c *MockJobStore_DeleteJobState_Call) RunAndReturn(run func(*bbolt.Tx, string) error) *MockJobStore_DeleteJobState_Call {
   162  	_c.Call.Return(run)
   163  	return _c
   164  }
   165  
   166  // GetJobPlan provides a mock function with given fields: tx, name
   167  func (_m *MockJobStore) GetJobPlan(tx *bbolt.Tx, name string) (*raft_log.CompactionJobPlan, error) {
   168  	ret := _m.Called(tx, name)
   169  
   170  	if len(ret) == 0 {
   171  		panic("no return value specified for GetJobPlan")
   172  	}
   173  
   174  	var r0 *raft_log.CompactionJobPlan
   175  	var r1 error
   176  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) (*raft_log.CompactionJobPlan, error)); ok {
   177  		return rf(tx, name)
   178  	}
   179  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) *raft_log.CompactionJobPlan); ok {
   180  		r0 = rf(tx, name)
   181  	} else {
   182  		if ret.Get(0) != nil {
   183  			r0 = ret.Get(0).(*raft_log.CompactionJobPlan)
   184  		}
   185  	}
   186  
   187  	if rf, ok := ret.Get(1).(func(*bbolt.Tx, string) error); ok {
   188  		r1 = rf(tx, name)
   189  	} else {
   190  		r1 = ret.Error(1)
   191  	}
   192  
   193  	return r0, r1
   194  }
   195  
   196  // MockJobStore_GetJobPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJobPlan'
   197  type MockJobStore_GetJobPlan_Call struct {
   198  	*mock.Call
   199  }
   200  
   201  // GetJobPlan is a helper method to define mock.On call
   202  //   - tx *bbolt.Tx
   203  //   - name string
   204  func (_e *MockJobStore_Expecter) GetJobPlan(tx interface{}, name interface{}) *MockJobStore_GetJobPlan_Call {
   205  	return &MockJobStore_GetJobPlan_Call{Call: _e.mock.On("GetJobPlan", tx, name)}
   206  }
   207  
   208  func (_c *MockJobStore_GetJobPlan_Call) Run(run func(tx *bbolt.Tx, name string)) *MockJobStore_GetJobPlan_Call {
   209  	_c.Call.Run(func(args mock.Arguments) {
   210  		run(args[0].(*bbolt.Tx), args[1].(string))
   211  	})
   212  	return _c
   213  }
   214  
   215  func (_c *MockJobStore_GetJobPlan_Call) Return(_a0 *raft_log.CompactionJobPlan, _a1 error) *MockJobStore_GetJobPlan_Call {
   216  	_c.Call.Return(_a0, _a1)
   217  	return _c
   218  }
   219  
   220  func (_c *MockJobStore_GetJobPlan_Call) RunAndReturn(run func(*bbolt.Tx, string) (*raft_log.CompactionJobPlan, error)) *MockJobStore_GetJobPlan_Call {
   221  	_c.Call.Return(run)
   222  	return _c
   223  }
   224  
   225  // ListEntries provides a mock function with given fields: _a0
   226  func (_m *MockJobStore) ListEntries(_a0 *bbolt.Tx) iter.Iterator[*raft_log.CompactionJobState] {
   227  	ret := _m.Called(_a0)
   228  
   229  	if len(ret) == 0 {
   230  		panic("no return value specified for ListEntries")
   231  	}
   232  
   233  	var r0 iter.Iterator[*raft_log.CompactionJobState]
   234  	if rf, ok := ret.Get(0).(func(*bbolt.Tx) iter.Iterator[*raft_log.CompactionJobState]); ok {
   235  		r0 = rf(_a0)
   236  	} else {
   237  		if ret.Get(0) != nil {
   238  			r0 = ret.Get(0).(iter.Iterator[*raft_log.CompactionJobState])
   239  		}
   240  	}
   241  
   242  	return r0
   243  }
   244  
   245  // MockJobStore_ListEntries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntries'
   246  type MockJobStore_ListEntries_Call struct {
   247  	*mock.Call
   248  }
   249  
   250  // ListEntries is a helper method to define mock.On call
   251  //   - _a0 *bbolt.Tx
   252  func (_e *MockJobStore_Expecter) ListEntries(_a0 interface{}) *MockJobStore_ListEntries_Call {
   253  	return &MockJobStore_ListEntries_Call{Call: _e.mock.On("ListEntries", _a0)}
   254  }
   255  
   256  func (_c *MockJobStore_ListEntries_Call) Run(run func(_a0 *bbolt.Tx)) *MockJobStore_ListEntries_Call {
   257  	_c.Call.Run(func(args mock.Arguments) {
   258  		run(args[0].(*bbolt.Tx))
   259  	})
   260  	return _c
   261  }
   262  
   263  func (_c *MockJobStore_ListEntries_Call) Return(_a0 iter.Iterator[*raft_log.CompactionJobState]) *MockJobStore_ListEntries_Call {
   264  	_c.Call.Return(_a0)
   265  	return _c
   266  }
   267  
   268  func (_c *MockJobStore_ListEntries_Call) RunAndReturn(run func(*bbolt.Tx) iter.Iterator[*raft_log.CompactionJobState]) *MockJobStore_ListEntries_Call {
   269  	_c.Call.Return(run)
   270  	return _c
   271  }
   272  
   273  // StoreJobPlan provides a mock function with given fields: _a0, _a1
   274  func (_m *MockJobStore) StoreJobPlan(_a0 *bbolt.Tx, _a1 *raft_log.CompactionJobPlan) error {
   275  	ret := _m.Called(_a0, _a1)
   276  
   277  	if len(ret) == 0 {
   278  		panic("no return value specified for StoreJobPlan")
   279  	}
   280  
   281  	var r0 error
   282  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, *raft_log.CompactionJobPlan) error); ok {
   283  		r0 = rf(_a0, _a1)
   284  	} else {
   285  		r0 = ret.Error(0)
   286  	}
   287  
   288  	return r0
   289  }
   290  
   291  // MockJobStore_StoreJobPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreJobPlan'
   292  type MockJobStore_StoreJobPlan_Call struct {
   293  	*mock.Call
   294  }
   295  
   296  // StoreJobPlan is a helper method to define mock.On call
   297  //   - _a0 *bbolt.Tx
   298  //   - _a1 *raft_log.CompactionJobPlan
   299  func (_e *MockJobStore_Expecter) StoreJobPlan(_a0 interface{}, _a1 interface{}) *MockJobStore_StoreJobPlan_Call {
   300  	return &MockJobStore_StoreJobPlan_Call{Call: _e.mock.On("StoreJobPlan", _a0, _a1)}
   301  }
   302  
   303  func (_c *MockJobStore_StoreJobPlan_Call) Run(run func(_a0 *bbolt.Tx, _a1 *raft_log.CompactionJobPlan)) *MockJobStore_StoreJobPlan_Call {
   304  	_c.Call.Run(func(args mock.Arguments) {
   305  		run(args[0].(*bbolt.Tx), args[1].(*raft_log.CompactionJobPlan))
   306  	})
   307  	return _c
   308  }
   309  
   310  func (_c *MockJobStore_StoreJobPlan_Call) Return(_a0 error) *MockJobStore_StoreJobPlan_Call {
   311  	_c.Call.Return(_a0)
   312  	return _c
   313  }
   314  
   315  func (_c *MockJobStore_StoreJobPlan_Call) RunAndReturn(run func(*bbolt.Tx, *raft_log.CompactionJobPlan) error) *MockJobStore_StoreJobPlan_Call {
   316  	_c.Call.Return(run)
   317  	return _c
   318  }
   319  
   320  // StoreJobState provides a mock function with given fields: _a0, _a1
   321  func (_m *MockJobStore) StoreJobState(_a0 *bbolt.Tx, _a1 *raft_log.CompactionJobState) error {
   322  	ret := _m.Called(_a0, _a1)
   323  
   324  	if len(ret) == 0 {
   325  		panic("no return value specified for StoreJobState")
   326  	}
   327  
   328  	var r0 error
   329  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, *raft_log.CompactionJobState) error); ok {
   330  		r0 = rf(_a0, _a1)
   331  	} else {
   332  		r0 = ret.Error(0)
   333  	}
   334  
   335  	return r0
   336  }
   337  
   338  // MockJobStore_StoreJobState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreJobState'
   339  type MockJobStore_StoreJobState_Call struct {
   340  	*mock.Call
   341  }
   342  
   343  // StoreJobState is a helper method to define mock.On call
   344  //   - _a0 *bbolt.Tx
   345  //   - _a1 *raft_log.CompactionJobState
   346  func (_e *MockJobStore_Expecter) StoreJobState(_a0 interface{}, _a1 interface{}) *MockJobStore_StoreJobState_Call {
   347  	return &MockJobStore_StoreJobState_Call{Call: _e.mock.On("StoreJobState", _a0, _a1)}
   348  }
   349  
   350  func (_c *MockJobStore_StoreJobState_Call) Run(run func(_a0 *bbolt.Tx, _a1 *raft_log.CompactionJobState)) *MockJobStore_StoreJobState_Call {
   351  	_c.Call.Run(func(args mock.Arguments) {
   352  		run(args[0].(*bbolt.Tx), args[1].(*raft_log.CompactionJobState))
   353  	})
   354  	return _c
   355  }
   356  
   357  func (_c *MockJobStore_StoreJobState_Call) Return(_a0 error) *MockJobStore_StoreJobState_Call {
   358  	_c.Call.Return(_a0)
   359  	return _c
   360  }
   361  
   362  func (_c *MockJobStore_StoreJobState_Call) RunAndReturn(run func(*bbolt.Tx, *raft_log.CompactionJobState) error) *MockJobStore_StoreJobState_Call {
   363  	_c.Call.Return(run)
   364  	return _c
   365  }
   366  
   367  // NewMockJobStore creates a new instance of MockJobStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   368  // The first argument is typically a *testing.T value.
   369  func NewMockJobStore(t interface {
   370  	mock.TestingT
   371  	Cleanup(func())
   372  }) *MockJobStore {
   373  	mock := &MockJobStore{}
   374  	mock.Mock.Test(t)
   375  
   376  	t.Cleanup(func() { mock.AssertExpectations(t) })
   377  
   378  	return mock
   379  }