Files
woodpecker/server/forge/mocks/mock_Forge.go

1427 lines
40 KiB
Go

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"net/http"
mock "github.com/stretchr/testify/mock"
"go.woodpecker-ci.org/woodpecker/v3/server/forge/types"
"go.woodpecker-ci.org/woodpecker/v3/server/model"
)
// NewMockForge creates a new instance of MockForge. 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 NewMockForge(t interface {
mock.TestingT
Cleanup(func())
}) *MockForge {
mock := &MockForge{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockForge is an autogenerated mock type for the Forge type
type MockForge struct {
mock.Mock
}
type MockForge_Expecter struct {
mock *mock.Mock
}
func (_m *MockForge) EXPECT() *MockForge_Expecter {
return &MockForge_Expecter{mock: &_m.Mock}
}
// Activate provides a mock function for the type MockForge
func (_mock *MockForge) Activate(ctx context.Context, u *model.User, r *model.Repo, link string) error {
ret := _mock.Called(ctx, u, r, link)
if len(ret) == 0 {
panic("no return value specified for Activate")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok {
r0 = returnFunc(ctx, u, r, link)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockForge_Activate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Activate'
type MockForge_Activate_Call struct {
*mock.Call
}
// Activate is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - link string
func (_e *MockForge_Expecter) Activate(ctx interface{}, u interface{}, r interface{}, link interface{}) *MockForge_Activate_Call {
return &MockForge_Activate_Call{Call: _e.mock.On("Activate", ctx, u, r, link)}
}
func (_c *MockForge_Activate_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, link string)) *MockForge_Activate_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 string
if args[3] != nil {
arg3 = args[3].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockForge_Activate_Call) Return(err error) *MockForge_Activate_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockForge_Activate_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, link string) error) *MockForge_Activate_Call {
_c.Call.Return(run)
return _c
}
// Auth provides a mock function for the type MockForge
func (_mock *MockForge) Auth(ctx context.Context, token string, secret string) (string, error) {
ret := _mock.Called(ctx, token, secret)
if len(ret) == 0 {
panic("no return value specified for Auth")
}
var r0 string
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok {
return returnFunc(ctx, token, secret)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) string); ok {
r0 = returnFunc(ctx, token, secret)
} else {
r0 = ret.Get(0).(string)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = returnFunc(ctx, token, secret)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Auth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Auth'
type MockForge_Auth_Call struct {
*mock.Call
}
// Auth is a helper method to define mock.On call
// - ctx context.Context
// - token string
// - secret string
func (_e *MockForge_Expecter) Auth(ctx interface{}, token interface{}, secret interface{}) *MockForge_Auth_Call {
return &MockForge_Auth_Call{Call: _e.mock.On("Auth", ctx, token, secret)}
}
func (_c *MockForge_Auth_Call) Run(run func(ctx context.Context, token string, secret string)) *MockForge_Auth_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockForge_Auth_Call) Return(s string, err error) *MockForge_Auth_Call {
_c.Call.Return(s, err)
return _c
}
func (_c *MockForge_Auth_Call) RunAndReturn(run func(ctx context.Context, token string, secret string) (string, error)) *MockForge_Auth_Call {
_c.Call.Return(run)
return _c
}
// BranchHead provides a mock function for the type MockForge
func (_mock *MockForge) BranchHead(ctx context.Context, u *model.User, r *model.Repo, branch string) (*model.Commit, error) {
ret := _mock.Called(ctx, u, r, branch)
if len(ret) == 0 {
panic("no return value specified for BranchHead")
}
var r0 *model.Commit
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) (*model.Commit, error)); ok {
return returnFunc(ctx, u, r, branch)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) *model.Commit); ok {
r0 = returnFunc(ctx, u, r, branch)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Commit)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, string) error); ok {
r1 = returnFunc(ctx, u, r, branch)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_BranchHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BranchHead'
type MockForge_BranchHead_Call struct {
*mock.Call
}
// BranchHead is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - branch string
func (_e *MockForge_Expecter) BranchHead(ctx interface{}, u interface{}, r interface{}, branch interface{}) *MockForge_BranchHead_Call {
return &MockForge_BranchHead_Call{Call: _e.mock.On("BranchHead", ctx, u, r, branch)}
}
func (_c *MockForge_BranchHead_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, branch string)) *MockForge_BranchHead_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 string
if args[3] != nil {
arg3 = args[3].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockForge_BranchHead_Call) Return(commit *model.Commit, err error) *MockForge_BranchHead_Call {
_c.Call.Return(commit, err)
return _c
}
func (_c *MockForge_BranchHead_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, branch string) (*model.Commit, error)) *MockForge_BranchHead_Call {
_c.Call.Return(run)
return _c
}
// Branches provides a mock function for the type MockForge
func (_mock *MockForge) Branches(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]string, error) {
ret := _mock.Called(ctx, u, r, p)
if len(ret) == 0 {
panic("no return value specified for Branches")
}
var r0 []string
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]string, error)); ok {
return returnFunc(ctx, u, r, p)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) []string); ok {
r0 = returnFunc(ctx, u, r, p)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) error); ok {
r1 = returnFunc(ctx, u, r, p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Branches_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Branches'
type MockForge_Branches_Call struct {
*mock.Call
}
// Branches is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - p *model.ListOptions
func (_e *MockForge_Expecter) Branches(ctx interface{}, u interface{}, r interface{}, p interface{}) *MockForge_Branches_Call {
return &MockForge_Branches_Call{Call: _e.mock.On("Branches", ctx, u, r, p)}
}
func (_c *MockForge_Branches_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions)) *MockForge_Branches_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 *model.ListOptions
if args[3] != nil {
arg3 = args[3].(*model.ListOptions)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockForge_Branches_Call) Return(strings []string, err error) *MockForge_Branches_Call {
_c.Call.Return(strings, err)
return _c
}
func (_c *MockForge_Branches_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]string, error)) *MockForge_Branches_Call {
_c.Call.Return(run)
return _c
}
// Deactivate provides a mock function for the type MockForge
func (_mock *MockForge) Deactivate(ctx context.Context, u *model.User, r *model.Repo, link string) error {
ret := _mock.Called(ctx, u, r, link)
if len(ret) == 0 {
panic("no return value specified for Deactivate")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok {
r0 = returnFunc(ctx, u, r, link)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockForge_Deactivate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deactivate'
type MockForge_Deactivate_Call struct {
*mock.Call
}
// Deactivate is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - link string
func (_e *MockForge_Expecter) Deactivate(ctx interface{}, u interface{}, r interface{}, link interface{}) *MockForge_Deactivate_Call {
return &MockForge_Deactivate_Call{Call: _e.mock.On("Deactivate", ctx, u, r, link)}
}
func (_c *MockForge_Deactivate_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, link string)) *MockForge_Deactivate_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 string
if args[3] != nil {
arg3 = args[3].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockForge_Deactivate_Call) Return(err error) *MockForge_Deactivate_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockForge_Deactivate_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, link string) error) *MockForge_Deactivate_Call {
_c.Call.Return(run)
return _c
}
// Dir provides a mock function for the type MockForge
func (_mock *MockForge) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, dirName string) ([]*types.FileMeta, error) {
ret := _mock.Called(ctx, u, r, b, dirName)
if len(ret) == 0 {
panic("no return value specified for Dir")
}
var r0 []*types.FileMeta
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]*types.FileMeta, error)); ok {
return returnFunc(ctx, u, r, b, dirName)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) []*types.FileMeta); ok {
r0 = returnFunc(ctx, u, r, b, dirName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.FileMeta)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) error); ok {
r1 = returnFunc(ctx, u, r, b, dirName)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Dir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dir'
type MockForge_Dir_Call struct {
*mock.Call
}
// Dir is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - b *model.Pipeline
// - dirName string
func (_e *MockForge_Expecter) Dir(ctx interface{}, u interface{}, r interface{}, b interface{}, dirName interface{}) *MockForge_Dir_Call {
return &MockForge_Dir_Call{Call: _e.mock.On("Dir", ctx, u, r, b, dirName)}
}
func (_c *MockForge_Dir_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, dirName string)) *MockForge_Dir_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 *model.Pipeline
if args[3] != nil {
arg3 = args[3].(*model.Pipeline)
}
var arg4 string
if args[4] != nil {
arg4 = args[4].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *MockForge_Dir_Call) Return(fileMetas []*types.FileMeta, err error) *MockForge_Dir_Call {
_c.Call.Return(fileMetas, err)
return _c
}
func (_c *MockForge_Dir_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, dirName string) ([]*types.FileMeta, error)) *MockForge_Dir_Call {
_c.Call.Return(run)
return _c
}
// File provides a mock function for the type MockForge
func (_mock *MockForge) File(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, fileName string) ([]byte, error) {
ret := _mock.Called(ctx, u, r, b, fileName)
if len(ret) == 0 {
panic("no return value specified for File")
}
var r0 []byte
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]byte, error)); ok {
return returnFunc(ctx, u, r, b, fileName)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) []byte); ok {
r0 = returnFunc(ctx, u, r, b, fileName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) error); ok {
r1 = returnFunc(ctx, u, r, b, fileName)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_File_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'File'
type MockForge_File_Call struct {
*mock.Call
}
// File is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - b *model.Pipeline
// - fileName string
func (_e *MockForge_Expecter) File(ctx interface{}, u interface{}, r interface{}, b interface{}, fileName interface{}) *MockForge_File_Call {
return &MockForge_File_Call{Call: _e.mock.On("File", ctx, u, r, b, fileName)}
}
func (_c *MockForge_File_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, fileName string)) *MockForge_File_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 *model.Pipeline
if args[3] != nil {
arg3 = args[3].(*model.Pipeline)
}
var arg4 string
if args[4] != nil {
arg4 = args[4].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *MockForge_File_Call) Return(bytes []byte, err error) *MockForge_File_Call {
_c.Call.Return(bytes, err)
return _c
}
func (_c *MockForge_File_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, fileName string) ([]byte, error)) *MockForge_File_Call {
_c.Call.Return(run)
return _c
}
// Hook provides a mock function for the type MockForge
func (_mock *MockForge) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model.Pipeline, error) {
ret := _mock.Called(ctx, r)
if len(ret) == 0 {
panic("no return value specified for Hook")
}
var r0 *model.Repo
var r1 *model.Pipeline
var r2 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *http.Request) (*model.Repo, *model.Pipeline, error)); ok {
return returnFunc(ctx, r)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *http.Request) *model.Repo); ok {
r0 = returnFunc(ctx, r)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Repo)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *http.Request) *model.Pipeline); ok {
r1 = returnFunc(ctx, r)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.Pipeline)
}
}
if returnFunc, ok := ret.Get(2).(func(context.Context, *http.Request) error); ok {
r2 = returnFunc(ctx, r)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// MockForge_Hook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hook'
type MockForge_Hook_Call struct {
*mock.Call
}
// Hook is a helper method to define mock.On call
// - ctx context.Context
// - r *http.Request
func (_e *MockForge_Expecter) Hook(ctx interface{}, r interface{}) *MockForge_Hook_Call {
return &MockForge_Hook_Call{Call: _e.mock.On("Hook", ctx, r)}
}
func (_c *MockForge_Hook_Call) Run(run func(ctx context.Context, r *http.Request)) *MockForge_Hook_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *http.Request
if args[1] != nil {
arg1 = args[1].(*http.Request)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockForge_Hook_Call) Return(repo *model.Repo, pipeline *model.Pipeline, err error) *MockForge_Hook_Call {
_c.Call.Return(repo, pipeline, err)
return _c
}
func (_c *MockForge_Hook_Call) RunAndReturn(run func(ctx context.Context, r *http.Request) (*model.Repo, *model.Pipeline, error)) *MockForge_Hook_Call {
_c.Call.Return(run)
return _c
}
// Login provides a mock function for the type MockForge
func (_mock *MockForge) Login(ctx context.Context, r *types.OAuthRequest) (*model.User, string, error) {
ret := _mock.Called(ctx, r)
if len(ret) == 0 {
panic("no return value specified for Login")
}
var r0 *model.User
var r1 string
var r2 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *types.OAuthRequest) (*model.User, string, error)); ok {
return returnFunc(ctx, r)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *types.OAuthRequest) *model.User); ok {
r0 = returnFunc(ctx, r)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.User)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *types.OAuthRequest) string); ok {
r1 = returnFunc(ctx, r)
} else {
r1 = ret.Get(1).(string)
}
if returnFunc, ok := ret.Get(2).(func(context.Context, *types.OAuthRequest) error); ok {
r2 = returnFunc(ctx, r)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// MockForge_Login_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Login'
type MockForge_Login_Call struct {
*mock.Call
}
// Login is a helper method to define mock.On call
// - ctx context.Context
// - r *types.OAuthRequest
func (_e *MockForge_Expecter) Login(ctx interface{}, r interface{}) *MockForge_Login_Call {
return &MockForge_Login_Call{Call: _e.mock.On("Login", ctx, r)}
}
func (_c *MockForge_Login_Call) Run(run func(ctx context.Context, r *types.OAuthRequest)) *MockForge_Login_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *types.OAuthRequest
if args[1] != nil {
arg1 = args[1].(*types.OAuthRequest)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockForge_Login_Call) Return(user *model.User, s string, err error) *MockForge_Login_Call {
_c.Call.Return(user, s, err)
return _c
}
func (_c *MockForge_Login_Call) RunAndReturn(run func(ctx context.Context, r *types.OAuthRequest) (*model.User, string, error)) *MockForge_Login_Call {
_c.Call.Return(run)
return _c
}
// Name provides a mock function for the type MockForge
func (_mock *MockForge) Name() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Name")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockForge_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'
type MockForge_Name_Call struct {
*mock.Call
}
// Name is a helper method to define mock.On call
func (_e *MockForge_Expecter) Name() *MockForge_Name_Call {
return &MockForge_Name_Call{Call: _e.mock.On("Name")}
}
func (_c *MockForge_Name_Call) Run(run func()) *MockForge_Name_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockForge_Name_Call) Return(s string) *MockForge_Name_Call {
_c.Call.Return(s)
return _c
}
func (_c *MockForge_Name_Call) RunAndReturn(run func() string) *MockForge_Name_Call {
_c.Call.Return(run)
return _c
}
// Netrc provides a mock function for the type MockForge
func (_mock *MockForge) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) {
ret := _mock.Called(u, r)
if len(ret) == 0 {
panic("no return value specified for Netrc")
}
var r0 *model.Netrc
var r1 error
if returnFunc, ok := ret.Get(0).(func(*model.User, *model.Repo) (*model.Netrc, error)); ok {
return returnFunc(u, r)
}
if returnFunc, ok := ret.Get(0).(func(*model.User, *model.Repo) *model.Netrc); ok {
r0 = returnFunc(u, r)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Netrc)
}
}
if returnFunc, ok := ret.Get(1).(func(*model.User, *model.Repo) error); ok {
r1 = returnFunc(u, r)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Netrc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Netrc'
type MockForge_Netrc_Call struct {
*mock.Call
}
// Netrc is a helper method to define mock.On call
// - u *model.User
// - r *model.Repo
func (_e *MockForge_Expecter) Netrc(u interface{}, r interface{}) *MockForge_Netrc_Call {
return &MockForge_Netrc_Call{Call: _e.mock.On("Netrc", u, r)}
}
func (_c *MockForge_Netrc_Call) Run(run func(u *model.User, r *model.Repo)) *MockForge_Netrc_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 *model.User
if args[0] != nil {
arg0 = args[0].(*model.User)
}
var arg1 *model.Repo
if args[1] != nil {
arg1 = args[1].(*model.Repo)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockForge_Netrc_Call) Return(netrc *model.Netrc, err error) *MockForge_Netrc_Call {
_c.Call.Return(netrc, err)
return _c
}
func (_c *MockForge_Netrc_Call) RunAndReturn(run func(u *model.User, r *model.Repo) (*model.Netrc, error)) *MockForge_Netrc_Call {
_c.Call.Return(run)
return _c
}
// Org provides a mock function for the type MockForge
func (_mock *MockForge) Org(ctx context.Context, u *model.User, org string) (*model.Org, error) {
ret := _mock.Called(ctx, u, org)
if len(ret) == 0 {
panic("no return value specified for Org")
}
var r0 *model.Org
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.Org, error)); ok {
return returnFunc(ctx, u, org)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) *model.Org); ok {
r0 = returnFunc(ctx, u, org)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Org)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, string) error); ok {
r1 = returnFunc(ctx, u, org)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Org_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Org'
type MockForge_Org_Call struct {
*mock.Call
}
// Org is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - org string
func (_e *MockForge_Expecter) Org(ctx interface{}, u interface{}, org interface{}) *MockForge_Org_Call {
return &MockForge_Org_Call{Call: _e.mock.On("Org", ctx, u, org)}
}
func (_c *MockForge_Org_Call) Run(run func(ctx context.Context, u *model.User, org string)) *MockForge_Org_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockForge_Org_Call) Return(org1 *model.Org, err error) *MockForge_Org_Call {
_c.Call.Return(org1, err)
return _c
}
func (_c *MockForge_Org_Call) RunAndReturn(run func(ctx context.Context, u *model.User, org string) (*model.Org, error)) *MockForge_Org_Call {
_c.Call.Return(run)
return _c
}
// OrgMembership provides a mock function for the type MockForge
func (_mock *MockForge) OrgMembership(ctx context.Context, u *model.User, org string) (*model.OrgPerm, error) {
ret := _mock.Called(ctx, u, org)
if len(ret) == 0 {
panic("no return value specified for OrgMembership")
}
var r0 *model.OrgPerm
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.OrgPerm, error)); ok {
return returnFunc(ctx, u, org)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) *model.OrgPerm); ok {
r0 = returnFunc(ctx, u, org)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.OrgPerm)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, string) error); ok {
r1 = returnFunc(ctx, u, org)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_OrgMembership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgMembership'
type MockForge_OrgMembership_Call struct {
*mock.Call
}
// OrgMembership is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - org string
func (_e *MockForge_Expecter) OrgMembership(ctx interface{}, u interface{}, org interface{}) *MockForge_OrgMembership_Call {
return &MockForge_OrgMembership_Call{Call: _e.mock.On("OrgMembership", ctx, u, org)}
}
func (_c *MockForge_OrgMembership_Call) Run(run func(ctx context.Context, u *model.User, org string)) *MockForge_OrgMembership_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockForge_OrgMembership_Call) Return(orgPerm *model.OrgPerm, err error) *MockForge_OrgMembership_Call {
_c.Call.Return(orgPerm, err)
return _c
}
func (_c *MockForge_OrgMembership_Call) RunAndReturn(run func(ctx context.Context, u *model.User, org string) (*model.OrgPerm, error)) *MockForge_OrgMembership_Call {
_c.Call.Return(run)
return _c
}
// PullRequests provides a mock function for the type MockForge
func (_mock *MockForge) PullRequests(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]*model.PullRequest, error) {
ret := _mock.Called(ctx, u, r, p)
if len(ret) == 0 {
panic("no return value specified for PullRequests")
}
var r0 []*model.PullRequest
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]*model.PullRequest, error)); ok {
return returnFunc(ctx, u, r, p)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) []*model.PullRequest); ok {
r0 = returnFunc(ctx, u, r, p)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.PullRequest)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) error); ok {
r1 = returnFunc(ctx, u, r, p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_PullRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PullRequests'
type MockForge_PullRequests_Call struct {
*mock.Call
}
// PullRequests is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - p *model.ListOptions
func (_e *MockForge_Expecter) PullRequests(ctx interface{}, u interface{}, r interface{}, p interface{}) *MockForge_PullRequests_Call {
return &MockForge_PullRequests_Call{Call: _e.mock.On("PullRequests", ctx, u, r, p)}
}
func (_c *MockForge_PullRequests_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions)) *MockForge_PullRequests_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 *model.ListOptions
if args[3] != nil {
arg3 = args[3].(*model.ListOptions)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockForge_PullRequests_Call) Return(pullRequests []*model.PullRequest, err error) *MockForge_PullRequests_Call {
_c.Call.Return(pullRequests, err)
return _c
}
func (_c *MockForge_PullRequests_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]*model.PullRequest, error)) *MockForge_PullRequests_Call {
_c.Call.Return(run)
return _c
}
// Repo provides a mock function for the type MockForge
func (_mock *MockForge) Repo(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string) (*model.Repo, error) {
ret := _mock.Called(ctx, u, remoteID, owner, name)
if len(ret) == 0 {
panic("no return value specified for Repo")
}
var r0 *model.Repo
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) (*model.Repo, error)); ok {
return returnFunc(ctx, u, remoteID, owner, name)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) *model.Repo); ok {
r0 = returnFunc(ctx, u, remoteID, owner, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Repo)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) error); ok {
r1 = returnFunc(ctx, u, remoteID, owner, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Repo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repo'
type MockForge_Repo_Call struct {
*mock.Call
}
// Repo is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - remoteID model.ForgeRemoteID
// - owner string
// - name string
func (_e *MockForge_Expecter) Repo(ctx interface{}, u interface{}, remoteID interface{}, owner interface{}, name interface{}) *MockForge_Repo_Call {
return &MockForge_Repo_Call{Call: _e.mock.On("Repo", ctx, u, remoteID, owner, name)}
}
func (_c *MockForge_Repo_Call) Run(run func(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string)) *MockForge_Repo_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 model.ForgeRemoteID
if args[2] != nil {
arg2 = args[2].(model.ForgeRemoteID)
}
var arg3 string
if args[3] != nil {
arg3 = args[3].(string)
}
var arg4 string
if args[4] != nil {
arg4 = args[4].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *MockForge_Repo_Call) Return(repo *model.Repo, err error) *MockForge_Repo_Call {
_c.Call.Return(repo, err)
return _c
}
func (_c *MockForge_Repo_Call) RunAndReturn(run func(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string) (*model.Repo, error)) *MockForge_Repo_Call {
_c.Call.Return(run)
return _c
}
// Repos provides a mock function for the type MockForge
func (_mock *MockForge) Repos(ctx context.Context, u *model.User, p *model.ListOptions) ([]*model.Repo, error) {
ret := _mock.Called(ctx, u, p)
if len(ret) == 0 {
panic("no return value specified for Repos")
}
var r0 []*model.Repo
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.ListOptions) ([]*model.Repo, error)); ok {
return returnFunc(ctx, u, p)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.ListOptions) []*model.Repo); ok {
r0 = returnFunc(ctx, u, p)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Repo)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.ListOptions) error); ok {
r1 = returnFunc(ctx, u, p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Repos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repos'
type MockForge_Repos_Call struct {
*mock.Call
}
// Repos is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - p *model.ListOptions
func (_e *MockForge_Expecter) Repos(ctx interface{}, u interface{}, p interface{}) *MockForge_Repos_Call {
return &MockForge_Repos_Call{Call: _e.mock.On("Repos", ctx, u, p)}
}
func (_c *MockForge_Repos_Call) Run(run func(ctx context.Context, u *model.User, p *model.ListOptions)) *MockForge_Repos_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.ListOptions
if args[2] != nil {
arg2 = args[2].(*model.ListOptions)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockForge_Repos_Call) Return(repos []*model.Repo, err error) *MockForge_Repos_Call {
_c.Call.Return(repos, err)
return _c
}
func (_c *MockForge_Repos_Call) RunAndReturn(run func(ctx context.Context, u *model.User, p *model.ListOptions) ([]*model.Repo, error)) *MockForge_Repos_Call {
_c.Call.Return(run)
return _c
}
// Status provides a mock function for the type MockForge
func (_mock *MockForge) Status(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow) error {
ret := _mock.Called(ctx, u, r, b, p)
if len(ret) == 0 {
panic("no return value specified for Status")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, *model.Workflow) error); ok {
r0 = returnFunc(ctx, u, r, b, p)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockForge_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'
type MockForge_Status_Call struct {
*mock.Call
}
// Status is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - r *model.Repo
// - b *model.Pipeline
// - p *model.Workflow
func (_e *MockForge_Expecter) Status(ctx interface{}, u interface{}, r interface{}, b interface{}, p interface{}) *MockForge_Status_Call {
return &MockForge_Status_Call{Call: _e.mock.On("Status", ctx, u, r, b, p)}
}
func (_c *MockForge_Status_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow)) *MockForge_Status_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.Repo
if args[2] != nil {
arg2 = args[2].(*model.Repo)
}
var arg3 *model.Pipeline
if args[3] != nil {
arg3 = args[3].(*model.Pipeline)
}
var arg4 *model.Workflow
if args[4] != nil {
arg4 = args[4].(*model.Workflow)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *MockForge_Status_Call) Return(err error) *MockForge_Status_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockForge_Status_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow) error) *MockForge_Status_Call {
_c.Call.Return(run)
return _c
}
// Teams provides a mock function for the type MockForge
func (_mock *MockForge) Teams(ctx context.Context, u *model.User, p *model.ListOptions) ([]*model.Team, error) {
ret := _mock.Called(ctx, u, p)
if len(ret) == 0 {
panic("no return value specified for Teams")
}
var r0 []*model.Team
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.ListOptions) ([]*model.Team, error)); ok {
return returnFunc(ctx, u, p)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.ListOptions) []*model.Team); ok {
r0 = returnFunc(ctx, u, p)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Team)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.ListOptions) error); ok {
r1 = returnFunc(ctx, u, p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockForge_Teams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Teams'
type MockForge_Teams_Call struct {
*mock.Call
}
// Teams is a helper method to define mock.On call
// - ctx context.Context
// - u *model.User
// - p *model.ListOptions
func (_e *MockForge_Expecter) Teams(ctx interface{}, u interface{}, p interface{}) *MockForge_Teams_Call {
return &MockForge_Teams_Call{Call: _e.mock.On("Teams", ctx, u, p)}
}
func (_c *MockForge_Teams_Call) Run(run func(ctx context.Context, u *model.User, p *model.ListOptions)) *MockForge_Teams_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *model.User
if args[1] != nil {
arg1 = args[1].(*model.User)
}
var arg2 *model.ListOptions
if args[2] != nil {
arg2 = args[2].(*model.ListOptions)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockForge_Teams_Call) Return(teams []*model.Team, err error) *MockForge_Teams_Call {
_c.Call.Return(teams, err)
return _c
}
func (_c *MockForge_Teams_Call) RunAndReturn(run func(ctx context.Context, u *model.User, p *model.ListOptions) ([]*model.Team, error)) *MockForge_Teams_Call {
_c.Call.Return(run)
return _c
}
// URL provides a mock function for the type MockForge
func (_mock *MockForge) URL() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for URL")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockForge_URL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'URL'
type MockForge_URL_Call struct {
*mock.Call
}
// URL is a helper method to define mock.On call
func (_e *MockForge_Expecter) URL() *MockForge_URL_Call {
return &MockForge_URL_Call{Call: _e.mock.On("URL")}
}
func (_c *MockForge_URL_Call) Run(run func()) *MockForge_URL_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockForge_URL_Call) Return(s string) *MockForge_URL_Call {
_c.Call.Return(s)
return _c
}
func (_c *MockForge_URL_Call) RunAndReturn(run func() string) *MockForge_URL_Call {
_c.Call.Return(run)
return _c
}