@@ -494,15 +494,15 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
494
494
AmplifyCredentials . testDataWithExpiredTokens) ,
495
495
. notStarted)
496
496
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 ,
499
499
expiresIn: 1000 ,
500
500
idToken: " idToken " ,
501
501
refreshToken: " refreshToke " ) )
502
502
}
503
503
504
504
let plugin = configurePluginWith (
505
- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
505
+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
506
506
initialState: initialState)
507
507
508
508
let session = try await plugin. fetchAuthSession ( options: AuthFetchSessionRequest . Options ( ) )
@@ -548,8 +548,8 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
548
548
AmplifyCredentials . testDataWithExpiredTokens) ,
549
549
. notStarted)
550
550
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 " ,
553
553
expiresIn: 1000 ,
554
554
idToken: " idToken " ,
555
555
refreshToken: " refreshToke " ) )
@@ -559,7 +559,7 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
559
559
return GetCredentialsForIdentityOutput ( credentials: nil , identityId: " ss " )
560
560
}
561
561
let plugin = configurePluginWith (
562
- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
562
+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
563
563
identityPool: { MockIdentity ( mockGetCredentialsResponse: awsCredentials) } ,
564
564
initialState: initialState)
565
565
@@ -714,12 +714,12 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
714
714
AmplifyCredentials . testDataWithExpiredTokens) ,
715
715
. notStarted)
716
716
717
- let initAuth : MockIdentityProvider . MockInitiateAuthResponse = { _ in
717
+ let refreshTokenAuth : MockIdentityProvider . MockGetTokensFromRefreshTokenResponse = { _ in
718
718
throw AWSCognitoIdentityProvider . NotAuthorizedException ( message: " NotAuthorized " )
719
719
}
720
720
721
721
let plugin = configurePluginWith (
722
- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
722
+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
723
723
initialState: initialState)
724
724
725
725
let session = try await plugin. fetchAuthSession ( options: AuthFetchSessionRequest . Options ( ) )
@@ -816,8 +816,8 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
816
816
AmplifyCredentials . testDataWithExpiredTokens) ,
817
817
. notStarted)
818
818
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 " ,
821
821
expiresIn: 1000 ,
822
822
idToken: " idToken " ,
823
823
refreshToken: " refreshToke " ) )
@@ -827,7 +827,7 @@ class AWSAuthFetchSignInSessionOperationTests: BaseAuthorizationTests {
827
827
throw NSError ( domain: NSURLErrorDomain, code: 1 , userInfo: nil )
828
828
}
829
829
let plugin = configurePluginWith (
830
- userPool: { MockIdentityProvider ( mockInitiateAuthResponse : initAuth ) } ,
830
+ userPool: { MockIdentityProvider ( mockGetTokensFromRefreshTokenResponse : refreshTokenAuth ) } ,
831
831
identityPool: { MockIdentity ( mockGetCredentialsResponse: awsCredentials) } ,
832
832
initialState: initialState)
833
833
0 commit comments