diff --git a/GoogleSignIn/Tests/Unit/GIDSignInTest.m b/GoogleSignIn/Tests/Unit/GIDSignInTest.m index acc147e1..3acf91fc 100644 --- a/GoogleSignIn/Tests/Unit/GIDSignInTest.m +++ b/GoogleSignIn/Tests/Unit/GIDSignInTest.m @@ -321,18 +321,20 @@ - (void)setUp { }); _user = OCMStrictClassMock([GIDGoogleUser class]); _oidAuthorizationService = OCMStrictClassMock([OIDAuthorizationService class]); - OCMStub([_oidAuthorizationService + // AppAuth 3.1.0 has instance methods with these selectors. Without ClassMethod(), OCMock + // stubs the instance methods, and these stubs never run. + OCMStub(ClassMethod([_oidAuthorizationService presentAuthorizationRequest:SAVE_TO_ARG_BLOCK(self->_savedAuthorizationRequest) #if TARGET_OS_IOS || TARGET_OS_MACCATALYST presentingViewController:SAVE_TO_ARG_BLOCK(self->_savedPresentingViewController) #elif TARGET_OS_OSX presentingWindow:SAVE_TO_ARG_BLOCK(self->_savedPresentingWindow) #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST - callback:COPY_TO_ARG_BLOCK(self->_savedAuthorizationCallback)]); - OCMStub([self->_oidAuthorizationService + callback:COPY_TO_ARG_BLOCK(self->_savedAuthorizationCallback)])); + OCMStub(ClassMethod([self->_oidAuthorizationService performTokenRequest:SAVE_TO_ARG_BLOCK(self->_savedTokenRequest) originalAuthorizationResponse:[OCMArg any] - callback:COPY_TO_ARG_BLOCK(self->_savedTokenCallback)]); + callback:COPY_TO_ARG_BLOCK(self->_savedTokenCallback)])); // Fakes _authStateMigrationService = [[GIDFakeAuthStateMigration alloc] init];