@@ -235,7 +235,8 @@ func (s *activityTestSuite) TestGetWorkerStopChannel() {
235235 s .NotNil (channel )
236236}
237237
238- func (s * activityTestSuite ) TestWithActivityTask () {
238+ // TestWithActivityTask_EmptyTask empty task should NEVER be passsed this stage. But still adding a test to avoid panics.
239+ func (s * activityTestSuite ) TestWithActivityTask_EmptyTask () {
239240 ctx , cancel := context .WithCancel (context .Background ())
240241 invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 5 , make (chan struct {}), FeatureFlags {}, s .logger , testWorkflowType , testActivityType )
241242 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {serviceInvoker : invoker })
@@ -245,12 +246,5 @@ func (s *activityTestSuite) TestWithActivityTask() {
245246 newCtx := WithActivityTask (ctx , emptyTask , "task-list" , invoker , s .logger , nil , nil , nil , nil , mocktracer .New ())
246247
247248 // assertion
248- activityEnv := newCtx .Value (activityEnvContextKey ).(* activityEnvironment )
249- s .Equal (testActivityType , activityEnv .activityType .Name )
250- s .Equal (testWorkflowType , activityEnv .workflowType .Name )
251- s .Equal ("task-list" , activityEnv .taskList )
252- s .Equal (invoker , activityEnv .serviceInvoker )
253- s .Equal (s .logger , activityEnv .logger )
254- s .Equal (nil , activityEnv .metricsScope )
255- s .Equal (nil , activityEnv .dataConverter )
249+ s .NotNil (newCtx )
256250}
0 commit comments