// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package artifactcache

import (
	"io"
	"net/http"
	"time"

	mock "github.com/stretchr/testify/mock"
	"github.com/timshannon/bolthold"
)

// newMockcaches creates a new instance of mockcaches. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func newMockcaches(t interface {
	mock.TestingT
	Cleanup(func())
},
) *mockcaches {
	mock := &mockcaches{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}

// mockcaches is an autogenerated mock type for the caches type
type mockcaches struct {
	mock.Mock
}

type mockcaches_Expecter struct {
	mock *mock.Mock
}

func (_m *mockcaches) EXPECT() *mockcaches_Expecter {
	return &mockcaches_Expecter{mock: &_m.Mock}
}

// close provides a mock function for the type mockcaches
func (_mock *mockcaches) close() {
	_mock.Called()
	return
}

// mockcaches_close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'close'
type mockcaches_close_Call struct {
	*mock.Call
}

// close is a helper method to define mock.On call
func (_e *mockcaches_Expecter) close() *mockcaches_close_Call {
	return &mockcaches_close_Call{Call: _e.mock.On("close")}
}

func (_c *mockcaches_close_Call) Run(run func()) *mockcaches_close_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *mockcaches_close_Call) Return() *mockcaches_close_Call {
	_c.Call.Return()
	return _c
}

func (_c *mockcaches_close_Call) RunAndReturn(run func()) *mockcaches_close_Call {
	_c.Run(run)
	return _c
}

// commit provides a mock function for the type mockcaches
func (_mock *mockcaches) commit(id uint64, size int64) (int64, error) {
	ret := _mock.Called(id, size)

	if len(ret) == 0 {
		panic("no return value specified for commit")
	}

	var r0 int64
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(uint64, int64) (int64, error)); ok {
		return returnFunc(id, size)
	}
	if returnFunc, ok := ret.Get(0).(func(uint64, int64) int64); ok {
		r0 = returnFunc(id, size)
	} else {
		r0 = ret.Get(0).(int64)
	}
	if returnFunc, ok := ret.Get(1).(func(uint64, int64) error); ok {
		r1 = returnFunc(id, size)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// mockcaches_commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'commit'
type mockcaches_commit_Call struct {
	*mock.Call
}

// commit is a helper method to define mock.On call
//   - id uint64
//   - size int64
func (_e *mockcaches_Expecter) commit(id any, size any) *mockcaches_commit_Call {
	return &mockcaches_commit_Call{Call: _e.mock.On("commit", id, size)}
}

func (_c *mockcaches_commit_Call) Run(run func(id uint64, size int64)) *mockcaches_commit_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 uint64
		if args[0] != nil {
			arg0 = args[0].(uint64)
		}
		var arg1 int64
		if args[1] != nil {
			arg1 = args[1].(int64)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *mockcaches_commit_Call) Return(n int64, err error) *mockcaches_commit_Call {
	_c.Call.Return(n, err)
	return _c
}

func (_c *mockcaches_commit_Call) RunAndReturn(run func(id uint64, size int64) (int64, error)) *mockcaches_commit_Call {
	_c.Call.Return(run)
	return _c
}

// exist provides a mock function for the type mockcaches
func (_mock *mockcaches) exist(id uint64) (bool, error) {
	ret := _mock.Called(id)

	if len(ret) == 0 {
		panic("no return value specified for exist")
	}

	var r0 bool
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(uint64) (bool, error)); ok {
		return returnFunc(id)
	}
	if returnFunc, ok := ret.Get(0).(func(uint64) bool); ok {
		r0 = returnFunc(id)
	} else {
		r0 = ret.Get(0).(bool)
	}
	if returnFunc, ok := ret.Get(1).(func(uint64) error); ok {
		r1 = returnFunc(id)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// mockcaches_exist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'exist'
type mockcaches_exist_Call struct {
	*mock.Call
}

// exist is a helper method to define mock.On call
//   - id uint64
func (_e *mockcaches_Expecter) exist(id any) *mockcaches_exist_Call {
	return &mockcaches_exist_Call{Call: _e.mock.On("exist", id)}
}

func (_c *mockcaches_exist_Call) Run(run func(id uint64)) *mockcaches_exist_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 uint64
		if args[0] != nil {
			arg0 = args[0].(uint64)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockcaches_exist_Call) Return(b bool, err error) *mockcaches_exist_Call {
	_c.Call.Return(b, err)
	return _c
}

func (_c *mockcaches_exist_Call) RunAndReturn(run func(id uint64) (bool, error)) *mockcaches_exist_Call {
	_c.Call.Return(run)
	return _c
}

// gcCache provides a mock function for the type mockcaches
func (_mock *mockcaches) gcCache() {
	_mock.Called()
	return
}

// mockcaches_gcCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'gcCache'
type mockcaches_gcCache_Call struct {
	*mock.Call
}

// gcCache is a helper method to define mock.On call
func (_e *mockcaches_Expecter) gcCache() *mockcaches_gcCache_Call {
	return &mockcaches_gcCache_Call{Call: _e.mock.On("gcCache")}
}

func (_c *mockcaches_gcCache_Call) Run(run func()) *mockcaches_gcCache_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *mockcaches_gcCache_Call) Return() *mockcaches_gcCache_Call {
	_c.Call.Return()
	return _c
}

func (_c *mockcaches_gcCache_Call) RunAndReturn(run func()) *mockcaches_gcCache_Call {
	_c.Run(run)
	return _c
}

// getDB provides a mock function for the type mockcaches
func (_mock *mockcaches) getDB() *bolthold.Store {
	ret := _mock.Called()

	if len(ret) == 0 {
		panic("no return value specified for getDB")
	}

	var r0 *bolthold.Store
	if returnFunc, ok := ret.Get(0).(func() *bolthold.Store); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*bolthold.Store)
		}
	}
	return r0
}

// mockcaches_getDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'getDB'
type mockcaches_getDB_Call struct {
	*mock.Call
}

// getDB is a helper method to define mock.On call
func (_e *mockcaches_Expecter) getDB() *mockcaches_getDB_Call {
	return &mockcaches_getDB_Call{Call: _e.mock.On("getDB")}
}

func (_c *mockcaches_getDB_Call) Run(run func()) *mockcaches_getDB_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *mockcaches_getDB_Call) Return(store *bolthold.Store) *mockcaches_getDB_Call {
	_c.Call.Return(store)
	return _c
}

func (_c *mockcaches_getDB_Call) RunAndReturn(run func() *bolthold.Store) *mockcaches_getDB_Call {
	_c.Call.Return(run)
	return _c
}

// readCache provides a mock function for the type mockcaches
func (_mock *mockcaches) readCache(id uint64, repo string) (*Cache, error) {
	ret := _mock.Called(id, repo)

	if len(ret) == 0 {
		panic("no return value specified for readCache")
	}

	var r0 *Cache
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(uint64, string) (*Cache, error)); ok {
		return returnFunc(id, repo)
	}
	if returnFunc, ok := ret.Get(0).(func(uint64, string) *Cache); ok {
		r0 = returnFunc(id, repo)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*Cache)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(uint64, string) error); ok {
		r1 = returnFunc(id, repo)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// mockcaches_readCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'readCache'
type mockcaches_readCache_Call struct {
	*mock.Call
}

// readCache is a helper method to define mock.On call
//   - id uint64
//   - repo string
func (_e *mockcaches_Expecter) readCache(id any, repo any) *mockcaches_readCache_Call {
	return &mockcaches_readCache_Call{Call: _e.mock.On("readCache", id, repo)}
}

func (_c *mockcaches_readCache_Call) Run(run func(id uint64, repo string)) *mockcaches_readCache_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 uint64
		if args[0] != nil {
			arg0 = args[0].(uint64)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *mockcaches_readCache_Call) Return(cache *Cache, err error) *mockcaches_readCache_Call {
	_c.Call.Return(cache, err)
	return _c
}

func (_c *mockcaches_readCache_Call) RunAndReturn(run func(id uint64, repo string) (*Cache, error)) *mockcaches_readCache_Call {
	_c.Call.Return(run)
	return _c
}

// serve provides a mock function for the type mockcaches
func (_mock *mockcaches) serve(w http.ResponseWriter, r *http.Request, id uint64) {
	_mock.Called(w, r, id)
	return
}

// mockcaches_serve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'serve'
type mockcaches_serve_Call struct {
	*mock.Call
}

// serve is a helper method to define mock.On call
//   - w http.ResponseWriter
//   - r *http.Request
//   - id uint64
func (_e *mockcaches_Expecter) serve(w any, r any, id any) *mockcaches_serve_Call {
	return &mockcaches_serve_Call{Call: _e.mock.On("serve", w, r, id)}
}

func (_c *mockcaches_serve_Call) Run(run func(w http.ResponseWriter, r *http.Request, id uint64)) *mockcaches_serve_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 http.ResponseWriter
		if args[0] != nil {
			arg0 = args[0].(http.ResponseWriter)
		}
		var arg1 *http.Request
		if args[1] != nil {
			arg1 = args[1].(*http.Request)
		}
		var arg2 uint64
		if args[2] != nil {
			arg2 = args[2].(uint64)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *mockcaches_serve_Call) Return() *mockcaches_serve_Call {
	_c.Call.Return()
	return _c
}

func (_c *mockcaches_serve_Call) RunAndReturn(run func(w http.ResponseWriter, r *http.Request, id uint64)) *mockcaches_serve_Call {
	_c.Run(run)
	return _c
}

// setgcAt provides a mock function for the type mockcaches
func (_mock *mockcaches) setgcAt(at time.Time) {
	_mock.Called(at)
	return
}

// mockcaches_setgcAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'setgcAt'
type mockcaches_setgcAt_Call struct {
	*mock.Call
}

// setgcAt is a helper method to define mock.On call
//   - at time.Time
func (_e *mockcaches_Expecter) setgcAt(at any) *mockcaches_setgcAt_Call {
	return &mockcaches_setgcAt_Call{Call: _e.mock.On("setgcAt", at)}
}

func (_c *mockcaches_setgcAt_Call) Run(run func(at time.Time)) *mockcaches_setgcAt_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 time.Time
		if args[0] != nil {
			arg0 = args[0].(time.Time)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockcaches_setgcAt_Call) Return() *mockcaches_setgcAt_Call {
	_c.Call.Return()
	return _c
}

func (_c *mockcaches_setgcAt_Call) RunAndReturn(run func(at time.Time)) *mockcaches_setgcAt_Call {
	_c.Run(run)
	return _c
}

// useCache provides a mock function for the type mockcaches
func (_mock *mockcaches) useCache(id uint64) error {
	ret := _mock.Called(id)

	if len(ret) == 0 {
		panic("no return value specified for useCache")
	}

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(uint64) error); ok {
		r0 = returnFunc(id)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// mockcaches_useCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'useCache'
type mockcaches_useCache_Call struct {
	*mock.Call
}

// useCache is a helper method to define mock.On call
//   - id uint64
func (_e *mockcaches_Expecter) useCache(id any) *mockcaches_useCache_Call {
	return &mockcaches_useCache_Call{Call: _e.mock.On("useCache", id)}
}

func (_c *mockcaches_useCache_Call) Run(run func(id uint64)) *mockcaches_useCache_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 uint64
		if args[0] != nil {
			arg0 = args[0].(uint64)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockcaches_useCache_Call) Return(err error) *mockcaches_useCache_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *mockcaches_useCache_Call) RunAndReturn(run func(id uint64) error) *mockcaches_useCache_Call {
	_c.Call.Return(run)
	return _c
}

// validateMac provides a mock function for the type mockcaches
func (_mock *mockcaches) validateMac(rundata RunData) (string, error) {
	ret := _mock.Called(rundata)

	if len(ret) == 0 {
		panic("no return value specified for validateMac")
	}

	var r0 string
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(RunData) (string, error)); ok {
		return returnFunc(rundata)
	}
	if returnFunc, ok := ret.Get(0).(func(RunData) string); ok {
		r0 = returnFunc(rundata)
	} else {
		r0 = ret.Get(0).(string)
	}
	if returnFunc, ok := ret.Get(1).(func(RunData) error); ok {
		r1 = returnFunc(rundata)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// mockcaches_validateMac_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'validateMac'
type mockcaches_validateMac_Call struct {
	*mock.Call
}

// validateMac is a helper method to define mock.On call
//   - rundata RunData
func (_e *mockcaches_Expecter) validateMac(rundata any) *mockcaches_validateMac_Call {
	return &mockcaches_validateMac_Call{Call: _e.mock.On("validateMac", rundata)}
}

func (_c *mockcaches_validateMac_Call) Run(run func(rundata RunData)) *mockcaches_validateMac_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 RunData
		if args[0] != nil {
			arg0 = args[0].(RunData)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockcaches_validateMac_Call) Return(s string, err error) *mockcaches_validateMac_Call {
	_c.Call.Return(s, err)
	return _c
}

func (_c *mockcaches_validateMac_Call) RunAndReturn(run func(rundata RunData) (string, error)) *mockcaches_validateMac_Call {
	_c.Call.Return(run)
	return _c
}

// write provides a mock function for the type mockcaches
func (_mock *mockcaches) write(id uint64, offset uint64, reader io.Reader) error {
	ret := _mock.Called(id, offset, reader)

	if len(ret) == 0 {
		panic("no return value specified for write")
	}

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(uint64, uint64, io.Reader) error); ok {
		r0 = returnFunc(id, offset, reader)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// mockcaches_write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'write'
type mockcaches_write_Call struct {
	*mock.Call
}

// write is a helper method to define mock.On call
//   - id uint64
//   - offset uint64
//   - reader io.Reader
func (_e *mockcaches_Expecter) write(id any, offset any, reader any) *mockcaches_write_Call {
	return &mockcaches_write_Call{Call: _e.mock.On("write", id, offset, reader)}
}

func (_c *mockcaches_write_Call) Run(run func(id uint64, offset uint64, reader io.Reader)) *mockcaches_write_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 uint64
		if args[0] != nil {
			arg0 = args[0].(uint64)
		}
		var arg1 uint64
		if args[1] != nil {
			arg1 = args[1].(uint64)
		}
		var arg2 io.Reader
		if args[2] != nil {
			arg2 = args[2].(io.Reader)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *mockcaches_write_Call) Return(err error) *mockcaches_write_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *mockcaches_write_Call) RunAndReturn(run func(id uint64, offset uint64, reader io.Reader) error) *mockcaches_write_Call {
	_c.Call.Return(run)
	return _c
}
