service/history/execution/context_mock.go (262 lines of code) (raw):

// The MIT License (MIT) // Copyright (c) 2017-2020 Uber Technologies Inc. // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // Code generated by MockGen. DO NOT EDIT. // Source: context.go // Package execution is a generated GoMock package. package execution import ( context "context" reflect "reflect" time "time" gomock "github.com/golang/mock/gomock" persistence "github.com/uber/cadence/common/persistence" types "github.com/uber/cadence/common/types" events "github.com/uber/cadence/service/history/events" ) // MockContext is a mock of Context interface. type MockContext struct { ctrl *gomock.Controller recorder *MockContextMockRecorder } // MockContextMockRecorder is the mock recorder for MockContext. type MockContextMockRecorder struct { mock *MockContext } // NewMockContext creates a new mock instance. func NewMockContext(ctrl *gomock.Controller) *MockContext { mock := &MockContext{ctrl: ctrl} mock.recorder = &MockContextMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockContext) EXPECT() *MockContextMockRecorder { return m.recorder } // Clear mocks base method. func (m *MockContext) Clear() { m.ctrl.T.Helper() m.ctrl.Call(m, "Clear") } // Clear indicates an expected call of Clear. func (mr *MockContextMockRecorder) Clear() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clear", reflect.TypeOf((*MockContext)(nil).Clear)) } // ConflictResolveWorkflowExecution mocks base method. func (m *MockContext) ConflictResolveWorkflowExecution(ctx context.Context, now time.Time, conflictResolveMode persistence.ConflictResolveWorkflowMode, resetMutableState MutableState, newContext Context, newMutableState MutableState, currentContext Context, currentMutableState MutableState, currentTransactionPolicy *TransactionPolicy) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ConflictResolveWorkflowExecution", ctx, now, conflictResolveMode, resetMutableState, newContext, newMutableState, currentContext, currentMutableState, currentTransactionPolicy) ret0, _ := ret[0].(error) return ret0 } // ConflictResolveWorkflowExecution indicates an expected call of ConflictResolveWorkflowExecution. func (mr *MockContextMockRecorder) ConflictResolveWorkflowExecution(ctx, now, conflictResolveMode, resetMutableState, newContext, newMutableState, currentContext, currentMutableState, currentTransactionPolicy interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConflictResolveWorkflowExecution", reflect.TypeOf((*MockContext)(nil).ConflictResolveWorkflowExecution), ctx, now, conflictResolveMode, resetMutableState, newContext, newMutableState, currentContext, currentMutableState, currentTransactionPolicy) } // CreateWorkflowExecution mocks base method. func (m *MockContext) CreateWorkflowExecution(ctx context.Context, newWorkflow *persistence.WorkflowSnapshot, persistedHistory events.PersistedBlob, createMode persistence.CreateWorkflowMode, prevRunID string, prevLastWriteVersion int64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateWorkflowExecution", ctx, newWorkflow, persistedHistory, createMode, prevRunID, prevLastWriteVersion) ret0, _ := ret[0].(error) return ret0 } // CreateWorkflowExecution indicates an expected call of CreateWorkflowExecution. func (mr *MockContextMockRecorder) CreateWorkflowExecution(ctx, newWorkflow, persistedHistory, createMode, prevRunID, prevLastWriteVersion interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkflowExecution", reflect.TypeOf((*MockContext)(nil).CreateWorkflowExecution), ctx, newWorkflow, persistedHistory, createMode, prevRunID, prevLastWriteVersion) } // GetDomainID mocks base method. func (m *MockContext) GetDomainID() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetDomainID") ret0, _ := ret[0].(string) return ret0 } // GetDomainID indicates an expected call of GetDomainID. func (mr *MockContextMockRecorder) GetDomainID() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDomainID", reflect.TypeOf((*MockContext)(nil).GetDomainID)) } // GetDomainName mocks base method. func (m *MockContext) GetDomainName() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetDomainName") ret0, _ := ret[0].(string) return ret0 } // GetDomainName indicates an expected call of GetDomainName. func (mr *MockContextMockRecorder) GetDomainName() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDomainName", reflect.TypeOf((*MockContext)(nil).GetDomainName)) } // GetExecution mocks base method. func (m *MockContext) GetExecution() *types.WorkflowExecution { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetExecution") ret0, _ := ret[0].(*types.WorkflowExecution) return ret0 } // GetExecution indicates an expected call of GetExecution. func (mr *MockContextMockRecorder) GetExecution() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExecution", reflect.TypeOf((*MockContext)(nil).GetExecution)) } // GetHistorySize mocks base method. func (m *MockContext) GetHistorySize() int64 { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetHistorySize") ret0, _ := ret[0].(int64) return ret0 } // GetHistorySize indicates an expected call of GetHistorySize. func (mr *MockContextMockRecorder) GetHistorySize() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHistorySize", reflect.TypeOf((*MockContext)(nil).GetHistorySize)) } // GetWorkflowExecution mocks base method. func (m *MockContext) GetWorkflowExecution() MutableState { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetWorkflowExecution") ret0, _ := ret[0].(MutableState) return ret0 } // GetWorkflowExecution indicates an expected call of GetWorkflowExecution. func (mr *MockContextMockRecorder) GetWorkflowExecution() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkflowExecution", reflect.TypeOf((*MockContext)(nil).GetWorkflowExecution)) } // LoadExecutionStats mocks base method. func (m *MockContext) LoadExecutionStats(ctx context.Context) (*persistence.ExecutionStats, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LoadExecutionStats", ctx) ret0, _ := ret[0].(*persistence.ExecutionStats) ret1, _ := ret[1].(error) return ret0, ret1 } // LoadExecutionStats indicates an expected call of LoadExecutionStats. func (mr *MockContextMockRecorder) LoadExecutionStats(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadExecutionStats", reflect.TypeOf((*MockContext)(nil).LoadExecutionStats), ctx) } // LoadWorkflowExecution mocks base method. func (m *MockContext) LoadWorkflowExecution(ctx context.Context) (MutableState, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LoadWorkflowExecution", ctx) ret0, _ := ret[0].(MutableState) ret1, _ := ret[1].(error) return ret0, ret1 } // LoadWorkflowExecution indicates an expected call of LoadWorkflowExecution. func (mr *MockContextMockRecorder) LoadWorkflowExecution(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadWorkflowExecution", reflect.TypeOf((*MockContext)(nil).LoadWorkflowExecution), ctx) } // LoadWorkflowExecutionWithTaskVersion mocks base method. func (m *MockContext) LoadWorkflowExecutionWithTaskVersion(ctx context.Context, incomingVersion int64) (MutableState, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LoadWorkflowExecutionWithTaskVersion", ctx, incomingVersion) ret0, _ := ret[0].(MutableState) ret1, _ := ret[1].(error) return ret0, ret1 } // LoadWorkflowExecutionWithTaskVersion indicates an expected call of LoadWorkflowExecutionWithTaskVersion. func (mr *MockContextMockRecorder) LoadWorkflowExecutionWithTaskVersion(ctx, incomingVersion interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadWorkflowExecutionWithTaskVersion", reflect.TypeOf((*MockContext)(nil).LoadWorkflowExecutionWithTaskVersion), ctx, incomingVersion) } // Lock mocks base method. func (m *MockContext) Lock(ctx context.Context) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Lock", ctx) ret0, _ := ret[0].(error) return ret0 } // Lock indicates an expected call of Lock. func (mr *MockContextMockRecorder) Lock(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lock", reflect.TypeOf((*MockContext)(nil).Lock), ctx) } // PersistNonStartWorkflowBatchEvents mocks base method. func (m *MockContext) PersistNonStartWorkflowBatchEvents(ctx context.Context, workflowEvents *persistence.WorkflowEvents) (events.PersistedBlob, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PersistNonStartWorkflowBatchEvents", ctx, workflowEvents) ret0, _ := ret[0].(events.PersistedBlob) ret1, _ := ret[1].(error) return ret0, ret1 } // PersistNonStartWorkflowBatchEvents indicates an expected call of PersistNonStartWorkflowBatchEvents. func (mr *MockContextMockRecorder) PersistNonStartWorkflowBatchEvents(ctx, workflowEvents interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PersistNonStartWorkflowBatchEvents", reflect.TypeOf((*MockContext)(nil).PersistNonStartWorkflowBatchEvents), ctx, workflowEvents) } // PersistStartWorkflowBatchEvents mocks base method. func (m *MockContext) PersistStartWorkflowBatchEvents(ctx context.Context, workflowEvents *persistence.WorkflowEvents) (events.PersistedBlob, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PersistStartWorkflowBatchEvents", ctx, workflowEvents) ret0, _ := ret[0].(events.PersistedBlob) ret1, _ := ret[1].(error) return ret0, ret1 } // PersistStartWorkflowBatchEvents indicates an expected call of PersistStartWorkflowBatchEvents. func (mr *MockContextMockRecorder) PersistStartWorkflowBatchEvents(ctx, workflowEvents interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PersistStartWorkflowBatchEvents", reflect.TypeOf((*MockContext)(nil).PersistStartWorkflowBatchEvents), ctx, workflowEvents) } // ReapplyEvents mocks base method. func (m *MockContext) ReapplyEvents(eventBatches []*persistence.WorkflowEvents) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ReapplyEvents", eventBatches) ret0, _ := ret[0].(error) return ret0 } // ReapplyEvents indicates an expected call of ReapplyEvents. func (mr *MockContextMockRecorder) ReapplyEvents(eventBatches interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReapplyEvents", reflect.TypeOf((*MockContext)(nil).ReapplyEvents), eventBatches) } // SetHistorySize mocks base method. func (m *MockContext) SetHistorySize(size int64) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetHistorySize", size) } // SetHistorySize indicates an expected call of SetHistorySize. func (mr *MockContextMockRecorder) SetHistorySize(size interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHistorySize", reflect.TypeOf((*MockContext)(nil).SetHistorySize), size) } // SetWorkflowExecution mocks base method. func (m *MockContext) SetWorkflowExecution(mutableState MutableState) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetWorkflowExecution", mutableState) } // SetWorkflowExecution indicates an expected call of SetWorkflowExecution. func (mr *MockContextMockRecorder) SetWorkflowExecution(mutableState interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWorkflowExecution", reflect.TypeOf((*MockContext)(nil).SetWorkflowExecution), mutableState) } // Unlock mocks base method. func (m *MockContext) Unlock() { m.ctrl.T.Helper() m.ctrl.Call(m, "Unlock") } // Unlock indicates an expected call of Unlock. func (mr *MockContextMockRecorder) Unlock() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unlock", reflect.TypeOf((*MockContext)(nil).Unlock)) } // UpdateWorkflowExecutionAsActive mocks base method. func (m *MockContext) UpdateWorkflowExecutionAsActive(ctx context.Context, now time.Time) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateWorkflowExecutionAsActive", ctx, now) ret0, _ := ret[0].(error) return ret0 } // UpdateWorkflowExecutionAsActive indicates an expected call of UpdateWorkflowExecutionAsActive. func (mr *MockContextMockRecorder) UpdateWorkflowExecutionAsActive(ctx, now interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionAsActive", reflect.TypeOf((*MockContext)(nil).UpdateWorkflowExecutionAsActive), ctx, now) } // UpdateWorkflowExecutionAsPassive mocks base method. func (m *MockContext) UpdateWorkflowExecutionAsPassive(ctx context.Context, now time.Time) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateWorkflowExecutionAsPassive", ctx, now) ret0, _ := ret[0].(error) return ret0 } // UpdateWorkflowExecutionAsPassive indicates an expected call of UpdateWorkflowExecutionAsPassive. func (mr *MockContextMockRecorder) UpdateWorkflowExecutionAsPassive(ctx, now interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionAsPassive", reflect.TypeOf((*MockContext)(nil).UpdateWorkflowExecutionAsPassive), ctx, now) } // UpdateWorkflowExecutionTasks mocks base method. func (m *MockContext) UpdateWorkflowExecutionTasks(ctx context.Context, now time.Time) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateWorkflowExecutionTasks", ctx, now) ret0, _ := ret[0].(error) return ret0 } // UpdateWorkflowExecutionTasks indicates an expected call of UpdateWorkflowExecutionTasks. func (mr *MockContextMockRecorder) UpdateWorkflowExecutionTasks(ctx, now interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionTasks", reflect.TypeOf((*MockContext)(nil).UpdateWorkflowExecutionTasks), ctx, now) } // UpdateWorkflowExecutionWithNew mocks base method. func (m *MockContext) UpdateWorkflowExecutionWithNew(ctx context.Context, now time.Time, updateMode persistence.UpdateWorkflowMode, newContext Context, newMutableState MutableState, currentWorkflowTransactionPolicy TransactionPolicy, newWorkflowTransactionPolicy *TransactionPolicy) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateWorkflowExecutionWithNew", ctx, now, updateMode, newContext, newMutableState, currentWorkflowTransactionPolicy, newWorkflowTransactionPolicy) ret0, _ := ret[0].(error) return ret0 } // UpdateWorkflowExecutionWithNew indicates an expected call of UpdateWorkflowExecutionWithNew. func (mr *MockContextMockRecorder) UpdateWorkflowExecutionWithNew(ctx, now, updateMode, newContext, newMutableState, currentWorkflowTransactionPolicy, newWorkflowTransactionPolicy interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionWithNew", reflect.TypeOf((*MockContext)(nil).UpdateWorkflowExecutionWithNew), ctx, now, updateMode, newContext, newMutableState, currentWorkflowTransactionPolicy, newWorkflowTransactionPolicy) } // UpdateWorkflowExecutionWithNewAsActive mocks base method. func (m *MockContext) UpdateWorkflowExecutionWithNewAsActive(ctx context.Context, now time.Time, newContext Context, newMutableState MutableState) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateWorkflowExecutionWithNewAsActive", ctx, now, newContext, newMutableState) ret0, _ := ret[0].(error) return ret0 } // UpdateWorkflowExecutionWithNewAsActive indicates an expected call of UpdateWorkflowExecutionWithNewAsActive. func (mr *MockContextMockRecorder) UpdateWorkflowExecutionWithNewAsActive(ctx, now, newContext, newMutableState interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionWithNewAsActive", reflect.TypeOf((*MockContext)(nil).UpdateWorkflowExecutionWithNewAsActive), ctx, now, newContext, newMutableState) } // UpdateWorkflowExecutionWithNewAsPassive mocks base method. func (m *MockContext) UpdateWorkflowExecutionWithNewAsPassive(ctx context.Context, now time.Time, newContext Context, newMutableState MutableState) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateWorkflowExecutionWithNewAsPassive", ctx, now, newContext, newMutableState) ret0, _ := ret[0].(error) return ret0 } // UpdateWorkflowExecutionWithNewAsPassive indicates an expected call of UpdateWorkflowExecutionWithNewAsPassive. func (mr *MockContextMockRecorder) UpdateWorkflowExecutionWithNewAsPassive(ctx, now, newContext, newMutableState interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionWithNewAsPassive", reflect.TypeOf((*MockContext)(nil).UpdateWorkflowExecutionWithNewAsPassive), ctx, now, newContext, newMutableState) }