Skip to content

Commit

Permalink
test: Fixing compilation issues in Integration Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaland committed Sep 5, 2024
1 parent 0bc1747 commit dc86149
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AuthSignOutTests: AWSAuthBaseTest {
try await super.setUp()
AuthSessionHelper.clearSession()
if Self.setSDKLogLevelDebug {
await SDKLoggingSystem.initialize(logLevel: .debug)
await SDKLoggingSystem().initialize(logLevel: .debug)
Self.setSDKLogLevelDebug = false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@testable import Amplify

import AWSS3StoragePlugin
import ClientRuntime
import SmithyHTTPAPI
import CryptoKit
import XCTest

Expand Down Expand Up @@ -436,7 +436,7 @@ class AWSS3StoragePluginBasicIntegrationTests: AWSS3StoragePluginTestBase {
}

// An SDK call for the ListObjectsV2 call and each deletion is expected
let expectedMethods = [.get] + keys.map {_ in HttpMethodType.delete}
let expectedMethods = [.get] + keys.map {_ in HTTPMethodType.delete}
XCTAssertEqual(requestRecorder.sdkRequests.map { $0.method}, expectedMethods)
try assertUserAgentComponents(sdkRequests: requestRecorder.sdkRequests)

Expand Down Expand Up @@ -527,7 +527,7 @@ class AWSS3StoragePluginBasicIntegrationTests: AWSS3StoragePluginTestBase {
}
}

private func assertUserAgentComponents(sdkRequests: [SdkHttpRequest], file: StaticString = #filePath, line: UInt = #line) throws {
private func assertUserAgentComponents(sdkRequests: [HTTPRequest], file: StaticString = #filePath, line: UInt = #line) throws {
for request in sdkRequests {
let headers = request.headers.dictionary
let userAgent = try XCTUnwrap(headers["User-Agent"]?.joined(separator:","))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import AWSS3StoragePlugin
import ClientRuntime
import AWSClientRuntime
@_spi(UnknownAWSHTTPServiceError) import AWSClientRuntime
import CryptoKit
import XCTest
import AWSS3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import AWSS3StoragePlugin
import ClientRuntime
import AWSClientRuntime
@_spi(UnknownAWSHTTPServiceError) import AWSClientRuntime
import CryptoKit
import XCTest
import AWSS3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@

@testable import AWSS3StoragePlugin

import ClientRuntime
import Foundation
import Smithy
import SmithyHTTPAPI

class AWSS3StoragePluginRequestRecorder {
var target: HTTPClient? = nil
var sdkRequests: [SdkHttpRequest] = []
var sdkRequests: [HTTPRequest] = []
var urlRequests: [URLRequest] = []
init() {
}
}

extension AWSS3StoragePluginRequestRecorder: HttpClientEngineProxy {
func send(request: SdkHttpRequest) async throws -> HttpResponse {
func send(request: HTTPRequest) async throws -> HTTPResponse {
guard let target = target else {
throw ClientError.unknownError("HttpClientEngine is not set")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@testable import Amplify

import AWSS3StoragePlugin
import ClientRuntime
import SmithyHTTPAPI
import CryptoKit
import XCTest

Expand Down Expand Up @@ -179,7 +179,7 @@ class AWSS3StoragePluginUploadIntegrationTests: AWSS3StoragePluginTestBase {
}
}

private func assertUserAgentComponents(sdkRequests: [SdkHttpRequest], file: StaticString = #filePath, line: UInt = #line) throws {
private func assertUserAgentComponents(sdkRequests: [HTTPRequest], file: StaticString = #filePath, line: UInt = #line) throws {
for request in sdkRequests {
let headers = request.headers.dictionary
let userAgent = try XCTUnwrap(headers["User-Agent"]?.joined(separator:","))
Expand Down

0 comments on commit dc86149

Please sign in to comment.