File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ type WorkflowTester[TResult any] interface {
85
85
// Registry returns the registry used by the tester.
86
86
Registry () * registry.Registry
87
87
88
+ // ActivityMock returns the mock instance that's used for activities. In most cases, OnActivity or OnActivityByName
89
+ // should be used, but sometimes it's necessary to access the mock directly. For instance, to ensure
90
+ // a certain activity is not called at all
91
+ ActivityMock () * mock.Mock
92
+
88
93
// OnActivity registers a mock activity.
89
94
OnActivity (activity workflow.Activity , args ... interface {}) * mock.Call
90
95
@@ -268,6 +273,11 @@ func (wt *workflowTester[TResult]) ListenSubWorkflow(listener func(*core.Workflo
268
273
wt .subWorkflowListener = listener
269
274
}
270
275
276
+ // ActivityMock returns the mock for activities.
277
+ func (wt * workflowTester [TResult ]) ActivityMock () * mock.Mock {
278
+ return wt .ma
279
+ }
280
+
271
281
// OnActivityByName registers a mock activity with the given name.
272
282
func (wt * workflowTester [TResult ]) OnActivityByName (name string , activity workflow.Activity , args ... any ) * mock.Call {
273
283
// Register activity so that we can correctly identify its arguments later
You can’t perform that action at this time.
0 commit comments