From 937de0c9c0f189d82020762dd42788c6b061d9bb Mon Sep 17 00:00:00 2001 From: Ian Saultz <52051793+atierian@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:29:09 -0400 Subject: [PATCH] fix(storage-test): use identity comparison operators not XCTest methods (#3278) --- .../S3ClientConfigurationProxyTests.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Configuration/S3ClientConfigurationProxyTests.swift b/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Configuration/S3ClientConfigurationProxyTests.swift index 7830779aec..77d1ec3b3d 100644 --- a/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Configuration/S3ClientConfigurationProxyTests.swift +++ b/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Configuration/S3ClientConfigurationProxyTests.swift @@ -19,9 +19,7 @@ final class S3ClientConfigurationAccelerateTestCase: XCTestCase { /// When: An override is set through `withAccelerate(_:)` /// Then: The base configuration is not mutated. func testPropertyOverrides() async throws { - let baseConfiguration = try await S3Client.S3ClientConfiguration() - baseConfiguration.serviceSpecific.accelerate = true - + let baseConfiguration = try await configuration(accelerate: true) let sut = try baseConfiguration.withAccelerate(false) XCTAssertEqual(sut.serviceSpecific.accelerate, false) XCTAssertEqual(baseConfiguration.serviceSpecific.accelerate, true) @@ -35,7 +33,7 @@ final class S3ClientConfigurationAccelerateTestCase: XCTestCase { let baseConfiguration = try await configuration(accelerate: baseAccelerate) let nilAccelerate = try baseConfiguration.withAccelerate(nil) - XCTAssertIdentical(baseConfiguration, nilAccelerate) + XCTAssert(baseConfiguration === nilAccelerate) } /// Given: A client configuration. @@ -46,7 +44,7 @@ final class S3ClientConfigurationAccelerateTestCase: XCTestCase { let baseConfiguration = try await configuration(accelerate: baseAccelerate) let equalAccelerate = try baseConfiguration.withAccelerate(baseAccelerate) - XCTAssertIdentical(baseConfiguration, equalAccelerate) + XCTAssert(baseConfiguration === equalAccelerate) } /// Given: A client configuration. @@ -57,7 +55,7 @@ final class S3ClientConfigurationAccelerateTestCase: XCTestCase { let baseConfiguration = try await configuration(accelerate: baseAccelerate) let nonEqualAccelerate = try baseConfiguration.withAccelerate(!baseAccelerate) - XCTAssertNotIdentical(baseConfiguration, nonEqualAccelerate) + XCTAssert(baseConfiguration !== nonEqualAccelerate) } @@ -74,7 +72,7 @@ final class S3ClientConfigurationAccelerateTestCase: XCTestCase { credentialsProvider: nil, endpoint: UUID().uuidString, serviceSpecific: serviceSpecific, - region: nil, + region: "us-east-1", regionResolver: nil, signingRegion: UUID().uuidString, useDualStack: .random(),