@@ -1156,7 +1156,7 @@ func TestEntraidTokenManager_Streaming(t *testing.T) {
11561156 On ("OnNext" , mock .AnythingOfType ("*token.Token" )).
11571157 Run (func (_ mock.Arguments ) {
11581158 start = time .Now ()
1159- }).Return ()
1159+ }).Return (). Maybe ()
11601160 maxAttemptsReached := make (chan struct {})
11611161 listener .On ("OnError" , mock .Anything ).Run (func (args mock.Arguments ) {
11621162 err := args .Get (0 ).(error )
@@ -1195,8 +1195,6 @@ func TestEntraidTokenManager_Streaming(t *testing.T) {
11951195 assert .InEpsilon (t , elapsed , allDelaysShouldBe , float64 (10 * time .Millisecond ))
11961196
11971197 idp .AssertNumberOfCalls (t , "RequestToken" , tm .retryOptions .MaxAttempts + 1 )
1198- listener .AssertNumberOfCalls (t , "OnNext" , 1 )
1199- listener .AssertNumberOfCalls (t , "OnError" , 1 )
12001198 mock .AssertExpectationsForObjects (t , idp , listener )
12011199 })
12021200 t .Run ("Start and Listen and close during retries" , func (t * testing.T ) {
@@ -1232,7 +1230,6 @@ func TestEntraidTokenManager_Streaming(t *testing.T) {
12321230 idpResponse .AuthResultVal = res
12331231 }).Return (idpResponse , nil )
12341232
1235- listener .On ("OnNext" , mock .AnythingOfType ("*token.Token" )).Return ()
12361233 maxAttemptsReached := make (chan struct {})
12371234 listener .On ("OnError" , mock .Anything ).Run (func (args mock.Arguments ) {
12381235 err := args .Get (0 ).(error )
@@ -1268,7 +1265,6 @@ func TestEntraidTokenManager_Streaming(t *testing.T) {
12681265
12691266 // maxAttempts + the initial one
12701267 idp .AssertNumberOfCalls (t , "RequestToken" , 2 )
1271- listener .AssertNumberOfCalls (t , "OnError" , 0 )
12721268 mock .AssertExpectationsForObjects (t , idp , listener )
12731269 })
12741270}
0 commit comments