blob: 388bfcef26ee3de6aa337d4e160531350ea303d2 [file] [log] [blame]
// Code generated by mockery v0.0.0-dev. DO NOT EDIT.
package mocks
import (
context "context"
codereview "go.skia.org/infra/skcq/go/codereview"
gerrit "go.skia.org/infra/go/gerrit"
mock "github.com/stretchr/testify/mock"
testing "testing"
)
// CodeReview is an autogenerated mock type for the CodeReview type
type CodeReview struct {
mock.Mock
}
// AddComment provides a mock function with given fields: ctx, ci, comment, notify, notifyReason
func (_m *CodeReview) AddComment(ctx context.Context, ci *gerrit.ChangeInfo, comment string, notify codereview.NotifyOption, notifyReason string) error {
ret := _m.Called(ctx, ci, comment, notify, notifyReason)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo, string, codereview.NotifyOption, string) error); ok {
r0 = rf(ctx, ci, comment, notify, notifyReason)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetCQVoters provides a mock function with given fields: ctx, ci
func (_m *CodeReview) GetCQVoters(ctx context.Context, ci *gerrit.ChangeInfo) []string {
ret := _m.Called(ctx, ci)
var r0 []string
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo) []string); ok {
r0 = rf(ctx, ci)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
return r0
}
// GetChangeRef provides a mock function with given fields: ci
func (_m *CodeReview) GetChangeRef(ci *gerrit.ChangeInfo) string {
ret := _m.Called(ci)
var r0 string
if rf, ok := ret.Get(0).(func(*gerrit.ChangeInfo) string); ok {
r0 = rf(ci)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// GetCommitAuthor provides a mock function with given fields: ctx, issue, revision
func (_m *CodeReview) GetCommitAuthor(ctx context.Context, issue int64, revision string) (string, error) {
ret := _m.Called(ctx, issue, revision)
var r0 string
if rf, ok := ret.Get(0).(func(context.Context, int64, string) string); ok {
r0 = rf(ctx, issue, revision)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok {
r1 = rf(ctx, issue, revision)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetCommitMessage provides a mock function with given fields: ctx, issue
func (_m *CodeReview) GetCommitMessage(ctx context.Context, issue int64) (string, error) {
ret := _m.Called(ctx, issue)
var r0 string
if rf, ok := ret.Get(0).(func(context.Context, int64) string); ok {
r0 = rf(ctx, issue)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
r1 = rf(ctx, issue)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetEarliestEquivalentPatchSetID provides a mock function with given fields: ci
func (_m *CodeReview) GetEarliestEquivalentPatchSetID(ci *gerrit.ChangeInfo) int64 {
ret := _m.Called(ci)
var r0 int64
if rf, ok := ret.Get(0).(func(*gerrit.ChangeInfo) int64); ok {
r0 = rf(ci)
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// GetEquivalentPatchSetIDs provides a mock function with given fields: ci, patchsetID
func (_m *CodeReview) GetEquivalentPatchSetIDs(ci *gerrit.ChangeInfo, patchsetID int64) []int64 {
ret := _m.Called(ci, patchsetID)
var r0 []int64
if rf, ok := ret.Get(0).(func(*gerrit.ChangeInfo, int64) []int64); ok {
r0 = rf(ci, patchsetID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]int64)
}
}
return r0
}
// GetFileNames provides a mock function with given fields: ctx, ci
func (_m *CodeReview) GetFileNames(ctx context.Context, ci *gerrit.ChangeInfo) ([]string, error) {
ret := _m.Called(ctx, ci)
var r0 []string
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo) []string); ok {
r0 = rf(ctx, ci)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *gerrit.ChangeInfo) error); ok {
r1 = rf(ctx, ci)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetIssueProperties provides a mock function with given fields: ctx, issue
func (_m *CodeReview) GetIssueProperties(ctx context.Context, issue int64) (*gerrit.ChangeInfo, error) {
ret := _m.Called(ctx, issue)
var r0 *gerrit.ChangeInfo
if rf, ok := ret.Get(0).(func(context.Context, int64) *gerrit.ChangeInfo); ok {
r0 = rf(ctx, issue)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*gerrit.ChangeInfo)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
r1 = rf(ctx, issue)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetLatestPatchSetID provides a mock function with given fields: ci
func (_m *CodeReview) GetLatestPatchSetID(ci *gerrit.ChangeInfo) int64 {
ret := _m.Called(ci)
var r0 int64
if rf, ok := ret.Get(0).(func(*gerrit.ChangeInfo) int64); ok {
r0 = rf(ci)
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// GetRepoUrl provides a mock function with given fields: ci
func (_m *CodeReview) GetRepoUrl(ci *gerrit.ChangeInfo) string {
ret := _m.Called(ci)
var r0 string
if rf, ok := ret.Get(0).(func(*gerrit.ChangeInfo) string); ok {
r0 = rf(ci)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// GetSubmittedTogether provides a mock function with given fields: ctx, ci
func (_m *CodeReview) GetSubmittedTogether(ctx context.Context, ci *gerrit.ChangeInfo) ([]*gerrit.ChangeInfo, error) {
ret := _m.Called(ctx, ci)
var r0 []*gerrit.ChangeInfo
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo) []*gerrit.ChangeInfo); ok {
r0 = rf(ctx, ci)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*gerrit.ChangeInfo)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *gerrit.ChangeInfo) error); ok {
r1 = rf(ctx, ci)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IsCQ provides a mock function with given fields: ctx, ci
func (_m *CodeReview) IsCQ(ctx context.Context, ci *gerrit.ChangeInfo) bool {
ret := _m.Called(ctx, ci)
var r0 bool
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo) bool); ok {
r0 = rf(ctx, ci)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// IsDryRun provides a mock function with given fields: ctx, ci
func (_m *CodeReview) IsDryRun(ctx context.Context, ci *gerrit.ChangeInfo) bool {
ret := _m.Called(ctx, ci)
var r0 bool
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo) bool); ok {
r0 = rf(ctx, ci)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// RemoveFromCQ provides a mock function with given fields: ctx, ci, comment, notifyReason
func (_m *CodeReview) RemoveFromCQ(ctx context.Context, ci *gerrit.ChangeInfo, comment string, notifyReason string) {
_m.Called(ctx, ci, comment, notifyReason)
}
// Search provides a mock function with given fields: ctx
func (_m *CodeReview) Search(ctx context.Context) ([]*gerrit.ChangeInfo, error) {
ret := _m.Called(ctx)
var r0 []*gerrit.ChangeInfo
if rf, ok := ret.Get(0).(func(context.Context) []*gerrit.ChangeInfo); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*gerrit.ChangeInfo)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SetReadyForReview provides a mock function with given fields: ctx, ci
func (_m *CodeReview) SetReadyForReview(ctx context.Context, ci *gerrit.ChangeInfo) error {
ret := _m.Called(ctx, ci)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo) error); ok {
r0 = rf(ctx, ci)
} else {
r0 = ret.Error(0)
}
return r0
}
// Submit provides a mock function with given fields: ctx, ci
func (_m *CodeReview) Submit(ctx context.Context, ci *gerrit.ChangeInfo) error {
ret := _m.Called(ctx, ci)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *gerrit.ChangeInfo) error); ok {
r0 = rf(ctx, ci)
} else {
r0 = ret.Error(0)
}
return r0
}
// Url provides a mock function with given fields: issueID
func (_m *CodeReview) Url(issueID int64) string {
ret := _m.Called(issueID)
var r0 string
if rf, ok := ret.Get(0).(func(int64) string); ok {
r0 = rf(issueID)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewCodeReview creates a new instance of CodeReview. It also registers a cleanup function to assert the mocks expectations.
func NewCodeReview(t testing.TB) *CodeReview {
mock := &CodeReview{}
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}