@@ -38,36 +38,6 @@ func (t *testHistoryProvider) GetWorkflowInstanceHistory(ctx context.Context, in
38
38
return t .history , nil
39
39
}
40
40
41
- type WorkflowTester [TResult any ] interface {
42
- // Now returns the current time of the simulated clock in the tester
43
- Now () time.Time
44
-
45
- Execute (args ... interface {})
46
-
47
- Registry () * workflow.Registry
48
-
49
- OnActivity (activity interface {}, args ... interface {}) * mock.Call
50
-
51
- OnSubWorkflow (workflow interface {}, args ... interface {}) * mock.Call
52
-
53
- SignalWorkflow (signalName string , value interface {})
54
-
55
- SignalWorkflowInstance (wfi * core.WorkflowInstance , signalName string , value interface {}) error
56
-
57
- WorkflowFinished () bool
58
-
59
- WorkflowResult () (TResult , string )
60
-
61
- // AssertExpectations asserts any assertions set up for mock activities and sub-workflow
62
- AssertExpectations (t * testing.T )
63
-
64
- // ScheduleCallback schedules the given callback after the given delay in workflow time (not wall clock).
65
- ScheduleCallback (delay time.Duration , callback func ())
66
-
67
- // ListenSubWorkflow registers a handler to be called when a sub-workflow is started.
68
- ListenSubWorkflow (listener func (instance * core.WorkflowInstance , name string ))
69
- }
70
-
71
41
type testTimer struct {
72
42
// Instance is the workflow instance this timer is for
73
43
Instance * core.WorkflowInstance
@@ -161,7 +131,7 @@ func WithTestTimeout(timeout time.Duration) WorkflowTesterOption {
161
131
}
162
132
}
163
133
164
- func NewWorkflowTester [TResult any ](wf interface {}, opts ... WorkflowTesterOption ) WorkflowTester [TResult ] {
134
+ func NewWorkflowTester [TResult any ](wf interface {}, opts ... WorkflowTesterOption ) * workflowTester [TResult ] {
165
135
if err := margs.ReturnTypeMatch [TResult ](wf ); err != nil {
166
136
panic (fmt .Sprintf ("workflow return type does not match: %s" , err ))
167
137
}
0 commit comments