Files
tasks/service/history/interfaces/workflow_context_mock.go
Yichao YangandGitHub 63839f1a9d CHASM: Propagate ArchetypeID (#8693)
## What changed?
- Use archetypeID everywhere in history service and pass them to
persistence

## Why?
- Required for separate ID space work.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2025-11-26 16:04:44 -08:00

331 lines
16 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: workflow_context.go
//
// Generated by this command:
//
// mockgen -package interfaces -source workflow_context.go -destination workflow_context_mock.go
//
// Package interfaces is a generated GoMock package.
package interfaces
import (
context "context"
reflect "reflect"
persistence "go.temporal.io/server/api/persistence/v1"
definition "go.temporal.io/server/common/definition"
locks "go.temporal.io/server/common/locks"
persistence0 "go.temporal.io/server/common/persistence"
update "go.temporal.io/server/service/history/workflow/update"
gomock "go.uber.org/mock/gomock"
)
// MockWorkflowContext is a mock of WorkflowContext interface.
type MockWorkflowContext struct {
ctrl *gomock.Controller
recorder *MockWorkflowContextMockRecorder
isgomock struct{}
}
// MockWorkflowContextMockRecorder is the mock recorder for MockWorkflowContext.
type MockWorkflowContextMockRecorder struct {
mock *MockWorkflowContext
}
// NewMockWorkflowContext creates a new mock instance.
func NewMockWorkflowContext(ctrl *gomock.Controller) *MockWorkflowContext {
mock := &MockWorkflowContext{ctrl: ctrl}
mock.recorder = &MockWorkflowContextMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockWorkflowContext) EXPECT() *MockWorkflowContextMockRecorder {
return m.recorder
}
// Clear mocks base method.
func (m *MockWorkflowContext) Clear() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Clear")
}
// Clear indicates an expected call of Clear.
func (mr *MockWorkflowContextMockRecorder) Clear() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clear", reflect.TypeOf((*MockWorkflowContext)(nil).Clear))
}
// ConflictResolveWorkflowExecution mocks base method.
func (m *MockWorkflowContext) ConflictResolveWorkflowExecution(ctx context.Context, shardContext ShardContext, conflictResolveMode persistence0.ConflictResolveWorkflowMode, resetMutableState MutableState, newContext WorkflowContext, newMutableState MutableState, currentContext WorkflowContext, currentMutableState MutableState, resetWorkflowTransactionPolicy TransactionPolicy, newWorkflowTransactionPolicy, currentTransactionPolicy *TransactionPolicy) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ConflictResolveWorkflowExecution", ctx, shardContext, conflictResolveMode, resetMutableState, newContext, newMutableState, currentContext, currentMutableState, resetWorkflowTransactionPolicy, newWorkflowTransactionPolicy, currentTransactionPolicy)
ret0, _ := ret[0].(error)
return ret0
}
// ConflictResolveWorkflowExecution indicates an expected call of ConflictResolveWorkflowExecution.
func (mr *MockWorkflowContextMockRecorder) ConflictResolveWorkflowExecution(ctx, shardContext, conflictResolveMode, resetMutableState, newContext, newMutableState, currentContext, currentMutableState, resetWorkflowTransactionPolicy, newWorkflowTransactionPolicy, currentTransactionPolicy any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConflictResolveWorkflowExecution", reflect.TypeOf((*MockWorkflowContext)(nil).ConflictResolveWorkflowExecution), ctx, shardContext, conflictResolveMode, resetMutableState, newContext, newMutableState, currentContext, currentMutableState, resetWorkflowTransactionPolicy, newWorkflowTransactionPolicy, currentTransactionPolicy)
}
// CreateWorkflowExecution mocks base method.
func (m *MockWorkflowContext) CreateWorkflowExecution(ctx context.Context, shardContext ShardContext, createMode persistence0.CreateWorkflowMode, prevRunID string, prevLastWriteVersion int64, newMutableState MutableState, newWorkflow *persistence0.WorkflowSnapshot, newWorkflowEvents []*persistence0.WorkflowEvents) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateWorkflowExecution", ctx, shardContext, createMode, prevRunID, prevLastWriteVersion, newMutableState, newWorkflow, newWorkflowEvents)
ret0, _ := ret[0].(error)
return ret0
}
// CreateWorkflowExecution indicates an expected call of CreateWorkflowExecution.
func (mr *MockWorkflowContextMockRecorder) CreateWorkflowExecution(ctx, shardContext, createMode, prevRunID, prevLastWriteVersion, newMutableState, newWorkflow, newWorkflowEvents any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkflowExecution", reflect.TypeOf((*MockWorkflowContext)(nil).CreateWorkflowExecution), ctx, shardContext, createMode, prevRunID, prevLastWriteVersion, newMutableState, newWorkflow, newWorkflowEvents)
}
// GetWorkflowKey mocks base method.
func (m *MockWorkflowContext) GetWorkflowKey() definition.WorkflowKey {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetWorkflowKey")
ret0, _ := ret[0].(definition.WorkflowKey)
return ret0
}
// GetWorkflowKey indicates an expected call of GetWorkflowKey.
func (mr *MockWorkflowContextMockRecorder) GetWorkflowKey() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkflowKey", reflect.TypeOf((*MockWorkflowContext)(nil).GetWorkflowKey))
}
// IsDirty mocks base method.
func (m *MockWorkflowContext) IsDirty() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsDirty")
ret0, _ := ret[0].(bool)
return ret0
}
// IsDirty indicates an expected call of IsDirty.
func (mr *MockWorkflowContextMockRecorder) IsDirty() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDirty", reflect.TypeOf((*MockWorkflowContext)(nil).IsDirty))
}
// LoadExecutionStats mocks base method.
func (m *MockWorkflowContext) LoadExecutionStats(ctx context.Context, shardContext ShardContext) (*persistence.ExecutionStats, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LoadExecutionStats", ctx, shardContext)
ret0, _ := ret[0].(*persistence.ExecutionStats)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LoadExecutionStats indicates an expected call of LoadExecutionStats.
func (mr *MockWorkflowContextMockRecorder) LoadExecutionStats(ctx, shardContext any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadExecutionStats", reflect.TypeOf((*MockWorkflowContext)(nil).LoadExecutionStats), ctx, shardContext)
}
// LoadMutableState mocks base method.
func (m *MockWorkflowContext) LoadMutableState(ctx context.Context, shardContext ShardContext) (MutableState, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LoadMutableState", ctx, shardContext)
ret0, _ := ret[0].(MutableState)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LoadMutableState indicates an expected call of LoadMutableState.
func (mr *MockWorkflowContextMockRecorder) LoadMutableState(ctx, shardContext any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadMutableState", reflect.TypeOf((*MockWorkflowContext)(nil).LoadMutableState), ctx, shardContext)
}
// Lock mocks base method.
func (m *MockWorkflowContext) Lock(ctx context.Context, lockPriority locks.Priority) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Lock", ctx, lockPriority)
ret0, _ := ret[0].(error)
return ret0
}
// Lock indicates an expected call of Lock.
func (mr *MockWorkflowContextMockRecorder) Lock(ctx, lockPriority any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lock", reflect.TypeOf((*MockWorkflowContext)(nil).Lock), ctx, lockPriority)
}
// PersistWorkflowEvents mocks base method.
func (m *MockWorkflowContext) PersistWorkflowEvents(ctx context.Context, shardContext ShardContext, workflowEventsSlice ...*persistence0.WorkflowEvents) (int64, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, shardContext}
for _, a := range workflowEventsSlice {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "PersistWorkflowEvents", varargs...)
ret0, _ := ret[0].(int64)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PersistWorkflowEvents indicates an expected call of PersistWorkflowEvents.
func (mr *MockWorkflowContextMockRecorder) PersistWorkflowEvents(ctx, shardContext any, workflowEventsSlice ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, shardContext}, workflowEventsSlice...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PersistWorkflowEvents", reflect.TypeOf((*MockWorkflowContext)(nil).PersistWorkflowEvents), varargs...)
}
// ReapplyEvents mocks base method.
func (m *MockWorkflowContext) ReapplyEvents(ctx context.Context, shardContext ShardContext, eventBatches []*persistence0.WorkflowEvents) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ReapplyEvents", ctx, shardContext, eventBatches)
ret0, _ := ret[0].(error)
return ret0
}
// ReapplyEvents indicates an expected call of ReapplyEvents.
func (mr *MockWorkflowContextMockRecorder) ReapplyEvents(ctx, shardContext, eventBatches any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReapplyEvents", reflect.TypeOf((*MockWorkflowContext)(nil).ReapplyEvents), ctx, shardContext, eventBatches)
}
// RefreshTasks mocks base method.
func (m *MockWorkflowContext) RefreshTasks(ctx context.Context, shardContext ShardContext) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RefreshTasks", ctx, shardContext)
ret0, _ := ret[0].(error)
return ret0
}
// RefreshTasks indicates an expected call of RefreshTasks.
func (mr *MockWorkflowContextMockRecorder) RefreshTasks(ctx, shardContext any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshTasks", reflect.TypeOf((*MockWorkflowContext)(nil).RefreshTasks), ctx, shardContext)
}
// SetWorkflowExecution mocks base method.
func (m *MockWorkflowContext) SetWorkflowExecution(ctx context.Context, shardContext ShardContext) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetWorkflowExecution", ctx, shardContext)
ret0, _ := ret[0].(error)
return ret0
}
// SetWorkflowExecution indicates an expected call of SetWorkflowExecution.
func (mr *MockWorkflowContextMockRecorder) SetWorkflowExecution(ctx, shardContext any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWorkflowExecution", reflect.TypeOf((*MockWorkflowContext)(nil).SetWorkflowExecution), ctx, shardContext)
}
// SubmitClosedWorkflowSnapshot mocks base method.
func (m *MockWorkflowContext) SubmitClosedWorkflowSnapshot(ctx context.Context, shardContext ShardContext, transactionPolicy TransactionPolicy) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubmitClosedWorkflowSnapshot", ctx, shardContext, transactionPolicy)
ret0, _ := ret[0].(error)
return ret0
}
// SubmitClosedWorkflowSnapshot indicates an expected call of SubmitClosedWorkflowSnapshot.
func (mr *MockWorkflowContextMockRecorder) SubmitClosedWorkflowSnapshot(ctx, shardContext, transactionPolicy any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitClosedWorkflowSnapshot", reflect.TypeOf((*MockWorkflowContext)(nil).SubmitClosedWorkflowSnapshot), ctx, shardContext, transactionPolicy)
}
// Unlock mocks base method.
func (m *MockWorkflowContext) Unlock() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Unlock")
}
// Unlock indicates an expected call of Unlock.
func (mr *MockWorkflowContextMockRecorder) Unlock() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unlock", reflect.TypeOf((*MockWorkflowContext)(nil).Unlock))
}
// UpdateRegistry mocks base method.
func (m *MockWorkflowContext) UpdateRegistry(ctx context.Context) update.Registry {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateRegistry", ctx)
ret0, _ := ret[0].(update.Registry)
return ret0
}
// UpdateRegistry indicates an expected call of UpdateRegistry.
func (mr *MockWorkflowContextMockRecorder) UpdateRegistry(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRegistry", reflect.TypeOf((*MockWorkflowContext)(nil).UpdateRegistry), ctx)
}
// UpdateWorkflowExecutionAsActive mocks base method.
func (m *MockWorkflowContext) UpdateWorkflowExecutionAsActive(ctx context.Context, shardContext ShardContext) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateWorkflowExecutionAsActive", ctx, shardContext)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateWorkflowExecutionAsActive indicates an expected call of UpdateWorkflowExecutionAsActive.
func (mr *MockWorkflowContextMockRecorder) UpdateWorkflowExecutionAsActive(ctx, shardContext any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionAsActive", reflect.TypeOf((*MockWorkflowContext)(nil).UpdateWorkflowExecutionAsActive), ctx, shardContext)
}
// UpdateWorkflowExecutionAsPassive mocks base method.
func (m *MockWorkflowContext) UpdateWorkflowExecutionAsPassive(ctx context.Context, shardContext ShardContext) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateWorkflowExecutionAsPassive", ctx, shardContext)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateWorkflowExecutionAsPassive indicates an expected call of UpdateWorkflowExecutionAsPassive.
func (mr *MockWorkflowContextMockRecorder) UpdateWorkflowExecutionAsPassive(ctx, shardContext any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionAsPassive", reflect.TypeOf((*MockWorkflowContext)(nil).UpdateWorkflowExecutionAsPassive), ctx, shardContext)
}
// UpdateWorkflowExecutionWithNew mocks base method.
func (m *MockWorkflowContext) UpdateWorkflowExecutionWithNew(ctx context.Context, shardContext ShardContext, updateMode persistence0.UpdateWorkflowMode, newContext WorkflowContext, newMutableState MutableState, updateWorkflowTransactionPolicy TransactionPolicy, newWorkflowTransactionPolicy *TransactionPolicy) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateWorkflowExecutionWithNew", ctx, shardContext, updateMode, newContext, newMutableState, updateWorkflowTransactionPolicy, newWorkflowTransactionPolicy)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateWorkflowExecutionWithNew indicates an expected call of UpdateWorkflowExecutionWithNew.
func (mr *MockWorkflowContextMockRecorder) UpdateWorkflowExecutionWithNew(ctx, shardContext, updateMode, newContext, newMutableState, updateWorkflowTransactionPolicy, newWorkflowTransactionPolicy any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionWithNew", reflect.TypeOf((*MockWorkflowContext)(nil).UpdateWorkflowExecutionWithNew), ctx, shardContext, updateMode, newContext, newMutableState, updateWorkflowTransactionPolicy, newWorkflowTransactionPolicy)
}
// UpdateWorkflowExecutionWithNewAsActive mocks base method.
func (m *MockWorkflowContext) UpdateWorkflowExecutionWithNewAsActive(ctx context.Context, shardContext ShardContext, newContext WorkflowContext, newMutableState MutableState) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateWorkflowExecutionWithNewAsActive", ctx, shardContext, newContext, newMutableState)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateWorkflowExecutionWithNewAsActive indicates an expected call of UpdateWorkflowExecutionWithNewAsActive.
func (mr *MockWorkflowContextMockRecorder) UpdateWorkflowExecutionWithNewAsActive(ctx, shardContext, newContext, newMutableState any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionWithNewAsActive", reflect.TypeOf((*MockWorkflowContext)(nil).UpdateWorkflowExecutionWithNewAsActive), ctx, shardContext, newContext, newMutableState)
}
// UpdateWorkflowExecutionWithNewAsPassive mocks base method.
func (m *MockWorkflowContext) UpdateWorkflowExecutionWithNewAsPassive(ctx context.Context, shardContext ShardContext, newContext WorkflowContext, newMutableState MutableState) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateWorkflowExecutionWithNewAsPassive", ctx, shardContext, newContext, newMutableState)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateWorkflowExecutionWithNewAsPassive indicates an expected call of UpdateWorkflowExecutionWithNewAsPassive.
func (mr *MockWorkflowContextMockRecorder) UpdateWorkflowExecutionWithNewAsPassive(ctx, shardContext, newContext, newMutableState any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionWithNewAsPassive", reflect.TypeOf((*MockWorkflowContext)(nil).UpdateWorkflowExecutionWithNewAsPassive), ctx, shardContext, newContext, newMutableState)
}