woodpecker/server/services/config/mocks/service.go
2024-07-13 01:41:35 -07:00

63 lines
2 KiB
Go

// Code generated by mockery. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
forge "go.woodpecker-ci.org/woodpecker/v2/server/forge"
model "go.woodpecker-ci.org/woodpecker/v2/server/model"
types "go.woodpecker-ci.org/woodpecker/v2/server/forge/types"
)
// Service is an autogenerated mock type for the Service type
type Service struct {
mock.Mock
}
// Fetch provides a mock function with given fields: ctx, _a1, user, repo, pipeline, oldConfigData, restart
func (_m *Service) Fetch(ctx context.Context, _a1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool) ([]*types.FileMeta, error) {
ret := _m.Called(ctx, _a1, user, repo, pipeline, oldConfigData, restart)
if len(ret) == 0 {
panic("no return value specified for Fetch")
}
var r0 []*types.FileMeta
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) ([]*types.FileMeta, error)); ok {
return rf(ctx, _a1, user, repo, pipeline, oldConfigData, restart)
}
if rf, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) []*types.FileMeta); ok {
r0 = rf(ctx, _a1, user, repo, pipeline, oldConfigData, restart)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.FileMeta)
}
}
if rf, ok := ret.Get(1).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) error); ok {
r1 = rf(ctx, _a1, user, repo, pipeline, oldConfigData, restart)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewService creates a new instance of Service. 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 NewService(t interface {
mock.TestingT
Cleanup(func())
}) *Service {
mock := &Service{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}