@@ -132,9 +132,10 @@ func (s *internalWorkerTestSuite) TearDownTest() {
132
132
s .mockCtrl .Finish () // assert mock’s expectations
133
133
}
134
134
135
- func (s * internalWorkerTestSuite ) createLocalActivityMarkerDataForTest (activityID string ) []byte {
135
+ func (s * internalWorkerTestSuite ) createLocalActivityMarkerDataForTest (activityID , activityType string ) []byte {
136
136
lamd := localActivityMarkerData {
137
137
ActivityID : activityID ,
138
+ ActivityType : activityType ,
138
139
ReplayTime : time .Now (),
139
140
}
140
141
@@ -271,7 +272,7 @@ func (s *internalWorkerTestSuite) TestReplayWorkflowHistory_LocalActivity() {
271
272
272
273
createTestEventLocalActivity (5 , & shared.MarkerRecordedEventAttributes {
273
274
MarkerName : common .StringPtr (localActivityMarkerName ),
274
- Details : s .createLocalActivityMarkerDataForTest ("0" ),
275
+ Details : s .createLocalActivityMarkerDataForTest ("0" , "go.uber.org/cadence/internal.testActivity" ),
275
276
DecisionTaskCompletedEventId : common .Int64Ptr (4 ),
276
277
}),
277
278
@@ -282,8 +283,7 @@ func (s *internalWorkerTestSuite) TestReplayWorkflowHistory_LocalActivity() {
282
283
283
284
history := & shared.History {Events : testEvents }
284
285
logger := getLogger ()
285
- replayer := NewWorkflowReplayer ()
286
- replayer .RegisterWorkflow (testReplayWorkflowLocalActivity )
286
+ replayer := & WorkflowReplayer {registry : s .registry }
287
287
err := replayer .ReplayWorkflowHistory (logger , history )
288
288
require .NoError (s .T (), err )
289
289
}
@@ -302,7 +302,7 @@ func (s *internalWorkerTestSuite) TestReplayWorkflowHistory_LocalActivity_Result
302
302
303
303
createTestEventLocalActivity (5 , & shared.MarkerRecordedEventAttributes {
304
304
MarkerName : common .StringPtr (localActivityMarkerName ),
305
- Details : s .createLocalActivityMarkerDataForTest ("0" ),
305
+ Details : s .createLocalActivityMarkerDataForTest ("0" , "" ),
306
306
DecisionTaskCompletedEventId : common .Int64Ptr (4 ),
307
307
}),
308
308
@@ -314,8 +314,7 @@ func (s *internalWorkerTestSuite) TestReplayWorkflowHistory_LocalActivity_Result
314
314
315
315
history := & shared.History {Events : testEvents }
316
316
logger := getLogger ()
317
- replayer := NewWorkflowReplayer ()
318
- replayer .RegisterWorkflow (testReplayWorkflow )
317
+ replayer := & WorkflowReplayer {registry : s .registry }
319
318
err := replayer .ReplayWorkflowHistory (logger , history )
320
319
require .Error (s .T (), err )
321
320
}
@@ -324,7 +323,7 @@ func (s *internalWorkerTestSuite) TestReplayWorkflowHistory_LocalActivity_Activi
324
323
taskList := "taskList1"
325
324
testEvents := []* shared.HistoryEvent {
326
325
createTestEventWorkflowExecutionStarted (1 , & shared.WorkflowExecutionStartedEventAttributes {
327
- WorkflowType : & shared.WorkflowType {Name : common .StringPtr ("go.uber.org/cadence/internal.testReplayWorkflow " )},
326
+ WorkflowType : & shared.WorkflowType {Name : common .StringPtr ("go.uber.org/cadence/internal.testReplayWorkflowLocalActivity " )},
328
327
TaskList : & shared.TaskList {Name : common .StringPtr (taskList )},
329
328
Input : testEncodeFunctionArgs (getDefaultDataConverter ()),
330
329
}),
@@ -334,20 +333,18 @@ func (s *internalWorkerTestSuite) TestReplayWorkflowHistory_LocalActivity_Activi
334
333
335
334
createTestEventLocalActivity (5 , & shared.MarkerRecordedEventAttributes {
336
335
MarkerName : common .StringPtr (localActivityMarkerName ),
337
- Details : s .createLocalActivityMarkerDataForTest ("0" ),
336
+ Details : s .createLocalActivityMarkerDataForTest ("0" , "different-activity-type" ),
338
337
DecisionTaskCompletedEventId : common .Int64Ptr (4 ),
339
338
}),
340
339
341
340
createTestEventWorkflowExecutionCompleted (6 , & shared.WorkflowExecutionCompletedEventAttributes {
342
- Result : []byte ("some-incorrect-result" ),
343
341
DecisionTaskCompletedEventId : common .Int64Ptr (4 ),
344
342
}),
345
343
}
346
344
347
345
history := & shared.History {Events : testEvents }
348
346
logger := getLogger ()
349
- replayer := NewWorkflowReplayer ()
350
- replayer .RegisterWorkflow (testReplayWorkflow )
347
+ replayer := & WorkflowReplayer {registry : s .registry }
351
348
err := replayer .ReplayWorkflowHistory (logger , history )
352
349
require .Error (s .T (), err )
353
350
}
0 commit comments