mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-02-05 13:25:19 +02:00
* update mockery config * update mockery config * rename mockery config * update existing mocks * update mockery config * update mockery config * move cmd mocks to cmd pkg * add hadolint mocks to config * use moved files * remove comment
383 lines
14 KiB
Go
383 lines
14 KiB
Go
// Code generated by mockery v2.43.0. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
|
|
github "github.com/google/go-github/v45/github"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
os "os"
|
|
)
|
|
|
|
// GithubRepoClient is an autogenerated mock type for the GithubRepoClient type
|
|
type GithubRepoClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type GithubRepoClient_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *GithubRepoClient) EXPECT() *GithubRepoClient_Expecter {
|
|
return &GithubRepoClient_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// CreateRelease provides a mock function with given fields: ctx, owner, repo, release
|
|
func (_m *GithubRepoClient) CreateRelease(ctx context.Context, owner string, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error) {
|
|
ret := _m.Called(ctx, owner, repo, release)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreateRelease")
|
|
}
|
|
|
|
var r0 *github.RepositoryRelease
|
|
var r1 *github.Response
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)); ok {
|
|
return rf(ctx, owner, repo, release)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, *github.RepositoryRelease) *github.RepositoryRelease); ok {
|
|
r0 = rf(ctx, owner, repo, release)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*github.RepositoryRelease)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, *github.RepositoryRelease) *github.Response); ok {
|
|
r1 = rf(ctx, owner, repo, release)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*github.Response)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, string, *github.RepositoryRelease) error); ok {
|
|
r2 = rf(ctx, owner, repo, release)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// GithubRepoClient_CreateRelease_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRelease'
|
|
type GithubRepoClient_CreateRelease_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// CreateRelease is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - owner string
|
|
// - repo string
|
|
// - release *github.RepositoryRelease
|
|
func (_e *GithubRepoClient_Expecter) CreateRelease(ctx interface{}, owner interface{}, repo interface{}, release interface{}) *GithubRepoClient_CreateRelease_Call {
|
|
return &GithubRepoClient_CreateRelease_Call{Call: _e.mock.On("CreateRelease", ctx, owner, repo, release)}
|
|
}
|
|
|
|
func (_c *GithubRepoClient_CreateRelease_Call) Run(run func(ctx context.Context, owner string, repo string, release *github.RepositoryRelease)) *GithubRepoClient_CreateRelease_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*github.RepositoryRelease))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_CreateRelease_Call) Return(_a0 *github.RepositoryRelease, _a1 *github.Response, _a2 error) *GithubRepoClient_CreateRelease_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_CreateRelease_Call) RunAndReturn(run func(context.Context, string, string, *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)) *GithubRepoClient_CreateRelease_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// DeleteReleaseAsset provides a mock function with given fields: ctx, owner, repo, id
|
|
func (_m *GithubRepoClient) DeleteReleaseAsset(ctx context.Context, owner string, repo string, id int64) (*github.Response, error) {
|
|
ret := _m.Called(ctx, owner, repo, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeleteReleaseAsset")
|
|
}
|
|
|
|
var r0 *github.Response
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64) (*github.Response, error)); ok {
|
|
return rf(ctx, owner, repo, id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64) *github.Response); ok {
|
|
r0 = rf(ctx, owner, repo, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*github.Response)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, int64) error); ok {
|
|
r1 = rf(ctx, owner, repo, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GithubRepoClient_DeleteReleaseAsset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteReleaseAsset'
|
|
type GithubRepoClient_DeleteReleaseAsset_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// DeleteReleaseAsset is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - owner string
|
|
// - repo string
|
|
// - id int64
|
|
func (_e *GithubRepoClient_Expecter) DeleteReleaseAsset(ctx interface{}, owner interface{}, repo interface{}, id interface{}) *GithubRepoClient_DeleteReleaseAsset_Call {
|
|
return &GithubRepoClient_DeleteReleaseAsset_Call{Call: _e.mock.On("DeleteReleaseAsset", ctx, owner, repo, id)}
|
|
}
|
|
|
|
func (_c *GithubRepoClient_DeleteReleaseAsset_Call) Run(run func(ctx context.Context, owner string, repo string, id int64)) *GithubRepoClient_DeleteReleaseAsset_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(int64))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_DeleteReleaseAsset_Call) Return(_a0 *github.Response, _a1 error) *GithubRepoClient_DeleteReleaseAsset_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_DeleteReleaseAsset_Call) RunAndReturn(run func(context.Context, string, string, int64) (*github.Response, error)) *GithubRepoClient_DeleteReleaseAsset_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetLatestRelease provides a mock function with given fields: ctx, owner, repo
|
|
func (_m *GithubRepoClient) GetLatestRelease(ctx context.Context, owner string, repo string) (*github.RepositoryRelease, *github.Response, error) {
|
|
ret := _m.Called(ctx, owner, repo)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetLatestRelease")
|
|
}
|
|
|
|
var r0 *github.RepositoryRelease
|
|
var r1 *github.Response
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*github.RepositoryRelease, *github.Response, error)); ok {
|
|
return rf(ctx, owner, repo)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) *github.RepositoryRelease); ok {
|
|
r0 = rf(ctx, owner, repo)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*github.RepositoryRelease)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string) *github.Response); ok {
|
|
r1 = rf(ctx, owner, repo)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*github.Response)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
|
r2 = rf(ctx, owner, repo)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// GithubRepoClient_GetLatestRelease_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestRelease'
|
|
type GithubRepoClient_GetLatestRelease_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetLatestRelease is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - owner string
|
|
// - repo string
|
|
func (_e *GithubRepoClient_Expecter) GetLatestRelease(ctx interface{}, owner interface{}, repo interface{}) *GithubRepoClient_GetLatestRelease_Call {
|
|
return &GithubRepoClient_GetLatestRelease_Call{Call: _e.mock.On("GetLatestRelease", ctx, owner, repo)}
|
|
}
|
|
|
|
func (_c *GithubRepoClient_GetLatestRelease_Call) Run(run func(ctx context.Context, owner string, repo string)) *GithubRepoClient_GetLatestRelease_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_GetLatestRelease_Call) Return(_a0 *github.RepositoryRelease, _a1 *github.Response, _a2 error) *GithubRepoClient_GetLatestRelease_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_GetLatestRelease_Call) RunAndReturn(run func(context.Context, string, string) (*github.RepositoryRelease, *github.Response, error)) *GithubRepoClient_GetLatestRelease_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ListReleaseAssets provides a mock function with given fields: ctx, owner, repo, id, opt
|
|
func (_m *GithubRepoClient) ListReleaseAssets(ctx context.Context, owner string, repo string, id int64, opt *github.ListOptions) ([]*github.ReleaseAsset, *github.Response, error) {
|
|
ret := _m.Called(ctx, owner, repo, id, opt)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ListReleaseAssets")
|
|
}
|
|
|
|
var r0 []*github.ReleaseAsset
|
|
var r1 *github.Response
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64, *github.ListOptions) ([]*github.ReleaseAsset, *github.Response, error)); ok {
|
|
return rf(ctx, owner, repo, id, opt)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64, *github.ListOptions) []*github.ReleaseAsset); ok {
|
|
r0 = rf(ctx, owner, repo, id, opt)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*github.ReleaseAsset)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, int64, *github.ListOptions) *github.Response); ok {
|
|
r1 = rf(ctx, owner, repo, id, opt)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*github.Response)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, string, int64, *github.ListOptions) error); ok {
|
|
r2 = rf(ctx, owner, repo, id, opt)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// GithubRepoClient_ListReleaseAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListReleaseAssets'
|
|
type GithubRepoClient_ListReleaseAssets_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ListReleaseAssets is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - owner string
|
|
// - repo string
|
|
// - id int64
|
|
// - opt *github.ListOptions
|
|
func (_e *GithubRepoClient_Expecter) ListReleaseAssets(ctx interface{}, owner interface{}, repo interface{}, id interface{}, opt interface{}) *GithubRepoClient_ListReleaseAssets_Call {
|
|
return &GithubRepoClient_ListReleaseAssets_Call{Call: _e.mock.On("ListReleaseAssets", ctx, owner, repo, id, opt)}
|
|
}
|
|
|
|
func (_c *GithubRepoClient_ListReleaseAssets_Call) Run(run func(ctx context.Context, owner string, repo string, id int64, opt *github.ListOptions)) *GithubRepoClient_ListReleaseAssets_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(int64), args[4].(*github.ListOptions))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_ListReleaseAssets_Call) Return(_a0 []*github.ReleaseAsset, _a1 *github.Response, _a2 error) *GithubRepoClient_ListReleaseAssets_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_ListReleaseAssets_Call) RunAndReturn(run func(context.Context, string, string, int64, *github.ListOptions) ([]*github.ReleaseAsset, *github.Response, error)) *GithubRepoClient_ListReleaseAssets_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// UploadReleaseAsset provides a mock function with given fields: ctx, owner, repo, id, opt, file
|
|
func (_m *GithubRepoClient) UploadReleaseAsset(ctx context.Context, owner string, repo string, id int64, opt *github.UploadOptions, file *os.File) (*github.ReleaseAsset, *github.Response, error) {
|
|
ret := _m.Called(ctx, owner, repo, id, opt, file)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UploadReleaseAsset")
|
|
}
|
|
|
|
var r0 *github.ReleaseAsset
|
|
var r1 *github.Response
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64, *github.UploadOptions, *os.File) (*github.ReleaseAsset, *github.Response, error)); ok {
|
|
return rf(ctx, owner, repo, id, opt, file)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64, *github.UploadOptions, *os.File) *github.ReleaseAsset); ok {
|
|
r0 = rf(ctx, owner, repo, id, opt, file)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*github.ReleaseAsset)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, int64, *github.UploadOptions, *os.File) *github.Response); ok {
|
|
r1 = rf(ctx, owner, repo, id, opt, file)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*github.Response)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, string, int64, *github.UploadOptions, *os.File) error); ok {
|
|
r2 = rf(ctx, owner, repo, id, opt, file)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// GithubRepoClient_UploadReleaseAsset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UploadReleaseAsset'
|
|
type GithubRepoClient_UploadReleaseAsset_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// UploadReleaseAsset is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - owner string
|
|
// - repo string
|
|
// - id int64
|
|
// - opt *github.UploadOptions
|
|
// - file *os.File
|
|
func (_e *GithubRepoClient_Expecter) UploadReleaseAsset(ctx interface{}, owner interface{}, repo interface{}, id interface{}, opt interface{}, file interface{}) *GithubRepoClient_UploadReleaseAsset_Call {
|
|
return &GithubRepoClient_UploadReleaseAsset_Call{Call: _e.mock.On("UploadReleaseAsset", ctx, owner, repo, id, opt, file)}
|
|
}
|
|
|
|
func (_c *GithubRepoClient_UploadReleaseAsset_Call) Run(run func(ctx context.Context, owner string, repo string, id int64, opt *github.UploadOptions, file *os.File)) *GithubRepoClient_UploadReleaseAsset_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(int64), args[4].(*github.UploadOptions), args[5].(*os.File))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_UploadReleaseAsset_Call) Return(_a0 *github.ReleaseAsset, _a1 *github.Response, _a2 error) *GithubRepoClient_UploadReleaseAsset_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *GithubRepoClient_UploadReleaseAsset_Call) RunAndReturn(run func(context.Context, string, string, int64, *github.UploadOptions, *os.File) (*github.ReleaseAsset, *github.Response, error)) *GithubRepoClient_UploadReleaseAsset_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewGithubRepoClient creates a new instance of GithubRepoClient. 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 NewGithubRepoClient(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *GithubRepoClient {
|
|
mock := &GithubRepoClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|