@@ -75,25 +75,19 @@ func Test_TimerStateMachine_CompletedAfterCancel(t *testing.T) {
7575 h := newDecisionsHelper ()
7676 d := h .startTimer (attributes )
7777 require .Equal (t , decisionStateCreated , d .getState ())
78-
7978 decisions := h .getDecisions (true )
8079 require .Equal (t , decisionStateDecisionSent , d .getState ())
8180 require .Equal (t , 1 , len (decisions ))
8281 require .Equal (t , s .DecisionTypeStartTimer , decisions [0 ].GetDecisionType ())
83-
8482 h .cancelTimer (timerID )
8583 require .Equal (t , decisionStateCanceledBeforeInitiated , d .getState ())
86- decisions = h .getDecisions (false )
87- require .Equal (t , 1 , len (decisions ))
88- require .Equal (t , s .DecisionTypeCancelTimer , decisions [0 ].GetDecisionType ())
89-
84+ require .Equal (t , 0 , len (h .getDecisions (true )))
9085 h .handleTimerStarted (timerID )
9186 require .Equal (t , decisionStateCanceledAfterInitiated , d .getState ())
9287 decisions = h .getDecisions (true )
9388 require .Equal (t , 1 , len (decisions ))
9489 require .Equal (t , s .DecisionTypeCancelTimer , decisions [0 ].GetDecisionType ())
9590 require .Equal (t , decisionStateCancellationDecisionSent , d .getState ())
96-
9791 h .handleTimerClosed (timerID )
9892 require .Equal (t , decisionStateCompletedAfterCancellationDecisionSent , d .getState ())
9993}
@@ -222,9 +216,7 @@ func Test_ActivityStateMachine_CancelAfterSent(t *testing.T) {
222216 // cancel activity
223217 h .requestCancelActivityTask (activityID )
224218 require .Equal (t , decisionStateCanceledBeforeInitiated , d .getState ())
225- decisions = h .getDecisions (false )
226- require .Equal (t , 1 , len (decisions ))
227- require .Equal (t , s .DecisionTypeRequestCancelActivityTask , decisions [0 ].GetDecisionType ())
219+ require .Equal (t , 0 , len (h .getDecisions (true )))
228220
229221 // activity scheduled
230222 h .handleActivityTaskScheduled (1 , activityID )
@@ -256,9 +248,7 @@ func Test_ActivityStateMachine_CompletedAfterCancel(t *testing.T) {
256248 // cancel activity
257249 h .requestCancelActivityTask (activityID )
258250 require .Equal (t , decisionStateCanceledBeforeInitiated , d .getState ())
259- decisions = h .getDecisions (false )
260- require .Equal (t , 1 , len (decisions ))
261- require .Equal (t , s .DecisionTypeRequestCancelActivityTask , decisions [0 ].GetDecisionType ())
251+ require .Equal (t , 0 , len (h .getDecisions (true )))
262252
263253 // activity scheduled
264254 h .handleActivityTaskScheduled (1 , activityID )
0 commit comments