[MM-54132] Use annotated logger for log messages from jobs (#24275)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fcfcbd9909
Коммит
30b12f199b
@@ -6,6 +6,7 @@ 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"
|
||||
)
|
||||
|
||||
@@ -14,13 +15,13 @@ type AccountMigrationInterface struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// MigrateToLdap provides a mock function with given fields: fromAuthService, foreignUserFieldNameToMatch, force, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
// MigrateToLdap provides a mock function with given fields: c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(c *request.Context, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make einterfaces-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// AppContextInterface is an autogenerated mock type for the AppContextInterface type
|
||||
type AppContextInterface struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AcceptLanguage provides a mock function with given fields:
|
||||
func (_m *AppContextInterface) AcceptLanguage() string {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// IPAddress provides a mock function with given fields:
|
||||
func (_m *AppContextInterface) IPAddress() string {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Path provides a mock function with given fields:
|
||||
func (_m *AppContextInterface) Path() string {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RequestId provides a mock function with given fields:
|
||||
func (_m *AppContextInterface) RequestId() string {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Session provides a mock function with given fields:
|
||||
func (_m *AppContextInterface) Session() *model.Session {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 *model.Session
|
||||
if rf, ok := ret.Get(0).(func() *model.Session); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Session)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// T provides a mock function with given fields: translationID, args
|
||||
func (_m *AppContextInterface) T(translationID string, args ...any) string {
|
||||
var _ca []any
|
||||
_ca = append(_ca, translationID)
|
||||
_ca = append(_ca, args...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(string, ...any) string); ok {
|
||||
r0 = rf(translationID, args...)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UserAgent provides a mock function with given fields:
|
||||
func (_m *AppContextInterface) UserAgent() string {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
@@ -5,8 +5,10 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
jobs "github.com/mattermost/mattermost/server/v8/einterfaces/jobs"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
)
|
||||
|
||||
// CloudJobInterface is an autogenerated mock type for the CloudJobInterface type
|
||||
@@ -15,15 +17,15 @@ type CloudJobInterface struct {
|
||||
}
|
||||
|
||||
// MakeScheduler provides a mock function with given fields:
|
||||
func (_m *CloudJobInterface) MakeScheduler() model.Scheduler {
|
||||
func (_m *CloudJobInterface) MakeScheduler() jobs.Scheduler {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 model.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() model.Scheduler); ok {
|
||||
var r0 jobs.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() jobs.Scheduler); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Scheduler)
|
||||
r0 = ret.Get(0).(jobs.Scheduler)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
jobs "github.com/mattermost/mattermost/server/v8/einterfaces/jobs"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
)
|
||||
|
||||
// DataRetentionJobInterface is an autogenerated mock type for the DataRetentionJobInterface type
|
||||
@@ -15,15 +17,15 @@ type DataRetentionJobInterface struct {
|
||||
}
|
||||
|
||||
// MakeScheduler provides a mock function with given fields:
|
||||
func (_m *DataRetentionJobInterface) MakeScheduler() model.Scheduler {
|
||||
func (_m *DataRetentionJobInterface) MakeScheduler() jobs.Scheduler {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 model.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() model.Scheduler); ok {
|
||||
var r0 jobs.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() jobs.Scheduler); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Scheduler)
|
||||
r0 = ret.Get(0).(jobs.Scheduler)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
jobs "github.com/mattermost/mattermost/server/v8/einterfaces/jobs"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
)
|
||||
|
||||
// ElasticsearchAggregatorInterface is an autogenerated mock type for the ElasticsearchAggregatorInterface type
|
||||
@@ -15,15 +17,15 @@ type ElasticsearchAggregatorInterface struct {
|
||||
}
|
||||
|
||||
// MakeScheduler provides a mock function with given fields:
|
||||
func (_m *ElasticsearchAggregatorInterface) MakeScheduler() model.Scheduler {
|
||||
func (_m *ElasticsearchAggregatorInterface) MakeScheduler() jobs.Scheduler {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 model.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() model.Scheduler); ok {
|
||||
var r0 jobs.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() jobs.Scheduler); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Scheduler)
|
||||
r0 = ret.Get(0).(jobs.Scheduler)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -334,25 +334,25 @@ func (_m *LdapInterface) RunTest() *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// StartSynchronizeJob provides a mock function with given fields: waitForJobToFinish, includeRemovedMembers
|
||||
func (_m *LdapInterface) StartSynchronizeJob(waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(waitForJobToFinish, includeRemovedMembers)
|
||||
// StartSynchronizeJob provides a mock function with given fields: c, waitForJobToFinish, includeRemovedMembers
|
||||
func (_m *LdapInterface) StartSynchronizeJob(c *request.Context, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, waitForJobToFinish, includeRemovedMembers)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(bool, bool) (*model.Job, *model.AppError)); ok {
|
||||
return rf(waitForJobToFinish, includeRemovedMembers)
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, bool, bool) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(bool, bool) *model.Job); ok {
|
||||
r0 = rf(waitForJobToFinish, includeRemovedMembers)
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, bool, bool) *model.Job); ok {
|
||||
r0 = rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(bool, bool) *model.AppError); ok {
|
||||
r1 = rf(waitForJobToFinish, includeRemovedMembers)
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, bool, bool) *model.AppError); ok {
|
||||
r1 = rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
jobs "github.com/mattermost/mattermost/server/v8/einterfaces/jobs"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
)
|
||||
|
||||
// LdapSyncInterface is an autogenerated mock type for the LdapSyncInterface type
|
||||
@@ -15,15 +17,15 @@ type LdapSyncInterface struct {
|
||||
}
|
||||
|
||||
// MakeScheduler provides a mock function with given fields:
|
||||
func (_m *LdapSyncInterface) MakeScheduler() model.Scheduler {
|
||||
func (_m *LdapSyncInterface) MakeScheduler() jobs.Scheduler {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 model.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() model.Scheduler); ok {
|
||||
var r0 jobs.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() jobs.Scheduler); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Scheduler)
|
||||
r0 = ret.Get(0).(jobs.Scheduler)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// MessageExportInterface is an autogenerated mock type for the MessageExportInterface type
|
||||
@@ -43,25 +41,25 @@ func (_m *MessageExportInterface) RunExport(format string, since int64, limit in
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// StartSynchronizeJob provides a mock function with given fields: ctx, exportFromTimestamp
|
||||
func (_m *MessageExportInterface) StartSynchronizeJob(ctx context.Context, exportFromTimestamp int64) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(ctx, exportFromTimestamp)
|
||||
// StartSynchronizeJob provides a mock function with given fields: c, exportFromTimestamp
|
||||
func (_m *MessageExportInterface) StartSynchronizeJob(c *request.Context, exportFromTimestamp int64) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, exportFromTimestamp)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) (*model.Job, *model.AppError)); ok {
|
||||
return rf(ctx, exportFromTimestamp)
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, int64) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, exportFromTimestamp)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) *model.Job); ok {
|
||||
r0 = rf(ctx, exportFromTimestamp)
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, int64) *model.Job); ok {
|
||||
r0 = rf(c, exportFromTimestamp)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, int64) *model.AppError); ok {
|
||||
r1 = rf(ctx, exportFromTimestamp)
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, int64) *model.AppError); ok {
|
||||
r1 = rf(c, exportFromTimestamp)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
jobs "github.com/mattermost/mattermost/server/v8/einterfaces/jobs"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
)
|
||||
|
||||
// MessageExportJobInterface is an autogenerated mock type for the MessageExportJobInterface type
|
||||
@@ -15,15 +17,15 @@ type MessageExportJobInterface struct {
|
||||
}
|
||||
|
||||
// MakeScheduler provides a mock function with given fields:
|
||||
func (_m *MessageExportJobInterface) MakeScheduler() model.Scheduler {
|
||||
func (_m *MessageExportJobInterface) MakeScheduler() jobs.Scheduler {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 model.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() model.Scheduler); ok {
|
||||
var r0 jobs.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() jobs.Scheduler); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Scheduler)
|
||||
r0 = ret.Get(0).(jobs.Scheduler)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make einterfaces-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// ResendInvitationEmailJobInterface is an autogenerated mock type for the ResendInvitationEmailJobInterface type
|
||||
type ResendInvitationEmailJobInterface struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// MakeScheduler provides a mock function with given fields:
|
||||
func (_m *ResendInvitationEmailJobInterface) MakeScheduler() model.Scheduler {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 model.Scheduler
|
||||
if rf, ok := ret.Get(0).(func() model.Scheduler); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Scheduler)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// MakeWorker provides a mock function with given fields:
|
||||
func (_m *ResendInvitationEmailJobInterface) MakeWorker() model.Worker {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 model.Worker
|
||||
if rf, ok := ret.Get(0).(func() model.Worker); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Worker)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
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