| // Code generated by mockery v0.0.0-dev. DO NOT EDIT. |
| |
| package mocks |
| |
| import ( |
| context "context" |
| |
| buildbucketpb "go.chromium.org/luci/buildbucket/proto" |
| |
| mock "github.com/stretchr/testify/mock" |
| ) |
| |
| // BuildBucketInterface is an autogenerated mock type for the BuildBucketInterface type |
| type BuildBucketInterface struct { |
| mock.Mock |
| } |
| |
| // CancelBuild provides a mock function with given fields: ctx, buildID, summaryMarkdown |
| func (_m *BuildBucketInterface) CancelBuild(ctx context.Context, buildID int64, summaryMarkdown string) (*buildbucketpb.Build, error) { |
| ret := _m.Called(ctx, buildID, summaryMarkdown) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for CancelBuild") |
| } |
| |
| var r0 *buildbucketpb.Build |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, int64, string) (*buildbucketpb.Build, error)); ok { |
| return rf(ctx, buildID, summaryMarkdown) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, int64, string) *buildbucketpb.Build); ok { |
| r0 = rf(ctx, buildID, summaryMarkdown) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(*buildbucketpb.Build) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok { |
| r1 = rf(ctx, buildID, summaryMarkdown) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // CancelBuilds provides a mock function with given fields: ctx, buildIDs, summaryMarkdown |
| func (_m *BuildBucketInterface) CancelBuilds(ctx context.Context, buildIDs []int64, summaryMarkdown string) ([]*buildbucketpb.Build, error) { |
| ret := _m.Called(ctx, buildIDs, summaryMarkdown) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for CancelBuilds") |
| } |
| |
| var r0 []*buildbucketpb.Build |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, []int64, string) ([]*buildbucketpb.Build, error)); ok { |
| return rf(ctx, buildIDs, summaryMarkdown) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, []int64, string) []*buildbucketpb.Build); ok { |
| r0 = rf(ctx, buildIDs, summaryMarkdown) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).([]*buildbucketpb.Build) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, []int64, string) error); ok { |
| r1 = rf(ctx, buildIDs, summaryMarkdown) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // GetBuild provides a mock function with given fields: ctx, buildId |
| func (_m *BuildBucketInterface) GetBuild(ctx context.Context, buildId int64) (*buildbucketpb.Build, error) { |
| ret := _m.Called(ctx, buildId) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for GetBuild") |
| } |
| |
| var r0 *buildbucketpb.Build |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, int64) (*buildbucketpb.Build, error)); ok { |
| return rf(ctx, buildId) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, int64) *buildbucketpb.Build); ok { |
| r0 = rf(ctx, buildId) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(*buildbucketpb.Build) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { |
| r1 = rf(ctx, buildId) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // GetTrybotsForCL provides a mock function with given fields: ctx, issue, patchset, gerritUrl, tags |
| func (_m *BuildBucketInterface) GetTrybotsForCL(ctx context.Context, issue int64, patchset int64, gerritUrl string, tags map[string]string) ([]*buildbucketpb.Build, error) { |
| ret := _m.Called(ctx, issue, patchset, gerritUrl, tags) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for GetTrybotsForCL") |
| } |
| |
| var r0 []*buildbucketpb.Build |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, int64, int64, string, map[string]string) ([]*buildbucketpb.Build, error)); ok { |
| return rf(ctx, issue, patchset, gerritUrl, tags) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, int64, int64, string, map[string]string) []*buildbucketpb.Build); ok { |
| r0 = rf(ctx, issue, patchset, gerritUrl, tags) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).([]*buildbucketpb.Build) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, int64, int64, string, map[string]string) error); ok { |
| r1 = rf(ctx, issue, patchset, gerritUrl, tags) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // ScheduleBuilds provides a mock function with given fields: ctx, builds, buildsToTags, issue, patchset, gerritUrl, repo, bbProject, bbBucket |
| func (_m *BuildBucketInterface) ScheduleBuilds(ctx context.Context, builds []string, buildsToTags map[string]map[string]string, issue int64, patchset int64, gerritUrl string, repo string, bbProject string, bbBucket string) ([]*buildbucketpb.Build, error) { |
| ret := _m.Called(ctx, builds, buildsToTags, issue, patchset, gerritUrl, repo, bbProject, bbBucket) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for ScheduleBuilds") |
| } |
| |
| var r0 []*buildbucketpb.Build |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, []string, map[string]map[string]string, int64, int64, string, string, string, string) ([]*buildbucketpb.Build, error)); ok { |
| return rf(ctx, builds, buildsToTags, issue, patchset, gerritUrl, repo, bbProject, bbBucket) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, []string, map[string]map[string]string, int64, int64, string, string, string, string) []*buildbucketpb.Build); ok { |
| r0 = rf(ctx, builds, buildsToTags, issue, patchset, gerritUrl, repo, bbProject, bbBucket) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).([]*buildbucketpb.Build) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, []string, map[string]map[string]string, int64, int64, string, string, string, string) error); ok { |
| r1 = rf(ctx, builds, buildsToTags, issue, patchset, gerritUrl, repo, bbProject, bbBucket) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // Search provides a mock function with given fields: ctx, pred |
| func (_m *BuildBucketInterface) Search(ctx context.Context, pred *buildbucketpb.BuildPredicate) ([]*buildbucketpb.Build, error) { |
| ret := _m.Called(ctx, pred) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Search") |
| } |
| |
| var r0 []*buildbucketpb.Build |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, *buildbucketpb.BuildPredicate) ([]*buildbucketpb.Build, error)); ok { |
| return rf(ctx, pred) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, *buildbucketpb.BuildPredicate) []*buildbucketpb.Build); ok { |
| r0 = rf(ctx, pred) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).([]*buildbucketpb.Build) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, *buildbucketpb.BuildPredicate) error); ok { |
| r1 = rf(ctx, pred) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // StartBuild provides a mock function with given fields: ctx, buildId, taskId, token |
| func (_m *BuildBucketInterface) StartBuild(ctx context.Context, buildId int64, taskId string, token string) (string, error) { |
| ret := _m.Called(ctx, buildId, taskId, token) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for StartBuild") |
| } |
| |
| var r0 string |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, int64, string, string) (string, error)); ok { |
| return rf(ctx, buildId, taskId, token) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, int64, string, string) string); ok { |
| r0 = rf(ctx, buildId, taskId, token) |
| } else { |
| r0 = ret.Get(0).(string) |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, int64, string, string) error); ok { |
| r1 = rf(ctx, buildId, taskId, token) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // UpdateBuild provides a mock function with given fields: ctx, build, token |
| func (_m *BuildBucketInterface) UpdateBuild(ctx context.Context, build *buildbucketpb.Build, token string) error { |
| ret := _m.Called(ctx, build, token) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for UpdateBuild") |
| } |
| |
| var r0 error |
| if rf, ok := ret.Get(0).(func(context.Context, *buildbucketpb.Build, string) error); ok { |
| r0 = rf(ctx, build, token) |
| } else { |
| r0 = ret.Error(0) |
| } |
| |
| return r0 |
| } |
| |
| // NewBuildBucketInterface creates a new instance of BuildBucketInterface. 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 NewBuildBucketInterface(t interface { |
| mock.TestingT |
| Cleanup(func()) |
| }) *BuildBucketInterface { |
| mock := &BuildBucketInterface{} |
| mock.Mock.Test(t) |
| |
| t.Cleanup(func() { mock.AssertExpectations(t) }) |
| |
| return mock |
| } |