go.temporal.io/server@v1.23.0/common/tasks/scheduler_mock.go (about) 1 // The MIT License 2 // 3 // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. 4 // 5 // Copyright (c) 2020 Uber Technologies, Inc. 6 // 7 // Permission is hereby granted, free of charge, to any person obtaining a copy 8 // of this software and associated documentation files (the "Software"), to deal 9 // in the Software without restriction, including without limitation the rights 10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 // copies of the Software, and to permit persons to whom the Software is 12 // furnished to do so, subject to the following conditions: 13 // 14 // The above copyright notice and this permission notice shall be included in 15 // all copies or substantial portions of the Software. 16 // 17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 // THE SOFTWARE. 24 25 // Code generated by MockGen. DO NOT EDIT. 26 // Source: scheduler.go 27 28 // Package tasks is a generated GoMock package. 29 package tasks 30 31 import ( 32 reflect "reflect" 33 34 gomock "github.com/golang/mock/gomock" 35 ) 36 37 // MockScheduler is a mock of Scheduler interface. 38 type MockScheduler[T Task] struct { 39 ctrl *gomock.Controller 40 recorder *MockSchedulerMockRecorder[T] 41 } 42 43 // MockSchedulerMockRecorder is the mock recorder for MockScheduler. 44 type MockSchedulerMockRecorder[T Task] struct { 45 mock *MockScheduler[T] 46 } 47 48 // NewMockScheduler creates a new mock instance. 49 func NewMockScheduler[T Task](ctrl *gomock.Controller) *MockScheduler[T] { 50 mock := &MockScheduler[T]{ctrl: ctrl} 51 mock.recorder = &MockSchedulerMockRecorder[T]{mock} 52 return mock 53 } 54 55 // EXPECT returns an object that allows the caller to indicate expected use. 56 func (m *MockScheduler[T]) EXPECT() *MockSchedulerMockRecorder[T] { 57 return m.recorder 58 } 59 60 // Start mocks base method. 61 func (m *MockScheduler[T]) Start() { 62 m.ctrl.T.Helper() 63 m.ctrl.Call(m, "Start") 64 } 65 66 // Start indicates an expected call of Start. 67 func (mr *MockSchedulerMockRecorder[T]) Start() *gomock.Call { 68 mr.mock.ctrl.T.Helper() 69 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockScheduler[T])(nil).Start)) 70 } 71 72 // Stop mocks base method. 73 func (m *MockScheduler[T]) Stop() { 74 m.ctrl.T.Helper() 75 m.ctrl.Call(m, "Stop") 76 } 77 78 // Stop indicates an expected call of Stop. 79 func (mr *MockSchedulerMockRecorder[T]) Stop() *gomock.Call { 80 mr.mock.ctrl.T.Helper() 81 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockScheduler[T])(nil).Stop)) 82 } 83 84 // Submit mocks base method. 85 func (m *MockScheduler[T]) Submit(task T) { 86 m.ctrl.T.Helper() 87 m.ctrl.Call(m, "Submit", task) 88 } 89 90 // Submit indicates an expected call of Submit. 91 func (mr *MockSchedulerMockRecorder[T]) Submit(task interface{}) *gomock.Call { 92 mr.mock.ctrl.T.Helper() 93 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Submit", reflect.TypeOf((*MockScheduler[T])(nil).Submit), task) 94 } 95 96 // TrySubmit mocks base method. 97 func (m *MockScheduler[T]) TrySubmit(task T) bool { 98 m.ctrl.T.Helper() 99 ret := m.ctrl.Call(m, "TrySubmit", task) 100 ret0, _ := ret[0].(bool) 101 return ret0 102 } 103 104 // TrySubmit indicates an expected call of TrySubmit. 105 func (mr *MockSchedulerMockRecorder[T]) TrySubmit(task interface{}) *gomock.Call { 106 mr.mock.ctrl.T.Helper() 107 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrySubmit", reflect.TypeOf((*MockScheduler[T])(nil).TrySubmit), task) 108 }