Files
tasks/chasm/engine_mock.go
cb63a7a3d0 CHASM engine to pass back created flag on NewExecution (#8873)
## What changed?
Added a return flag on the NewExecution function to indicate if a new
execution was actually created. Also added docs to NewExecution. Changed
standalone activity on start to pass back started flag if new exec was
actually created.

## Why?
On NewExecution today if we use BusinessIDConflictPolicyUseExisting, we
need a way to distinguish whether something is newly created or not.
Based on that flag, caller code can react differently.
For standalone activity, we must pass back the started flag according to
whether a new exec was actually started, to matching existing workflow
behavior.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [X] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

---------

Co-authored-by: Yichao Yang <[email protected]>
2026-01-02 18:14:54 -08:00

154 lines
5.6 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: engine.go
//
// Generated by this command:
//
// mockgen -package chasm -source engine.go -destination engine_mock.go
//
// Package chasm is a generated GoMock package.
package chasm
import (
context "context"
reflect "reflect"
gomock "go.uber.org/mock/gomock"
)
// MockEngine is a mock of Engine interface.
type MockEngine struct {
ctrl *gomock.Controller
recorder *MockEngineMockRecorder
isgomock struct{}
}
// MockEngineMockRecorder is the mock recorder for MockEngine.
type MockEngineMockRecorder struct {
mock *MockEngine
}
// NewMockEngine creates a new mock instance.
func NewMockEngine(ctrl *gomock.Controller) *MockEngine {
mock := &MockEngine{ctrl: ctrl}
mock.recorder = &MockEngineMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockEngine) EXPECT() *MockEngineMockRecorder {
return m.recorder
}
// NewExecution mocks base method.
func (m *MockEngine) NewExecution(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext) (Component, error), arg3 ...TransitionOption) (EngineNewExecutionResult, error) {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1, arg2}
for _, a := range arg3 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "NewExecution", varargs...)
ret0, _ := ret[0].(EngineNewExecutionResult)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NewExecution indicates an expected call of NewExecution.
func (mr *MockEngineMockRecorder) NewExecution(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1, arg2}, arg3...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewExecution", reflect.TypeOf((*MockEngine)(nil).NewExecution), varargs...)
}
// NotifyExecution mocks base method.
func (m *MockEngine) NotifyExecution(arg0 ExecutionKey) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "NotifyExecution", arg0)
}
// NotifyExecution indicates an expected call of NotifyExecution.
func (mr *MockEngineMockRecorder) NotifyExecution(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyExecution", reflect.TypeOf((*MockEngine)(nil).NotifyExecution), arg0)
}
// PollComponent mocks base method.
func (m *MockEngine) PollComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(Context, Component) (bool, error), arg3 ...TransitionOption) ([]byte, error) {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1, arg2}
for _, a := range arg3 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "PollComponent", varargs...)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PollComponent indicates an expected call of PollComponent.
func (mr *MockEngineMockRecorder) PollComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1, arg2}, arg3...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PollComponent", reflect.TypeOf((*MockEngine)(nil).PollComponent), varargs...)
}
// ReadComponent mocks base method.
func (m *MockEngine) ReadComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(Context, Component) error, arg3 ...TransitionOption) error {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1, arg2}
for _, a := range arg3 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ReadComponent", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// ReadComponent indicates an expected call of ReadComponent.
func (mr *MockEngineMockRecorder) ReadComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1, arg2}, arg3...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadComponent", reflect.TypeOf((*MockEngine)(nil).ReadComponent), varargs...)
}
// UpdateComponent mocks base method.
func (m *MockEngine) UpdateComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext, Component) error, arg3 ...TransitionOption) ([]byte, error) {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1, arg2}
for _, a := range arg3 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateComponent", varargs...)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateComponent indicates an expected call of UpdateComponent.
func (mr *MockEngineMockRecorder) UpdateComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1, arg2}, arg3...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateComponent", reflect.TypeOf((*MockEngine)(nil).UpdateComponent), varargs...)
}
// UpdateWithNewExecution mocks base method.
func (m *MockEngine) UpdateWithNewExecution(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext) (Component, error), arg3 func(MutableContext, Component) error, arg4 ...TransitionOption) (ExecutionKey, []byte, error) {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1, arg2, arg3}
for _, a := range arg4 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateWithNewExecution", varargs...)
ret0, _ := ret[0].(ExecutionKey)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}
// UpdateWithNewExecution indicates an expected call of UpdateWithNewExecution.
func (mr *MockEngineMockRecorder) UpdateWithNewExecution(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1, arg2, arg3}, arg4...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWithNewExecution", reflect.TypeOf((*MockEngine)(nil).UpdateWithNewExecution), varargs...)
}