Account URL is now fetched async (#2769)

This commit is contained in:
Mauro
2024-04-30 19:08:32 +02:00
committed by GitHub
parent f688d2eda4
commit 18dc9cd20f
16 changed files with 47 additions and 70 deletions
@@ -2104,14 +2104,14 @@ class ClientProxyMock: ClientProxyProtocol {
}
}
}
var accountURLActionClosure: ((AccountManagementAction) -> URL?)?
var accountURLActionClosure: ((AccountManagementAction) async -> URL?)?
func accountURL(action: AccountManagementAction) -> URL? {
func accountURL(action: AccountManagementAction) async -> URL? {
accountURLActionCallsCount += 1
accountURLActionReceivedAction = action
accountURLActionReceivedInvocations.append(action)
if let accountURLActionClosure = accountURLActionClosure {
return accountURLActionClosure(action)
return await accountURLActionClosure(action)
} else {
return accountURLActionReturnValue
}
@@ -135,9 +135,9 @@ class SDKClientMock: SDKClientProtocol {
}
}
}
public var accountUrlActionClosure: ((AccountManagementAction?) throws -> String?)?
public var accountUrlActionClosure: ((AccountManagementAction?) async throws -> String?)?
public func accountUrl(action: AccountManagementAction?) throws -> String? {
public func accountUrl(action: AccountManagementAction?) async throws -> String? {
if let error = accountUrlActionThrowableError {
throw error
}
@@ -145,7 +145,7 @@ class SDKClientMock: SDKClientProtocol {
accountUrlActionReceivedAction = action
accountUrlActionReceivedInvocations.append(action)
if let accountUrlActionClosure = accountUrlActionClosure {
return try accountUrlActionClosure(action)
return try await accountUrlActionClosure(action)
} else {
return accountUrlActionReturnValue
}