diff --git a/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockEndpointClient.swift b/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockEndpointClient.swift index bac6c68b15..4af9110ff9 100644 --- a/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockEndpointClient.swift +++ b/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockEndpointClient.swift @@ -13,7 +13,7 @@ import Foundation actor MockEndpointClient: EndpointClientBehaviour { let pinpointClient: PinpointClientProtocol = MockPinpointClient() - class MockCredentialsProvider: CredentialsProvider { + class MockCredentialsProvider: CredentialsProviding { func getCredentials() async throws -> AWSCredentials { return AWSCredentials(accessKey: "", secret: "", expirationTimeout: Date().addingTimeInterval(1000)) } diff --git a/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockPinpointClient.swift b/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockPinpointClient.swift index 605c4031b8..9abb1ccb88 100644 --- a/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockPinpointClient.swift +++ b/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/Mocks/MockPinpointClient.swift @@ -9,6 +9,18 @@ import AWSPinpoint import Foundation class MockPinpointClient: PinpointClientProtocol { + func getJourneyRunExecutionActivityMetrics(input: GetJourneyRunExecutionActivityMetricsInput) async throws -> GetJourneyRunExecutionActivityMetricsOutputResponse { + fatalError("Not supported") + } + + func getJourneyRunExecutionMetrics(input: GetJourneyRunExecutionMetricsInput) async throws -> GetJourneyRunExecutionMetricsOutputResponse { + fatalError("Not supported") + } + + func getJourneyRuns(input: GetJourneyRunsInput) async throws -> GetJourneyRunsOutputResponse { + fatalError("Not supported") + } + func createApp(input: CreateAppInput) async throws -> CreateAppOutputResponse { fatalError("Not supported") } diff --git a/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/PinpointRequestsRegistryTests.swift b/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/PinpointRequestsRegistryTests.swift index 9a7bd28978..d028cf9dff 100644 --- a/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/PinpointRequestsRegistryTests.swift +++ b/AmplifyPlugins/Internal/Tests/InternalAWSPinpointUnitTests/PinpointRequestsRegistryTests.swift @@ -72,13 +72,14 @@ class PinpointRequestsRegistryTests: XCTestCase { private func createSdkRequest(for api: PinpointRequestsRegistry.API?) throws -> SdkHttpRequest { let apiPath = api?.rawValue ?? "otherApi" - let endpoint = try Endpoint(urlString: "https://host:42/path/\(apiPath)/suffix") - let headers = [ - "User-Agent": "mocked_user_agent" - ] - return SdkHttpRequest(method: .put, - endpoint: endpoint, - headers: .init(headers)) + let endpoint = try Endpoint( + urlString: "https://host:42/path/\(apiPath)/suffix", + headers: .init(["User-Agent": "mocked_user_agent"]) + ) + return SdkHttpRequest( + method: .put, + endpoint: endpoint + ) } } @@ -88,35 +89,6 @@ private extension HttpClientEngine { } } -private class MockSDKRuntimeConfiguration: SDKRuntimeConfiguration { - var encoder: ClientRuntime.RequestEncoder? - var decoder: ClientRuntime.ResponseDecoder? - var httpClientConfiguration: ClientRuntime.HttpClientConfiguration - var idempotencyTokenGenerator: ClientRuntime.IdempotencyTokenGenerator - var clientLogMode: ClientRuntime.ClientLogMode - var partitionID: String? - - let logger: LogAgent - let retryer: SDKRetryer - var endpoint: String? = nil - private let mockedHttpClientEngine : HttpClientEngine - - init(httpClientEngine: HttpClientEngine) throws { - let defaultSDKRuntimeConfig = try DefaultSDKRuntimeConfiguration("MockSDKRuntimeConfiguration") - httpClientConfiguration = defaultSDKRuntimeConfig.httpClientConfiguration - idempotencyTokenGenerator = defaultSDKRuntimeConfig.idempotencyTokenGenerator - clientLogMode = defaultSDKRuntimeConfig.clientLogMode - - logger = MockLogAgent() - retryer = try SDKRetryer(options: RetryOptions(jitterMode: .default)) - mockedHttpClientEngine = httpClientEngine - } - - var httpClientEngine: HttpClientEngine { - mockedHttpClientEngine - } -} - private class MockHttpClientEngine: HttpClientEngine { var executeCount = 0 func execute(request: SdkHttpRequest) async throws -> HttpResponse {