Files
tasks/chasm/tree_mock.go
Yichao YangandGitHub 8ab1511440 CHASM Visibility: Component and task processing (#8080)
## What changed?
- Add CHASM built-in visibility component and task processing logic

## Why?
- Basic chasm visibility work for unblocking Scheduler migration.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [x] added new functional test(s)
2025-07-31 15:18:46 -07:00

269 lines
9.6 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: tree.go
//
// Generated by this command:
//
// mockgen -package chasm -source tree.go -destination tree_mock.go
//
// Package chasm is a generated GoMock package.
package chasm
import (
context "context"
reflect "reflect"
enums "go.temporal.io/api/enums/v1"
enums0 "go.temporal.io/server/api/enums/v1"
persistence "go.temporal.io/server/api/persistence/v1"
definition "go.temporal.io/server/common/definition"
tasks "go.temporal.io/server/service/history/tasks"
gomock "go.uber.org/mock/gomock"
)
// MockNodeBackend is a mock of NodeBackend interface.
type MockNodeBackend struct {
ctrl *gomock.Controller
recorder *MockNodeBackendMockRecorder
isgomock struct{}
}
// MockNodeBackendMockRecorder is the mock recorder for MockNodeBackend.
type MockNodeBackendMockRecorder struct {
mock *MockNodeBackend
}
// NewMockNodeBackend creates a new mock instance.
func NewMockNodeBackend(ctrl *gomock.Controller) *MockNodeBackend {
mock := &MockNodeBackend{ctrl: ctrl}
mock.recorder = &MockNodeBackendMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockNodeBackend) EXPECT() *MockNodeBackendMockRecorder {
return m.recorder
}
// AddTasks mocks base method.
func (m *MockNodeBackend) AddTasks(arg0 ...tasks.Task) {
m.ctrl.T.Helper()
varargs := []any{}
for _, a := range arg0 {
varargs = append(varargs, a)
}
m.ctrl.Call(m, "AddTasks", varargs...)
}
// AddTasks indicates an expected call of AddTasks.
func (mr *MockNodeBackendMockRecorder) AddTasks(arg0 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTasks", reflect.TypeOf((*MockNodeBackend)(nil).AddTasks), arg0...)
}
// CurrentVersionedTransition mocks base method.
func (m *MockNodeBackend) CurrentVersionedTransition() *persistence.VersionedTransition {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CurrentVersionedTransition")
ret0, _ := ret[0].(*persistence.VersionedTransition)
return ret0
}
// CurrentVersionedTransition indicates an expected call of CurrentVersionedTransition.
func (mr *MockNodeBackendMockRecorder) CurrentVersionedTransition() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentVersionedTransition", reflect.TypeOf((*MockNodeBackend)(nil).CurrentVersionedTransition))
}
// GetCurrentVersion mocks base method.
func (m *MockNodeBackend) GetCurrentVersion() int64 {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetCurrentVersion")
ret0, _ := ret[0].(int64)
return ret0
}
// GetCurrentVersion indicates an expected call of GetCurrentVersion.
func (mr *MockNodeBackendMockRecorder) GetCurrentVersion() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentVersion", reflect.TypeOf((*MockNodeBackend)(nil).GetCurrentVersion))
}
// GetExecutionInfo mocks base method.
func (m *MockNodeBackend) GetExecutionInfo() *persistence.WorkflowExecutionInfo {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetExecutionInfo")
ret0, _ := ret[0].(*persistence.WorkflowExecutionInfo)
return ret0
}
// GetExecutionInfo indicates an expected call of GetExecutionInfo.
func (mr *MockNodeBackendMockRecorder) GetExecutionInfo() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExecutionInfo", reflect.TypeOf((*MockNodeBackend)(nil).GetExecutionInfo))
}
// GetExecutionState mocks base method.
func (m *MockNodeBackend) GetExecutionState() *persistence.WorkflowExecutionState {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetExecutionState")
ret0, _ := ret[0].(*persistence.WorkflowExecutionState)
return ret0
}
// GetExecutionState indicates an expected call of GetExecutionState.
func (mr *MockNodeBackendMockRecorder) GetExecutionState() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExecutionState", reflect.TypeOf((*MockNodeBackend)(nil).GetExecutionState))
}
// GetWorkflowKey mocks base method.
func (m *MockNodeBackend) 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 *MockNodeBackendMockRecorder) GetWorkflowKey() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkflowKey", reflect.TypeOf((*MockNodeBackend)(nil).GetWorkflowKey))
}
// NextTransitionCount mocks base method.
func (m *MockNodeBackend) NextTransitionCount() int64 {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NextTransitionCount")
ret0, _ := ret[0].(int64)
return ret0
}
// NextTransitionCount indicates an expected call of NextTransitionCount.
func (mr *MockNodeBackendMockRecorder) NextTransitionCount() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextTransitionCount", reflect.TypeOf((*MockNodeBackend)(nil).NextTransitionCount))
}
// UpdateWorkflowStateStatus mocks base method.
func (m *MockNodeBackend) UpdateWorkflowStateStatus(state enums0.WorkflowExecutionState, status enums.WorkflowExecutionStatus) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateWorkflowStateStatus", state, status)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateWorkflowStateStatus indicates an expected call of UpdateWorkflowStateStatus.
func (mr *MockNodeBackendMockRecorder) UpdateWorkflowStateStatus(state, status any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowStateStatus", reflect.TypeOf((*MockNodeBackend)(nil).UpdateWorkflowStateStatus), state, status)
}
// MockNodePathEncoder is a mock of NodePathEncoder interface.
type MockNodePathEncoder struct {
ctrl *gomock.Controller
recorder *MockNodePathEncoderMockRecorder
isgomock struct{}
}
// MockNodePathEncoderMockRecorder is the mock recorder for MockNodePathEncoder.
type MockNodePathEncoderMockRecorder struct {
mock *MockNodePathEncoder
}
// NewMockNodePathEncoder creates a new mock instance.
func NewMockNodePathEncoder(ctrl *gomock.Controller) *MockNodePathEncoder {
mock := &MockNodePathEncoder{ctrl: ctrl}
mock.recorder = &MockNodePathEncoderMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockNodePathEncoder) EXPECT() *MockNodePathEncoderMockRecorder {
return m.recorder
}
// Decode mocks base method.
func (m *MockNodePathEncoder) Decode(encodedPath string) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Decode", encodedPath)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Decode indicates an expected call of Decode.
func (mr *MockNodePathEncoderMockRecorder) Decode(encodedPath any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Decode", reflect.TypeOf((*MockNodePathEncoder)(nil).Decode), encodedPath)
}
// Encode mocks base method.
func (m *MockNodePathEncoder) Encode(node *Node, path []string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Encode", node, path)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Encode indicates an expected call of Encode.
func (mr *MockNodePathEncoderMockRecorder) Encode(node, path any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Encode", reflect.TypeOf((*MockNodePathEncoder)(nil).Encode), node, path)
}
// MockNodePureTask is a mock of NodePureTask interface.
type MockNodePureTask struct {
ctrl *gomock.Controller
recorder *MockNodePureTaskMockRecorder
isgomock struct{}
}
// MockNodePureTaskMockRecorder is the mock recorder for MockNodePureTask.
type MockNodePureTaskMockRecorder struct {
mock *MockNodePureTask
}
// NewMockNodePureTask creates a new mock instance.
func NewMockNodePureTask(ctrl *gomock.Controller) *MockNodePureTask {
mock := &MockNodePureTask{ctrl: ctrl}
mock.recorder = &MockNodePureTaskMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockNodePureTask) EXPECT() *MockNodePureTaskMockRecorder {
return m.recorder
}
// ExecutePureTask mocks base method.
func (m *MockNodePureTask) ExecutePureTask(baseCtx context.Context, taskAttributes TaskAttributes, taskInstance any) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ExecutePureTask", baseCtx, taskAttributes, taskInstance)
ret0, _ := ret[0].(error)
return ret0
}
// ExecutePureTask indicates an expected call of ExecutePureTask.
func (mr *MockNodePureTaskMockRecorder) ExecutePureTask(baseCtx, taskAttributes, taskInstance any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecutePureTask", reflect.TypeOf((*MockNodePureTask)(nil).ExecutePureTask), baseCtx, taskAttributes, taskInstance)
}
// ValidatePureTask mocks base method.
func (m *MockNodePureTask) ValidatePureTask(baseCtx context.Context, taskAttributes TaskAttributes, taskInstance any) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ValidatePureTask", baseCtx, taskAttributes, taskInstance)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatePureTask indicates an expected call of ValidatePureTask.
func (mr *MockNodePureTaskMockRecorder) ValidatePureTask(baseCtx, taskAttributes, taskInstance any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePureTask", reflect.TypeOf((*MockNodePureTask)(nil).ValidatePureTask), baseCtx, taskAttributes, taskInstance)
}