mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
* Standardize request.CTX parameter naming to rctx - Migrate 886 request.CTX parameters across 147 files to use consistent 'rctx' naming - Updated function signatures from 'c', 'ctx', and 'cancelContext' to 'rctx' - Updated function bodies to reference the new parameter names - Preserved underscore parameters unchanged as they are unused - Fixed method receiver context issue in store.go 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Use request.CTX interface in batch worker * Manual fixes * Fix parameter naming * Add linter check --------- Co-authored-by: Claude <noreply@anthropic.com>
102 lines
2.8 KiB
Go
102 lines
2.8 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make einterfaces-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
request "github.com/mattermost/mattermost/server/public/shared/request"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
time "time"
|
|
)
|
|
|
|
// Scheduler is an autogenerated mock type for the Scheduler type
|
|
type Scheduler struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Enabled provides a mock function with given fields: cfg
|
|
func (_m *Scheduler) Enabled(cfg *model.Config) bool {
|
|
ret := _m.Called(cfg)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Enabled")
|
|
}
|
|
|
|
var r0 bool
|
|
if rf, ok := ret.Get(0).(func(*model.Config) bool); ok {
|
|
r0 = rf(cfg)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NextScheduleTime provides a mock function with given fields: cfg, now, pendingJobs, lastSuccessfulJob
|
|
func (_m *Scheduler) NextScheduleTime(cfg *model.Config, now time.Time, pendingJobs bool, lastSuccessfulJob *model.Job) *time.Time {
|
|
ret := _m.Called(cfg, now, pendingJobs, lastSuccessfulJob)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for NextScheduleTime")
|
|
}
|
|
|
|
var r0 *time.Time
|
|
if rf, ok := ret.Get(0).(func(*model.Config, time.Time, bool, *model.Job) *time.Time); ok {
|
|
r0 = rf(cfg, now, pendingJobs, lastSuccessfulJob)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*time.Time)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// ScheduleJob provides a mock function with given fields: rctx, cfg, pendingJobs, lastSuccessfulJob
|
|
func (_m *Scheduler) ScheduleJob(rctx request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
|
ret := _m.Called(rctx, cfg, pendingJobs, lastSuccessfulJob)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ScheduleJob")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, bool, *model.Job) (*model.Job, *model.AppError)); ok {
|
|
return rf(rctx, cfg, pendingJobs, lastSuccessfulJob)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, bool, *model.Job) *model.Job); ok {
|
|
r0 = rf(rctx, cfg, pendingJobs, lastSuccessfulJob)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.Config, bool, *model.Job) *model.AppError); ok {
|
|
r1 = rf(rctx, cfg, pendingJobs, lastSuccessfulJob)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewScheduler creates a new instance of Scheduler. 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 NewScheduler(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *Scheduler {
|
|
mock := &Scheduler{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|