@@ -494,15 +494,15 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
494494 AmplifyCredentials . testDataWithExpiredTokens) ,
495495 . notStarted)
496496
497- let initAuth : MockIdentityProvider . MockInitiateAuthResponse = { _ in
498- return InitiateAuthOutput ( authenticationResult: . init( accessToken: nil ,
497+ let refreshTokenAuth : MockIdentityProvider . MockGetTokensFromRefreshTokenResponse = { _ in
498+ return GetTokensFromRefreshTokenOutput ( authenticationResult: . init( accessToken: nil ,
499499 expiresIn: 1000 ,
500500 idToken: " idToken " ,
501501 refreshToken: " refreshToke " ) )
502502 }
503503
504504 let plugin = configurePluginWith (
505- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
505+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
506506 initialState: initialState)
507507
508508 let session = try await plugin. fetchAuthSession ( options: AuthFetchSessionRequest . Options ( ) )
@@ -548,8 +548,8 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
548548 AmplifyCredentials . testDataWithExpiredTokens) ,
549549 . notStarted)
550550
551- let initAuth : MockIdentityProvider . MockInitiateAuthResponse = { _ in
552- return InitiateAuthOutput ( authenticationResult: . init( accessToken: " accessToken " ,
551+ let refreshTokenAuth : MockIdentityProvider . MockGetTokensFromRefreshTokenResponse = { _ in
552+ return GetTokensFromRefreshTokenOutput ( authenticationResult: . init( accessToken: " accessToken " ,
553553 expiresIn: 1000 ,
554554 idToken: " idToken " ,
555555 refreshToken: " refreshToke " ) )
@@ -559,7 +559,7 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
559559 return GetCredentialsForIdentityOutput ( credentials: nil , identityId: " ss " )
560560 }
561561 let plugin = configurePluginWith (
562- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
562+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
563563 identityPool: { MockIdentity ( mockGetCredentialsResponse: awsCredentials) } ,
564564 initialState: initialState)
565565
@@ -714,12 +714,12 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
714714 AmplifyCredentials . testDataWithExpiredTokens) ,
715715 . notStarted)
716716
717- let initAuth : MockIdentityProvider . MockInitiateAuthResponse = { _ in
717+ let refreshTokenAuth : MockIdentityProvider . MockGetTokensFromRefreshTokenResponse = { _ in
718718 throw AWSCognitoIdentityProvider . NotAuthorizedException ( message: " NotAuthorized " )
719719 }
720720
721721 let plugin = configurePluginWith (
722- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
722+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
723723 initialState: initialState)
724724
725725 let session = try await plugin. fetchAuthSession ( options: AuthFetchSessionRequest . Options ( ) )
@@ -816,8 +816,8 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
816816 AmplifyCredentials . testDataWithExpiredTokens) ,
817817 . notStarted)
818818
819- let initAuth : MockIdentityProvider . MockInitiateAuthResponse = { _ in
820- return InitiateAuthOutput ( authenticationResult: . init( accessToken: " accessToken " ,
819+ let refreshTokenAuth : MockIdentityProvider . MockGetTokensFromRefreshTokenResponse = { _ in
820+ return GetTokensFromRefreshTokenOutput ( authenticationResult: . init( accessToken: " accessToken " ,
821821 expiresIn: 1000 ,
822822 idToken: " idToken " ,
823823 refreshToken: " refreshToke " ) )
@@ -827,7 +827,7 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
827827 throw NSError ( domain: NSURLErrorDomain, code: 1 , userInfo: nil )
828828 }
829829 let plugin = configurePluginWith (
830- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
830+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
831831 identityPool: { MockIdentity ( mockGetCredentialsResponse: awsCredentials) } ,
832832 initialState: initialState)
833833
0 commit comments