github.com/khulnasoft-lab/tunnel-db@v0.0.0-20231117205118-74e1113bd007/pkg/db/mock_operation.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  package db
     4  
     5  import (
     6  	types "github.com/khulnasoft-lab/tunnel-db/pkg/types"
     7  	mock "github.com/stretchr/testify/mock"
     8  	bbolt "go.etcd.io/bbolt"
     9  )
    10  
    11  // MockOperation is an autogenerated mock type for the Operation type
    12  type MockOperation struct {
    13  	mock.Mock
    14  }
    15  
    16  type OperationBatchUpdateArgs struct {
    17  	Fn         func(*bbolt.Tx) error
    18  	FnAnything bool
    19  }
    20  
    21  type OperationBatchUpdateReturns struct {
    22  	Err error
    23  }
    24  
    25  type OperationBatchUpdateExpectation struct {
    26  	Args    OperationBatchUpdateArgs
    27  	Returns OperationBatchUpdateReturns
    28  }
    29  
    30  func (_m *MockOperation) ApplyBatchUpdateExpectation(e OperationBatchUpdateExpectation) {
    31  	var args []interface{}
    32  	if e.Args.FnAnything {
    33  		args = append(args, mock.Anything)
    34  	} else {
    35  		args = append(args, e.Args.Fn)
    36  	}
    37  	_m.On("BatchUpdate", args...).Return(e.Returns.Err)
    38  }
    39  
    40  func (_m *MockOperation) ApplyBatchUpdateExpectations(expectations []OperationBatchUpdateExpectation) {
    41  	for _, e := range expectations {
    42  		_m.ApplyBatchUpdateExpectation(e)
    43  	}
    44  }
    45  
    46  // BatchUpdate provides a mock function with given fields: fn
    47  func (_m *MockOperation) BatchUpdate(fn func(*bbolt.Tx) error) error {
    48  	ret := _m.Called(fn)
    49  
    50  	var r0 error
    51  	if rf, ok := ret.Get(0).(func(func(*bbolt.Tx) error) error); ok {
    52  		r0 = rf(fn)
    53  	} else {
    54  		r0 = ret.Error(0)
    55  	}
    56  
    57  	return r0
    58  }
    59  
    60  type OperationDeleteAdvisoryDetailBucketReturns struct {
    61  	_a0 error
    62  }
    63  
    64  type OperationDeleteAdvisoryDetailBucketExpectation struct {
    65  	Returns OperationDeleteAdvisoryDetailBucketReturns
    66  }
    67  
    68  func (_m *MockOperation) ApplyDeleteAdvisoryDetailBucketExpectation(e OperationDeleteAdvisoryDetailBucketExpectation) {
    69  	var args []interface{}
    70  	_m.On("DeleteAdvisoryDetailBucket", args...).Return(e.Returns._a0)
    71  }
    72  
    73  func (_m *MockOperation) ApplyDeleteAdvisoryDetailBucketExpectations(expectations []OperationDeleteAdvisoryDetailBucketExpectation) {
    74  	for _, e := range expectations {
    75  		_m.ApplyDeleteAdvisoryDetailBucketExpectation(e)
    76  	}
    77  }
    78  
    79  // DeleteAdvisoryDetailBucket provides a mock function with given fields:
    80  func (_m *MockOperation) DeleteAdvisoryDetailBucket() error {
    81  	ret := _m.Called()
    82  
    83  	var r0 error
    84  	if rf, ok := ret.Get(0).(func() error); ok {
    85  		r0 = rf()
    86  	} else {
    87  		r0 = ret.Error(0)
    88  	}
    89  
    90  	return r0
    91  }
    92  
    93  type OperationDeleteVulnerabilityDetailBucketReturns struct {
    94  	Err error
    95  }
    96  
    97  type OperationDeleteVulnerabilityDetailBucketExpectation struct {
    98  	Returns OperationDeleteVulnerabilityDetailBucketReturns
    99  }
   100  
   101  func (_m *MockOperation) ApplyDeleteVulnerabilityDetailBucketExpectation(e OperationDeleteVulnerabilityDetailBucketExpectation) {
   102  	var args []interface{}
   103  	_m.On("DeleteVulnerabilityDetailBucket", args...).Return(e.Returns.Err)
   104  }
   105  
   106  func (_m *MockOperation) ApplyDeleteVulnerabilityDetailBucketExpectations(expectations []OperationDeleteVulnerabilityDetailBucketExpectation) {
   107  	for _, e := range expectations {
   108  		_m.ApplyDeleteVulnerabilityDetailBucketExpectation(e)
   109  	}
   110  }
   111  
   112  // DeleteVulnerabilityDetailBucket provides a mock function with given fields:
   113  func (_m *MockOperation) DeleteVulnerabilityDetailBucket() error {
   114  	ret := _m.Called()
   115  
   116  	var r0 error
   117  	if rf, ok := ret.Get(0).(func() error); ok {
   118  		r0 = rf()
   119  	} else {
   120  		r0 = ret.Error(0)
   121  	}
   122  
   123  	return r0
   124  }
   125  
   126  type OperationForEachAdvisoryArgs struct {
   127  	Sources         []string
   128  	SourcesAnything bool
   129  	PkgName         string
   130  	PkgNameAnything bool
   131  }
   132  
   133  type OperationForEachAdvisoryReturns struct {
   134  	Value map[string]Value
   135  	Err   error
   136  }
   137  
   138  type OperationForEachAdvisoryExpectation struct {
   139  	Args    OperationForEachAdvisoryArgs
   140  	Returns OperationForEachAdvisoryReturns
   141  }
   142  
   143  func (_m *MockOperation) ApplyForEachAdvisoryExpectation(e OperationForEachAdvisoryExpectation) {
   144  	var args []interface{}
   145  	if e.Args.SourcesAnything {
   146  		args = append(args, mock.Anything)
   147  	} else {
   148  		args = append(args, e.Args.Sources)
   149  	}
   150  	if e.Args.PkgNameAnything {
   151  		args = append(args, mock.Anything)
   152  	} else {
   153  		args = append(args, e.Args.PkgName)
   154  	}
   155  	_m.On("ForEachAdvisory", args...).Return(e.Returns.Value, e.Returns.Err)
   156  }
   157  
   158  func (_m *MockOperation) ApplyForEachAdvisoryExpectations(expectations []OperationForEachAdvisoryExpectation) {
   159  	for _, e := range expectations {
   160  		_m.ApplyForEachAdvisoryExpectation(e)
   161  	}
   162  }
   163  
   164  // ForEachAdvisory provides a mock function with given fields: sources, pkgName
   165  func (_m *MockOperation) ForEachAdvisory(sources []string, pkgName string) (map[string]Value, error) {
   166  	ret := _m.Called(sources, pkgName)
   167  
   168  	var r0 map[string]Value
   169  	if rf, ok := ret.Get(0).(func([]string, string) map[string]Value); ok {
   170  		r0 = rf(sources, pkgName)
   171  	} else {
   172  		if ret.Get(0) != nil {
   173  			r0 = ret.Get(0).(map[string]Value)
   174  		}
   175  	}
   176  
   177  	var r1 error
   178  	if rf, ok := ret.Get(1).(func([]string, string) error); ok {
   179  		r1 = rf(sources, pkgName)
   180  	} else {
   181  		r1 = ret.Error(1)
   182  	}
   183  
   184  	return r0, r1
   185  }
   186  
   187  type OperationForEachVulnerabilityIDArgs struct {
   188  	Fn         func(*bbolt.Tx, string) error
   189  	FnAnything bool
   190  }
   191  
   192  type OperationForEachVulnerabilityIDReturns struct {
   193  	Err error
   194  }
   195  
   196  type OperationForEachVulnerabilityIDExpectation struct {
   197  	Args    OperationForEachVulnerabilityIDArgs
   198  	Returns OperationForEachVulnerabilityIDReturns
   199  }
   200  
   201  func (_m *MockOperation) ApplyForEachVulnerabilityIDExpectation(e OperationForEachVulnerabilityIDExpectation) {
   202  	var args []interface{}
   203  	if e.Args.FnAnything {
   204  		args = append(args, mock.Anything)
   205  	} else {
   206  		args = append(args, e.Args.Fn)
   207  	}
   208  	_m.On("ForEachVulnerabilityID", args...).Return(e.Returns.Err)
   209  }
   210  
   211  func (_m *MockOperation) ApplyForEachVulnerabilityIDExpectations(expectations []OperationForEachVulnerabilityIDExpectation) {
   212  	for _, e := range expectations {
   213  		_m.ApplyForEachVulnerabilityIDExpectation(e)
   214  	}
   215  }
   216  
   217  // ForEachVulnerabilityID provides a mock function with given fields: fn
   218  func (_m *MockOperation) ForEachVulnerabilityID(fn func(*bbolt.Tx, string) error) error {
   219  	ret := _m.Called(fn)
   220  
   221  	var r0 error
   222  	if rf, ok := ret.Get(0).(func(func(*bbolt.Tx, string) error) error); ok {
   223  		r0 = rf(fn)
   224  	} else {
   225  		r0 = ret.Error(0)
   226  	}
   227  
   228  	return r0
   229  }
   230  
   231  type OperationGetAdvisoriesArgs struct {
   232  	Source          string
   233  	SourceAnything  bool
   234  	PkgName         string
   235  	PkgNameAnything bool
   236  }
   237  
   238  type OperationGetAdvisoriesReturns struct {
   239  	Advisories []types.Advisory
   240  	Err        error
   241  }
   242  
   243  type OperationGetAdvisoriesExpectation struct {
   244  	Args    OperationGetAdvisoriesArgs
   245  	Returns OperationGetAdvisoriesReturns
   246  }
   247  
   248  func (_m *MockOperation) ApplyGetAdvisoriesExpectation(e OperationGetAdvisoriesExpectation) {
   249  	var args []interface{}
   250  	if e.Args.SourceAnything {
   251  		args = append(args, mock.Anything)
   252  	} else {
   253  		args = append(args, e.Args.Source)
   254  	}
   255  	if e.Args.PkgNameAnything {
   256  		args = append(args, mock.Anything)
   257  	} else {
   258  		args = append(args, e.Args.PkgName)
   259  	}
   260  	_m.On("GetAdvisories", args...).Return(e.Returns.Advisories, e.Returns.Err)
   261  }
   262  
   263  func (_m *MockOperation) ApplyGetAdvisoriesExpectations(expectations []OperationGetAdvisoriesExpectation) {
   264  	for _, e := range expectations {
   265  		_m.ApplyGetAdvisoriesExpectation(e)
   266  	}
   267  }
   268  
   269  // GetAdvisories provides a mock function with given fields: source, pkgName
   270  func (_m *MockOperation) GetAdvisories(source string, pkgName string) ([]types.Advisory, error) {
   271  	ret := _m.Called(source, pkgName)
   272  
   273  	var r0 []types.Advisory
   274  	if rf, ok := ret.Get(0).(func(string, string) []types.Advisory); ok {
   275  		r0 = rf(source, pkgName)
   276  	} else {
   277  		if ret.Get(0) != nil {
   278  			r0 = ret.Get(0).([]types.Advisory)
   279  		}
   280  	}
   281  
   282  	var r1 error
   283  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
   284  		r1 = rf(source, pkgName)
   285  	} else {
   286  		r1 = ret.Error(1)
   287  	}
   288  
   289  	return r0, r1
   290  }
   291  
   292  type OperationGetVulnerabilityArgs struct {
   293  	VulnerabilityID         string
   294  	VulnerabilityIDAnything bool
   295  }
   296  
   297  type OperationGetVulnerabilityReturns struct {
   298  	Vulnerability types.Vulnerability
   299  	Err           error
   300  }
   301  
   302  type OperationGetVulnerabilityExpectation struct {
   303  	Args    OperationGetVulnerabilityArgs
   304  	Returns OperationGetVulnerabilityReturns
   305  }
   306  
   307  func (_m *MockOperation) ApplyGetVulnerabilityExpectation(e OperationGetVulnerabilityExpectation) {
   308  	var args []interface{}
   309  	if e.Args.VulnerabilityIDAnything {
   310  		args = append(args, mock.Anything)
   311  	} else {
   312  		args = append(args, e.Args.VulnerabilityID)
   313  	}
   314  	_m.On("GetVulnerability", args...).Return(e.Returns.Vulnerability, e.Returns.Err)
   315  }
   316  
   317  func (_m *MockOperation) ApplyGetVulnerabilityExpectations(expectations []OperationGetVulnerabilityExpectation) {
   318  	for _, e := range expectations {
   319  		_m.ApplyGetVulnerabilityExpectation(e)
   320  	}
   321  }
   322  
   323  // GetVulnerability provides a mock function with given fields: vulnerabilityID
   324  func (_m *MockOperation) GetVulnerability(vulnerabilityID string) (types.Vulnerability, error) {
   325  	ret := _m.Called(vulnerabilityID)
   326  
   327  	var r0 types.Vulnerability
   328  	if rf, ok := ret.Get(0).(func(string) types.Vulnerability); ok {
   329  		r0 = rf(vulnerabilityID)
   330  	} else {
   331  		r0 = ret.Get(0).(types.Vulnerability)
   332  	}
   333  
   334  	var r1 error
   335  	if rf, ok := ret.Get(1).(func(string) error); ok {
   336  		r1 = rf(vulnerabilityID)
   337  	} else {
   338  		r1 = ret.Error(1)
   339  	}
   340  
   341  	return r0, r1
   342  }
   343  
   344  type OperationGetVulnerabilityDetailArgs struct {
   345  	CveID         string
   346  	CveIDAnything bool
   347  }
   348  
   349  type OperationGetVulnerabilityDetailReturns struct {
   350  	Detail map[types.SourceID]types.VulnerabilityDetail
   351  	Err    error
   352  }
   353  
   354  type OperationGetVulnerabilityDetailExpectation struct {
   355  	Args    OperationGetVulnerabilityDetailArgs
   356  	Returns OperationGetVulnerabilityDetailReturns
   357  }
   358  
   359  func (_m *MockOperation) ApplyGetVulnerabilityDetailExpectation(e OperationGetVulnerabilityDetailExpectation) {
   360  	var args []interface{}
   361  	if e.Args.CveIDAnything {
   362  		args = append(args, mock.Anything)
   363  	} else {
   364  		args = append(args, e.Args.CveID)
   365  	}
   366  	_m.On("GetVulnerabilityDetail", args...).Return(e.Returns.Detail, e.Returns.Err)
   367  }
   368  
   369  func (_m *MockOperation) ApplyGetVulnerabilityDetailExpectations(expectations []OperationGetVulnerabilityDetailExpectation) {
   370  	for _, e := range expectations {
   371  		_m.ApplyGetVulnerabilityDetailExpectation(e)
   372  	}
   373  }
   374  
   375  // GetVulnerabilityDetail provides a mock function with given fields: cveID
   376  func (_m *MockOperation) GetVulnerabilityDetail(cveID string) (map[types.SourceID]types.VulnerabilityDetail, error) {
   377  	ret := _m.Called(cveID)
   378  
   379  	var r0 map[types.SourceID]types.VulnerabilityDetail
   380  	if rf, ok := ret.Get(0).(func(string) map[types.SourceID]types.VulnerabilityDetail); ok {
   381  		r0 = rf(cveID)
   382  	} else {
   383  		if ret.Get(0) != nil {
   384  			r0 = ret.Get(0).(map[types.SourceID]types.VulnerabilityDetail)
   385  		}
   386  	}
   387  
   388  	var r1 error
   389  	if rf, ok := ret.Get(1).(func(string) error); ok {
   390  		r1 = rf(cveID)
   391  	} else {
   392  		r1 = ret.Error(1)
   393  	}
   394  
   395  	return r0, r1
   396  }
   397  
   398  type OperationPutAdvisoryDetailArgs struct {
   399  	Tx                      *bbolt.Tx
   400  	TxAnything              bool
   401  	VulnerabilityID         string
   402  	VulnerabilityIDAnything bool
   403  	PkgName                 string
   404  	PkgNameAnything         bool
   405  	NestedBktNames          []string
   406  	NestedBktNamesAnything  bool
   407  	Advisory                interface{}
   408  	AdvisoryAnything        bool
   409  }
   410  
   411  type OperationPutAdvisoryDetailReturns struct {
   412  	Err error
   413  }
   414  
   415  type OperationPutAdvisoryDetailExpectation struct {
   416  	Args    OperationPutAdvisoryDetailArgs
   417  	Returns OperationPutAdvisoryDetailReturns
   418  }
   419  
   420  func (_m *MockOperation) ApplyPutAdvisoryDetailExpectation(e OperationPutAdvisoryDetailExpectation) {
   421  	var args []interface{}
   422  	if e.Args.TxAnything {
   423  		args = append(args, mock.Anything)
   424  	} else {
   425  		args = append(args, e.Args.Tx)
   426  	}
   427  	if e.Args.VulnerabilityIDAnything {
   428  		args = append(args, mock.Anything)
   429  	} else {
   430  		args = append(args, e.Args.VulnerabilityID)
   431  	}
   432  	if e.Args.PkgNameAnything {
   433  		args = append(args, mock.Anything)
   434  	} else {
   435  		args = append(args, e.Args.PkgName)
   436  	}
   437  	if e.Args.NestedBktNamesAnything {
   438  		args = append(args, mock.Anything)
   439  	} else {
   440  		args = append(args, e.Args.NestedBktNames)
   441  	}
   442  	if e.Args.AdvisoryAnything {
   443  		args = append(args, mock.Anything)
   444  	} else {
   445  		args = append(args, e.Args.Advisory)
   446  	}
   447  	_m.On("PutAdvisoryDetail", args...).Return(e.Returns.Err)
   448  }
   449  
   450  func (_m *MockOperation) ApplyPutAdvisoryDetailExpectations(expectations []OperationPutAdvisoryDetailExpectation) {
   451  	for _, e := range expectations {
   452  		_m.ApplyPutAdvisoryDetailExpectation(e)
   453  	}
   454  }
   455  
   456  // PutAdvisoryDetail provides a mock function with given fields: tx, vulnerabilityID, pkgName, nestedBktNames, advisory
   457  func (_m *MockOperation) PutAdvisoryDetail(tx *bbolt.Tx, vulnerabilityID string, pkgName string, nestedBktNames []string, advisory interface{}) error {
   458  	ret := _m.Called(tx, vulnerabilityID, pkgName, nestedBktNames, advisory)
   459  
   460  	var r0 error
   461  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, string, []string, interface{}) error); ok {
   462  		r0 = rf(tx, vulnerabilityID, pkgName, nestedBktNames, advisory)
   463  	} else {
   464  		r0 = ret.Error(0)
   465  	}
   466  
   467  	return r0
   468  }
   469  
   470  type OperationPutDataSourceArgs struct {
   471  	Tx              *bbolt.Tx
   472  	TxAnything      bool
   473  	BktName         string
   474  	BktNameAnything bool
   475  	Source          types.DataSource
   476  	SourceAnything  bool
   477  }
   478  
   479  type OperationPutDataSourceReturns struct {
   480  	Err error
   481  }
   482  
   483  type OperationPutDataSourceExpectation struct {
   484  	Args    OperationPutDataSourceArgs
   485  	Returns OperationPutDataSourceReturns
   486  }
   487  
   488  func (_m *MockOperation) ApplyPutDataSourceExpectation(e OperationPutDataSourceExpectation) {
   489  	var args []interface{}
   490  	if e.Args.TxAnything {
   491  		args = append(args, mock.Anything)
   492  	} else {
   493  		args = append(args, e.Args.Tx)
   494  	}
   495  	if e.Args.BktNameAnything {
   496  		args = append(args, mock.Anything)
   497  	} else {
   498  		args = append(args, e.Args.BktName)
   499  	}
   500  	if e.Args.SourceAnything {
   501  		args = append(args, mock.Anything)
   502  	} else {
   503  		args = append(args, e.Args.Source)
   504  	}
   505  	_m.On("PutDataSource", args...).Return(e.Returns.Err)
   506  }
   507  
   508  func (_m *MockOperation) ApplyPutDataSourceExpectations(expectations []OperationPutDataSourceExpectation) {
   509  	for _, e := range expectations {
   510  		_m.ApplyPutDataSourceExpectation(e)
   511  	}
   512  }
   513  
   514  // PutDataSource provides a mock function with given fields: tx, bktName, source
   515  func (_m *MockOperation) PutDataSource(tx *bbolt.Tx, bktName string, source types.DataSource) error {
   516  	ret := _m.Called(tx, bktName, source)
   517  
   518  	var r0 error
   519  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, types.DataSource) error); ok {
   520  		r0 = rf(tx, bktName, source)
   521  	} else {
   522  		r0 = ret.Error(0)
   523  	}
   524  
   525  	return r0
   526  }
   527  
   528  type OperationPutRedHatCPEsArgs struct {
   529  	Tx               *bbolt.Tx
   530  	TxAnything       bool
   531  	CpeIndex         int
   532  	CpeIndexAnything bool
   533  	Cpe              string
   534  	CpeAnything      bool
   535  }
   536  
   537  type OperationPutRedHatCPEsReturns struct {
   538  	Err error
   539  }
   540  
   541  type OperationPutRedHatCPEsExpectation struct {
   542  	Args    OperationPutRedHatCPEsArgs
   543  	Returns OperationPutRedHatCPEsReturns
   544  }
   545  
   546  func (_m *MockOperation) ApplyPutRedHatCPEsExpectation(e OperationPutRedHatCPEsExpectation) {
   547  	var args []interface{}
   548  	if e.Args.TxAnything {
   549  		args = append(args, mock.Anything)
   550  	} else {
   551  		args = append(args, e.Args.Tx)
   552  	}
   553  	if e.Args.CpeIndexAnything {
   554  		args = append(args, mock.Anything)
   555  	} else {
   556  		args = append(args, e.Args.CpeIndex)
   557  	}
   558  	if e.Args.CpeAnything {
   559  		args = append(args, mock.Anything)
   560  	} else {
   561  		args = append(args, e.Args.Cpe)
   562  	}
   563  	_m.On("PutRedHatCPEs", args...).Return(e.Returns.Err)
   564  }
   565  
   566  func (_m *MockOperation) ApplyPutRedHatCPEsExpectations(expectations []OperationPutRedHatCPEsExpectation) {
   567  	for _, e := range expectations {
   568  		_m.ApplyPutRedHatCPEsExpectation(e)
   569  	}
   570  }
   571  
   572  // PutRedHatCPEs provides a mock function with given fields: tx, cpeIndex, cpe
   573  func (_m *MockOperation) PutRedHatCPEs(tx *bbolt.Tx, cpeIndex int, cpe string) error {
   574  	ret := _m.Called(tx, cpeIndex, cpe)
   575  
   576  	var r0 error
   577  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, int, string) error); ok {
   578  		r0 = rf(tx, cpeIndex, cpe)
   579  	} else {
   580  		r0 = ret.Error(0)
   581  	}
   582  
   583  	return r0
   584  }
   585  
   586  type OperationPutRedHatNVRsArgs struct {
   587  	Tx                 *bbolt.Tx
   588  	TxAnything         bool
   589  	Nvr                string
   590  	NvrAnything        bool
   591  	CpeIndices         []int
   592  	CpeIndicesAnything bool
   593  }
   594  
   595  type OperationPutRedHatNVRsReturns struct {
   596  	Err error
   597  }
   598  
   599  type OperationPutRedHatNVRsExpectation struct {
   600  	Args    OperationPutRedHatNVRsArgs
   601  	Returns OperationPutRedHatNVRsReturns
   602  }
   603  
   604  func (_m *MockOperation) ApplyPutRedHatNVRsExpectation(e OperationPutRedHatNVRsExpectation) {
   605  	var args []interface{}
   606  	if e.Args.TxAnything {
   607  		args = append(args, mock.Anything)
   608  	} else {
   609  		args = append(args, e.Args.Tx)
   610  	}
   611  	if e.Args.NvrAnything {
   612  		args = append(args, mock.Anything)
   613  	} else {
   614  		args = append(args, e.Args.Nvr)
   615  	}
   616  	if e.Args.CpeIndicesAnything {
   617  		args = append(args, mock.Anything)
   618  	} else {
   619  		args = append(args, e.Args.CpeIndices)
   620  	}
   621  	_m.On("PutRedHatNVRs", args...).Return(e.Returns.Err)
   622  }
   623  
   624  func (_m *MockOperation) ApplyPutRedHatNVRsExpectations(expectations []OperationPutRedHatNVRsExpectation) {
   625  	for _, e := range expectations {
   626  		_m.ApplyPutRedHatNVRsExpectation(e)
   627  	}
   628  }
   629  
   630  // PutRedHatNVRs provides a mock function with given fields: tx, nvr, cpeIndices
   631  func (_m *MockOperation) PutRedHatNVRs(tx *bbolt.Tx, nvr string, cpeIndices []int) error {
   632  	ret := _m.Called(tx, nvr, cpeIndices)
   633  
   634  	var r0 error
   635  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, []int) error); ok {
   636  		r0 = rf(tx, nvr, cpeIndices)
   637  	} else {
   638  		r0 = ret.Error(0)
   639  	}
   640  
   641  	return r0
   642  }
   643  
   644  type OperationPutRedHatRepositoriesArgs struct {
   645  	Tx                 *bbolt.Tx
   646  	TxAnything         bool
   647  	Repository         string
   648  	RepositoryAnything bool
   649  	CpeIndices         []int
   650  	CpeIndicesAnything bool
   651  }
   652  
   653  type OperationPutRedHatRepositoriesReturns struct {
   654  	Err error
   655  }
   656  
   657  type OperationPutRedHatRepositoriesExpectation struct {
   658  	Args    OperationPutRedHatRepositoriesArgs
   659  	Returns OperationPutRedHatRepositoriesReturns
   660  }
   661  
   662  func (_m *MockOperation) ApplyPutRedHatRepositoriesExpectation(e OperationPutRedHatRepositoriesExpectation) {
   663  	var args []interface{}
   664  	if e.Args.TxAnything {
   665  		args = append(args, mock.Anything)
   666  	} else {
   667  		args = append(args, e.Args.Tx)
   668  	}
   669  	if e.Args.RepositoryAnything {
   670  		args = append(args, mock.Anything)
   671  	} else {
   672  		args = append(args, e.Args.Repository)
   673  	}
   674  	if e.Args.CpeIndicesAnything {
   675  		args = append(args, mock.Anything)
   676  	} else {
   677  		args = append(args, e.Args.CpeIndices)
   678  	}
   679  	_m.On("PutRedHatRepositories", args...).Return(e.Returns.Err)
   680  }
   681  
   682  func (_m *MockOperation) ApplyPutRedHatRepositoriesExpectations(expectations []OperationPutRedHatRepositoriesExpectation) {
   683  	for _, e := range expectations {
   684  		_m.ApplyPutRedHatRepositoriesExpectation(e)
   685  	}
   686  }
   687  
   688  // PutRedHatRepositories provides a mock function with given fields: tx, repository, cpeIndices
   689  func (_m *MockOperation) PutRedHatRepositories(tx *bbolt.Tx, repository string, cpeIndices []int) error {
   690  	ret := _m.Called(tx, repository, cpeIndices)
   691  
   692  	var r0 error
   693  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, []int) error); ok {
   694  		r0 = rf(tx, repository, cpeIndices)
   695  	} else {
   696  		r0 = ret.Error(0)
   697  	}
   698  
   699  	return r0
   700  }
   701  
   702  type OperationPutVulnerabilityArgs struct {
   703  	Tx                      *bbolt.Tx
   704  	TxAnything              bool
   705  	VulnerabilityID         string
   706  	VulnerabilityIDAnything bool
   707  	Vulnerability           types.Vulnerability
   708  	VulnerabilityAnything   bool
   709  }
   710  
   711  type OperationPutVulnerabilityReturns struct {
   712  	Err error
   713  }
   714  
   715  type OperationPutVulnerabilityExpectation struct {
   716  	Args    OperationPutVulnerabilityArgs
   717  	Returns OperationPutVulnerabilityReturns
   718  }
   719  
   720  func (_m *MockOperation) ApplyPutVulnerabilityExpectation(e OperationPutVulnerabilityExpectation) {
   721  	var args []interface{}
   722  	if e.Args.TxAnything {
   723  		args = append(args, mock.Anything)
   724  	} else {
   725  		args = append(args, e.Args.Tx)
   726  	}
   727  	if e.Args.VulnerabilityIDAnything {
   728  		args = append(args, mock.Anything)
   729  	} else {
   730  		args = append(args, e.Args.VulnerabilityID)
   731  	}
   732  	if e.Args.VulnerabilityAnything {
   733  		args = append(args, mock.Anything)
   734  	} else {
   735  		args = append(args, e.Args.Vulnerability)
   736  	}
   737  	_m.On("PutVulnerability", args...).Return(e.Returns.Err)
   738  }
   739  
   740  func (_m *MockOperation) ApplyPutVulnerabilityExpectations(expectations []OperationPutVulnerabilityExpectation) {
   741  	for _, e := range expectations {
   742  		_m.ApplyPutVulnerabilityExpectation(e)
   743  	}
   744  }
   745  
   746  // PutVulnerability provides a mock function with given fields: tx, vulnerabilityID, vulnerability
   747  func (_m *MockOperation) PutVulnerability(tx *bbolt.Tx, vulnerabilityID string, vulnerability types.Vulnerability) error {
   748  	ret := _m.Called(tx, vulnerabilityID, vulnerability)
   749  
   750  	var r0 error
   751  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, types.Vulnerability) error); ok {
   752  		r0 = rf(tx, vulnerabilityID, vulnerability)
   753  	} else {
   754  		r0 = ret.Error(0)
   755  	}
   756  
   757  	return r0
   758  }
   759  
   760  type OperationPutVulnerabilityDetailArgs struct {
   761  	Tx                      *bbolt.Tx
   762  	TxAnything              bool
   763  	VulnerabilityID         string
   764  	VulnerabilityIDAnything bool
   765  	Source                  types.SourceID
   766  	SourceAnything          bool
   767  	Vulnerability           types.VulnerabilityDetail
   768  	VulnerabilityAnything   bool
   769  }
   770  
   771  type OperationPutVulnerabilityDetailReturns struct {
   772  	Err error
   773  }
   774  
   775  type OperationPutVulnerabilityDetailExpectation struct {
   776  	Args    OperationPutVulnerabilityDetailArgs
   777  	Returns OperationPutVulnerabilityDetailReturns
   778  }
   779  
   780  func (_m *MockOperation) ApplyPutVulnerabilityDetailExpectation(e OperationPutVulnerabilityDetailExpectation) {
   781  	var args []interface{}
   782  	if e.Args.TxAnything {
   783  		args = append(args, mock.Anything)
   784  	} else {
   785  		args = append(args, e.Args.Tx)
   786  	}
   787  	if e.Args.VulnerabilityIDAnything {
   788  		args = append(args, mock.Anything)
   789  	} else {
   790  		args = append(args, e.Args.VulnerabilityID)
   791  	}
   792  	if e.Args.SourceAnything {
   793  		args = append(args, mock.Anything)
   794  	} else {
   795  		args = append(args, e.Args.Source)
   796  	}
   797  	if e.Args.VulnerabilityAnything {
   798  		args = append(args, mock.Anything)
   799  	} else {
   800  		args = append(args, e.Args.Vulnerability)
   801  	}
   802  	_m.On("PutVulnerabilityDetail", args...).Return(e.Returns.Err)
   803  }
   804  
   805  func (_m *MockOperation) ApplyPutVulnerabilityDetailExpectations(expectations []OperationPutVulnerabilityDetailExpectation) {
   806  	for _, e := range expectations {
   807  		_m.ApplyPutVulnerabilityDetailExpectation(e)
   808  	}
   809  }
   810  
   811  // PutVulnerabilityDetail provides a mock function with given fields: tx, vulnerabilityID, source, vulnerability
   812  func (_m *MockOperation) PutVulnerabilityDetail(tx *bbolt.Tx, vulnerabilityID string, source types.SourceID, vulnerability types.VulnerabilityDetail) error {
   813  	ret := _m.Called(tx, vulnerabilityID, source, vulnerability)
   814  
   815  	var r0 error
   816  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, types.SourceID, types.VulnerabilityDetail) error); ok {
   817  		r0 = rf(tx, vulnerabilityID, source, vulnerability)
   818  	} else {
   819  		r0 = ret.Error(0)
   820  	}
   821  
   822  	return r0
   823  }
   824  
   825  type OperationPutVulnerabilityIDArgs struct {
   826  	Tx                      *bbolt.Tx
   827  	TxAnything              bool
   828  	VulnerabilityID         string
   829  	VulnerabilityIDAnything bool
   830  }
   831  
   832  type OperationPutVulnerabilityIDReturns struct {
   833  	Err error
   834  }
   835  
   836  type OperationPutVulnerabilityIDExpectation struct {
   837  	Args    OperationPutVulnerabilityIDArgs
   838  	Returns OperationPutVulnerabilityIDReturns
   839  }
   840  
   841  func (_m *MockOperation) ApplyPutVulnerabilityIDExpectation(e OperationPutVulnerabilityIDExpectation) {
   842  	var args []interface{}
   843  	if e.Args.TxAnything {
   844  		args = append(args, mock.Anything)
   845  	} else {
   846  		args = append(args, e.Args.Tx)
   847  	}
   848  	if e.Args.VulnerabilityIDAnything {
   849  		args = append(args, mock.Anything)
   850  	} else {
   851  		args = append(args, e.Args.VulnerabilityID)
   852  	}
   853  	_m.On("PutVulnerabilityID", args...).Return(e.Returns.Err)
   854  }
   855  
   856  func (_m *MockOperation) ApplyPutVulnerabilityIDExpectations(expectations []OperationPutVulnerabilityIDExpectation) {
   857  	for _, e := range expectations {
   858  		_m.ApplyPutVulnerabilityIDExpectation(e)
   859  	}
   860  }
   861  
   862  // PutVulnerabilityID provides a mock function with given fields: tx, vulnerabilityID
   863  func (_m *MockOperation) PutVulnerabilityID(tx *bbolt.Tx, vulnerabilityID string) error {
   864  	ret := _m.Called(tx, vulnerabilityID)
   865  
   866  	var r0 error
   867  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) error); ok {
   868  		r0 = rf(tx, vulnerabilityID)
   869  	} else {
   870  		r0 = ret.Error(0)
   871  	}
   872  
   873  	return r0
   874  }
   875  
   876  type OperationRedHatNVRToCPEsArgs struct {
   877  	Nvr         string
   878  	NvrAnything bool
   879  }
   880  
   881  type OperationRedHatNVRToCPEsReturns struct {
   882  	CpeIndices []int
   883  	Err        error
   884  }
   885  
   886  type OperationRedHatNVRToCPEsExpectation struct {
   887  	Args    OperationRedHatNVRToCPEsArgs
   888  	Returns OperationRedHatNVRToCPEsReturns
   889  }
   890  
   891  func (_m *MockOperation) ApplyRedHatNVRToCPEsExpectation(e OperationRedHatNVRToCPEsExpectation) {
   892  	var args []interface{}
   893  	if e.Args.NvrAnything {
   894  		args = append(args, mock.Anything)
   895  	} else {
   896  		args = append(args, e.Args.Nvr)
   897  	}
   898  	_m.On("RedHatNVRToCPEs", args...).Return(e.Returns.CpeIndices, e.Returns.Err)
   899  }
   900  
   901  func (_m *MockOperation) ApplyRedHatNVRToCPEsExpectations(expectations []OperationRedHatNVRToCPEsExpectation) {
   902  	for _, e := range expectations {
   903  		_m.ApplyRedHatNVRToCPEsExpectation(e)
   904  	}
   905  }
   906  
   907  // RedHatNVRToCPEs provides a mock function with given fields: nvr
   908  func (_m *MockOperation) RedHatNVRToCPEs(nvr string) ([]int, error) {
   909  	ret := _m.Called(nvr)
   910  
   911  	var r0 []int
   912  	if rf, ok := ret.Get(0).(func(string) []int); ok {
   913  		r0 = rf(nvr)
   914  	} else {
   915  		if ret.Get(0) != nil {
   916  			r0 = ret.Get(0).([]int)
   917  		}
   918  	}
   919  
   920  	var r1 error
   921  	if rf, ok := ret.Get(1).(func(string) error); ok {
   922  		r1 = rf(nvr)
   923  	} else {
   924  		r1 = ret.Error(1)
   925  	}
   926  
   927  	return r0, r1
   928  }
   929  
   930  type OperationRedHatRepoToCPEsArgs struct {
   931  	Repository         string
   932  	RepositoryAnything bool
   933  }
   934  
   935  type OperationRedHatRepoToCPEsReturns struct {
   936  	CpeIndices []int
   937  	Err        error
   938  }
   939  
   940  type OperationRedHatRepoToCPEsExpectation struct {
   941  	Args    OperationRedHatRepoToCPEsArgs
   942  	Returns OperationRedHatRepoToCPEsReturns
   943  }
   944  
   945  func (_m *MockOperation) ApplyRedHatRepoToCPEsExpectation(e OperationRedHatRepoToCPEsExpectation) {
   946  	var args []interface{}
   947  	if e.Args.RepositoryAnything {
   948  		args = append(args, mock.Anything)
   949  	} else {
   950  		args = append(args, e.Args.Repository)
   951  	}
   952  	_m.On("RedHatRepoToCPEs", args...).Return(e.Returns.CpeIndices, e.Returns.Err)
   953  }
   954  
   955  func (_m *MockOperation) ApplyRedHatRepoToCPEsExpectations(expectations []OperationRedHatRepoToCPEsExpectation) {
   956  	for _, e := range expectations {
   957  		_m.ApplyRedHatRepoToCPEsExpectation(e)
   958  	}
   959  }
   960  
   961  // RedHatRepoToCPEs provides a mock function with given fields: repository
   962  func (_m *MockOperation) RedHatRepoToCPEs(repository string) ([]int, error) {
   963  	ret := _m.Called(repository)
   964  
   965  	var r0 []int
   966  	if rf, ok := ret.Get(0).(func(string) []int); ok {
   967  		r0 = rf(repository)
   968  	} else {
   969  		if ret.Get(0) != nil {
   970  			r0 = ret.Get(0).([]int)
   971  		}
   972  	}
   973  
   974  	var r1 error
   975  	if rf, ok := ret.Get(1).(func(string) error); ok {
   976  		r1 = rf(repository)
   977  	} else {
   978  		r1 = ret.Error(1)
   979  	}
   980  
   981  	return r0, r1
   982  }
   983  
   984  type OperationSaveAdvisoryDetailsArgs struct {
   985  	Tx            *bbolt.Tx
   986  	TxAnything    bool
   987  	CveID         string
   988  	CveIDAnything bool
   989  }
   990  
   991  type OperationSaveAdvisoryDetailsReturns struct {
   992  	Err error
   993  }
   994  
   995  type OperationSaveAdvisoryDetailsExpectation struct {
   996  	Args    OperationSaveAdvisoryDetailsArgs
   997  	Returns OperationSaveAdvisoryDetailsReturns
   998  }
   999  
  1000  func (_m *MockOperation) ApplySaveAdvisoryDetailsExpectation(e OperationSaveAdvisoryDetailsExpectation) {
  1001  	var args []interface{}
  1002  	if e.Args.TxAnything {
  1003  		args = append(args, mock.Anything)
  1004  	} else {
  1005  		args = append(args, e.Args.Tx)
  1006  	}
  1007  	if e.Args.CveIDAnything {
  1008  		args = append(args, mock.Anything)
  1009  	} else {
  1010  		args = append(args, e.Args.CveID)
  1011  	}
  1012  	_m.On("SaveAdvisoryDetails", args...).Return(e.Returns.Err)
  1013  }
  1014  
  1015  func (_m *MockOperation) ApplySaveAdvisoryDetailsExpectations(expectations []OperationSaveAdvisoryDetailsExpectation) {
  1016  	for _, e := range expectations {
  1017  		_m.ApplySaveAdvisoryDetailsExpectation(e)
  1018  	}
  1019  }
  1020  
  1021  // SaveAdvisoryDetails provides a mock function with given fields: tx, cveID
  1022  func (_m *MockOperation) SaveAdvisoryDetails(tx *bbolt.Tx, cveID string) error {
  1023  	ret := _m.Called(tx, cveID)
  1024  
  1025  	var r0 error
  1026  	if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) error); ok {
  1027  		r0 = rf(tx, cveID)
  1028  	} else {
  1029  		r0 = ret.Error(0)
  1030  	}
  1031  
  1032  	return r0
  1033  }