[MM-54132] Use annotated logger for log messages from jobs (#24275)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fcfcbd9909
Коммит
30b12f199b
91
server/einterfaces/mocks/Scheduler.go
Обычный файл
91
server/einterfaces/mocks/Scheduler.go
Обычный файл
@@ -0,0 +1,91 @@
|
||||
// Code generated by mockery v2.23.2. 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)
|
||||
|
||||
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)
|
||||
|
||||
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: c, cfg, pendingJobs, lastSuccessfulJob
|
||||
func (_m *Scheduler) ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, bool, *model.Job) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, bool, *model.Job) *model.Job); ok {
|
||||
r0 = rf(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.Config, bool, *model.Job) *model.AppError); ok {
|
||||
r1 = rf(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewScheduler interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}
|
||||
|
||||
// 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.
|
||||
func NewScheduler(t mockConstructorTestingTNewScheduler) *Scheduler {
|
||||
mock := &Scheduler{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
Ссылка в новой задаче
Block a user