Skip to content

Commit 7b0c51f

Browse files
brennanMKEroyjit
authored andcommitted
fix(storage): fixes for unit tests (#99)
1 parent e3b893e commit 7b0c51f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

AmplifyPlugins/Storage/AWSS3StoragePlugin/Dependency/AWSS3PreSignedURLBuilderBehavior.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import AWSS3
1212
import ClientRuntime
1313
import AWSClientRuntime
1414

15-
enum AWSS3HttpMethod {
15+
public enum AWSS3HttpMethod {
1616
case get
1717
case put
1818
}

AmplifyPlugins/Storage/AWSS3StoragePluginTests/Mocks/MockAWSS3StorageService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ public class MockAWSS3StorageService: AWSS3StorageServiceBehaviour {
8080
}
8181

8282
public func getPreSignedURL(serviceKey: String,
83-
expires: Int,
84-
onEvent: @escaping StorageServiceGetPreSignedURLEventHandler) {
83+
method: AWSS3HttpMethod = .get,
84+
expires: Int,
85+
onEvent: @escaping StorageServiceGetPreSignedURLEventHandler) {
8586
getPreSignedURLCalled += 1
8687

8788
getPreSignedURLServiceKey = serviceKey
@@ -148,7 +149,6 @@ public class MockAWSS3StorageService: AWSS3StorageServiceBehaviour {
148149
}
149150

150151
public func getEscapeHatch() -> S3Client {
151-
// return AWSS3()
152152
fatalError("Not Implemented")
153153
}
154154

AmplifyPlugins/Storage/AWSS3StoragePluginTests/Support/Internal/MockMultipartUploadClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class MockMultipartUploadClient: StorageMultipartUploadClient {
7373
session.handle(multipartUploadEvent: .completed(uploadId: uploadId))
7474
}
7575

76-
func abortMultipartUpload(uploadId: UploadID) throws {
76+
func abortMultipartUpload(uploadId: UploadID, error: Error?) throws {
7777
guard let session = session else { throw Failure.sessionNotIntegrated }
7878

7979
abortMultipartUploadCount += 1

0 commit comments

Comments
 (0)