// Code generated by mockery v1.0.0. DO NOT EDIT.

package db

import (
	"github.com/aquasecurity/trivy-db/pkg/db"
	mock "github.com/stretchr/testify/mock"
)

// mockDbOperation is an autogenerated mock type for the dbOperation type
type mockDbOperation struct {
	mock.Mock
}

type dbOperationGetMetadataReturns struct {
	Metadata db.Metadata
	Err      error
}

type dbOperationGetMetadataExpectation struct {
	Returns dbOperationGetMetadataReturns
}

func (_m *mockDbOperation) ApplyGetMetadataExpectation(e dbOperationGetMetadataExpectation) {
	var args []interface{}
	_m.On("GetMetadata", args...).Return(e.Returns.Metadata, e.Returns.Err)
}

func (_m *mockDbOperation) ApplyGetMetadataExpectations(expectations []dbOperationGetMetadataExpectation) {
	for _, e := range expectations {
		_m.ApplyGetMetadataExpectation(e)
	}
}

// GetMetadata provides a mock function with given fields:
func (_m *mockDbOperation) GetMetadata() (db.Metadata, error) {
	ret := _m.Called()

	var r0 db.Metadata
	if rf, ok := ret.Get(0).(func() db.Metadata); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(db.Metadata)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

type dbOperationStoreMetadataReturns struct {
	Err error
}

type dbOperationStoreMetadataExpectation struct {
	Metadata db.Metadata
	Dir      string
	Returns  dbOperationStoreMetadataReturns
}

func (_m *mockDbOperation) ApplyStoreMetadataExpectation(e dbOperationStoreMetadataExpectation) {
	_m.On("StoreMetadata", e.Metadata, mock.Anything).Return(e.Returns.Err)
}

func (_m *mockDbOperation) ApplyStoreMetadataExpectations(expectations []dbOperationStoreMetadataExpectation) {
	for _, e := range expectations {
		_m.ApplyStoreMetadataExpectation(e)
	}
}

// StoreMetadata provides a mock function with given fields: metadata, dir
func (_m *mockDbOperation) StoreMetadata(metadata db.Metadata, dir string) error {
	ret := _m.Called(metadata, dir)

	var r0 error
	if rf, ok := ret.Get(0).(func(db.Metadata, string) error); ok {
		r0 = rf(metadata, dir)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
