Files
tasks/chasm/context_mock.go
Lina JodoinandGitHub 462df4db5b [CHASM] Support for deferred pointer resolution (#8139)
## What changed?
- Previously when creating pointers within a CHASM tree, the pointed-to
component had to already exist within the tree, as the pointer was
resolved immediately. This was cumbersome in some common cases like
setting up an initial tree of CHASM components (such as setting up a
scheduler tree), where ideally, all components would be created and
linked up within the first transaction.
- A new field type, `fieldTypeDeferredPointer`, has been introduced.
This field stores the pointer value directly, and resolves the value to
the path of the component within the tree during `CloseTransaction` (or
fails if the pointer is dangling).

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2025-08-06 23:25:49 +00:00

165 lines
4.9 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: context.go
//
// Generated by this command:
//
// mockgen -package chasm -source context.go -destination context_mock.go
//
// Package chasm is a generated GoMock package.
package chasm
import (
context "context"
reflect "reflect"
time "time"
gomock "go.uber.org/mock/gomock"
)
// MockContext is a mock of Context interface.
type MockContext struct {
ctrl *gomock.Controller
recorder *MockContextMockRecorder
isgomock struct{}
}
// 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
}
// Now mocks base method.
func (m *MockContext) Now(arg0 Component) time.Time {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Now", arg0)
ret0, _ := ret[0].(time.Time)
return ret0
}
// Now indicates an expected call of Now.
func (mr *MockContextMockRecorder) Now(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Now", reflect.TypeOf((*MockContext)(nil).Now), arg0)
}
// Ref mocks base method.
func (m *MockContext) Ref(arg0 Component) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Ref", arg0)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Ref indicates an expected call of Ref.
func (mr *MockContextMockRecorder) Ref(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ref", reflect.TypeOf((*MockContext)(nil).Ref), arg0)
}
// getContext mocks base method.
func (m *MockContext) getContext() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "getContext")
ret0, _ := ret[0].(context.Context)
return ret0
}
// getContext indicates an expected call of getContext.
func (mr *MockContextMockRecorder) getContext() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getContext", reflect.TypeOf((*MockContext)(nil).getContext))
}
// MockMutableContext is a mock of MutableContext interface.
type MockMutableContext struct {
ctrl *gomock.Controller
recorder *MockMutableContextMockRecorder
isgomock struct{}
}
// MockMutableContextMockRecorder is the mock recorder for MockMutableContext.
type MockMutableContextMockRecorder struct {
mock *MockMutableContext
}
// NewMockMutableContext creates a new mock instance.
func NewMockMutableContext(ctrl *gomock.Controller) *MockMutableContext {
mock := &MockMutableContext{ctrl: ctrl}
mock.recorder = &MockMutableContextMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockMutableContext) EXPECT() *MockMutableContextMockRecorder {
return m.recorder
}
// AddTask mocks base method.
func (m *MockMutableContext) AddTask(arg0 Component, arg1 TaskAttributes, arg2 any) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "AddTask", arg0, arg1, arg2)
}
// AddTask indicates an expected call of AddTask.
func (mr *MockMutableContextMockRecorder) AddTask(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTask", reflect.TypeOf((*MockMutableContext)(nil).AddTask), arg0, arg1, arg2)
}
// Now mocks base method.
func (m *MockMutableContext) Now(arg0 Component) time.Time {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Now", arg0)
ret0, _ := ret[0].(time.Time)
return ret0
}
// Now indicates an expected call of Now.
func (mr *MockMutableContextMockRecorder) Now(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Now", reflect.TypeOf((*MockMutableContext)(nil).Now), arg0)
}
// Ref mocks base method.
func (m *MockMutableContext) Ref(arg0 Component) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Ref", arg0)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Ref indicates an expected call of Ref.
func (mr *MockMutableContextMockRecorder) Ref(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ref", reflect.TypeOf((*MockMutableContext)(nil).Ref), arg0)
}
// getContext mocks base method.
func (m *MockMutableContext) getContext() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "getContext")
ret0, _ := ret[0].(context.Context)
return ret0
}
// getContext indicates an expected call of getContext.
func (mr *MockMutableContextMockRecorder) getContext() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getContext", reflect.TypeOf((*MockMutableContext)(nil).getContext))
}