From 49ec259a37129dfb2dfaeb0b316241d9ef88bf2d Mon Sep 17 00:00:00 2001 From: Sebastian Villena <97059974+ruisebas@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:57:07 -0400 Subject: [PATCH] test: Updating integration tests --- ...WSS3StoragePluginMultipleBucketTests.swift | 39 ++----------------- 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/AmplifyPlugins/Storage/Tests/StorageHostApp/AWSS3StoragePluginIntegrationTests/AWSS3StoragePluginMultipleBucketTests.swift b/AmplifyPlugins/Storage/Tests/StorageHostApp/AWSS3StoragePluginIntegrationTests/AWSS3StoragePluginMultipleBucketTests.swift index db7e14ae72..e1e52e3789 100644 --- a/AmplifyPlugins/Storage/Tests/StorageHostApp/AWSS3StoragePluginIntegrationTests/AWSS3StoragePluginMultipleBucketTests.swift +++ b/AmplifyPlugins/Storage/Tests/StorageHostApp/AWSS3StoragePluginIntegrationTests/AWSS3StoragePluginMultipleBucketTests.swift @@ -10,7 +10,7 @@ import XCTest class AWSS3StoragePluginMultipleBucketTests: AWSS3StoragePluginTestBase { - var customBucket: (any StorageBucket)! + private var customBucket: ResolvedStorageBucket! override func setUp() async throws { guard let outputs = try? AmplifyOutputs.amplifyOutputs.resolveConfiguration(), @@ -352,7 +352,7 @@ class AWSS3StoragePluginMultipleBucketTests: AWSS3StoragePluginTestBase { /// Given: An object in storage in a custom bucket /// When: Call the getURL API using key /// Then: The operation completes successfully with the URL retrieved - func testGetRemoteURL_fromCustomBucket_usingKey_sholdSucceed() async throws { + func testGetRemoteURL_fromCustomBucket_usingKey_shouldSucceed() async throws { let key = UUID().uuidString try await uploadData( key: key, @@ -382,7 +382,7 @@ class AWSS3StoragePluginMultipleBucketTests: AWSS3StoragePluginTestBase { /// Given: An object in storage in a custom bucket /// When: Call the getURL API using StoragePath /// Then: The operation completes successfully with the URL retrieved - func testGetRemoteURL_fromCustomBucket_usingStoragePath_sholdSucceed() async throws { + func testGetRemoteURL_fromCustomBucket_usingStoragePath_shouldSucceed() async throws { let id = UUID().uuidString let path: StringStoragePath = .fromString("public/\(id)") try await uploadData( @@ -410,39 +410,6 @@ class AWSS3StoragePluginMultipleBucketTests: AWSS3StoragePluginTestBase { XCTAssertEqual(deleted, path.string) } - /// Given: An object in storage in a custom bucket - /// When: Call the list API using key - /// Then: The operation completes successfully with the key retrieved - func testList_fromOtherBucket_usingKey_shouldSucceed() async throws { - let key = UUID().uuidString - try await uploadData( - key: key, - data: Data(key.utf8), - options: .init(bucket: customBucket) - ) - - let result = try await Amplify.Storage.list( - options: .init( - path: key, - bucket: customBucket - ) - ) - let items = try XCTUnwrap(result.items) - - XCTAssertEqual(items.count, 1) - let item = try XCTUnwrap(items.first) - XCTAssertEqual(item.key, key) - XCTAssertNotNil(item.eTag) - XCTAssertNotNil(item.lastModified) - XCTAssertNotNil(item.size) - - let deleted = try await Amplify.Storage.remove( - key: key, - options: .init(bucket: customBucket) - ) - XCTAssertEqual(deleted, key) - } - /// Given: An object in storage in a custom bucket /// When: Call the list API using StoragePath /// Then: The operation completes successfully with the key retrieved