Files
argo-cd/commitserver/commit/mocks/RepoClientFactory.go
Blake Pettersson 2ae9f43410 chore: upgrade mockery (#23387)
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2025-06-13 19:58:11 +00:00

107 lines
3.1 KiB
Go
Generated

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v3/util/git"
mock "github.com/stretchr/testify/mock"
)
// NewRepoClientFactory creates a new instance of RepoClientFactory. 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 NewRepoClientFactory(t interface {
mock.TestingT
Cleanup(func())
}) *RepoClientFactory {
mock := &RepoClientFactory{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// RepoClientFactory is an autogenerated mock type for the RepoClientFactory type
type RepoClientFactory struct {
mock.Mock
}
type RepoClientFactory_Expecter struct {
mock *mock.Mock
}
func (_m *RepoClientFactory) EXPECT() *RepoClientFactory_Expecter {
return &RepoClientFactory_Expecter{mock: &_m.Mock}
}
// NewClient provides a mock function for the type RepoClientFactory
func (_mock *RepoClientFactory) NewClient(repo *v1alpha1.Repository, rootPath string) (git.Client, error) {
ret := _mock.Called(repo, rootPath)
if len(ret) == 0 {
panic("no return value specified for NewClient")
}
var r0 git.Client
var r1 error
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Repository, string) (git.Client, error)); ok {
return returnFunc(repo, rootPath)
}
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Repository, string) git.Client); ok {
r0 = returnFunc(repo, rootPath)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(git.Client)
}
}
if returnFunc, ok := ret.Get(1).(func(*v1alpha1.Repository, string) error); ok {
r1 = returnFunc(repo, rootPath)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RepoClientFactory_NewClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewClient'
type RepoClientFactory_NewClient_Call struct {
*mock.Call
}
// NewClient is a helper method to define mock.On call
// - repo *v1alpha1.Repository
// - rootPath string
func (_e *RepoClientFactory_Expecter) NewClient(repo interface{}, rootPath interface{}) *RepoClientFactory_NewClient_Call {
return &RepoClientFactory_NewClient_Call{Call: _e.mock.On("NewClient", repo, rootPath)}
}
func (_c *RepoClientFactory_NewClient_Call) Run(run func(repo *v1alpha1.Repository, rootPath string)) *RepoClientFactory_NewClient_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 *v1alpha1.Repository
if args[0] != nil {
arg0 = args[0].(*v1alpha1.Repository)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *RepoClientFactory_NewClient_Call) Return(client git.Client, err error) *RepoClientFactory_NewClient_Call {
_c.Call.Return(client, err)
return _c
}
func (_c *RepoClientFactory_NewClient_Call) RunAndReturn(run func(repo *v1alpha1.Repository, rootPath string) (git.Client, error)) *RepoClientFactory_NewClient_Call {
_c.Call.Return(run)
return _c
}