// Code generated by mockery v2.53.3. DO NOT EDIT.

package cache

import (
	mock "github.com/stretchr/testify/mock"
	common "gitlab.com/gitlab-org/gitlab-runner/common"
)

// MockCredentialsFactory is an autogenerated mock type for the CredentialsFactory type
type MockCredentialsFactory struct {
	mock.Mock
}

type MockCredentialsFactory_Expecter struct {
	mock *mock.Mock
}

func (_m *MockCredentialsFactory) EXPECT() *MockCredentialsFactory_Expecter {
	return &MockCredentialsFactory_Expecter{mock: &_m.Mock}
}

// Execute provides a mock function with given fields: config
func (_m *MockCredentialsFactory) Execute(config *common.CacheConfig) (CredentialsAdapter, error) {
	ret := _m.Called(config)

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

	var r0 CredentialsAdapter
	var r1 error
	if rf, ok := ret.Get(0).(func(*common.CacheConfig) (CredentialsAdapter, error)); ok {
		return rf(config)
	}
	if rf, ok := ret.Get(0).(func(*common.CacheConfig) CredentialsAdapter); ok {
		r0 = rf(config)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(CredentialsAdapter)
		}
	}

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

	return r0, r1
}

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

// Execute is a helper method to define mock.On call
//   - config *common.CacheConfig
func (_e *MockCredentialsFactory_Expecter) Execute(config interface{}) *MockCredentialsFactory_Execute_Call {
	return &MockCredentialsFactory_Execute_Call{Call: _e.mock.On("Execute", config)}
}

func (_c *MockCredentialsFactory_Execute_Call) Run(run func(config *common.CacheConfig)) *MockCredentialsFactory_Execute_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(*common.CacheConfig))
	})
	return _c
}

func (_c *MockCredentialsFactory_Execute_Call) Return(_a0 CredentialsAdapter, _a1 error) *MockCredentialsFactory_Execute_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *MockCredentialsFactory_Execute_Call) RunAndReturn(run func(*common.CacheConfig) (CredentialsAdapter, error)) *MockCredentialsFactory_Execute_Call {
	_c.Call.Return(run)
	return _c
}

// NewMockCredentialsFactory creates a new instance of MockCredentialsFactory. 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 NewMockCredentialsFactory(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCredentialsFactory {
	mock := &MockCredentialsFactory{}
	mock.Mock.Test(t)

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

	return mock
}
