Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterITA committed Jun 10, 2024
1 parent f352cc9 commit fb96169
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ final class S3ManagerImpl(blockingExecutionContext: ExecutionContextExecutor)(

val presignRequest: GetObjectPresignRequest = GetObjectPresignRequest
.builder()
.signatureDuration(Duration.ofMinutes(durationInMinutes.length))
.signatureDuration(Duration.ofMinutes(durationInMinutes.toMinutes))
.getObjectRequest(objectRequest)
.build()

Expand All @@ -211,7 +211,7 @@ final class S3ManagerImpl(blockingExecutionContext: ExecutionContextExecutor)(

val presignRequest: PutObjectPresignRequest = PutObjectPresignRequest
.builder()
.signatureDuration(Duration.ofMinutes(durationInMinutes.length))
.signatureDuration(Duration.ofMinutes(durationInMinutes.toMinutes))
.putObjectRequest(objectRequest)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ class S3FileManagerTest
assert(contentMap == expected)
}
"Get presigned url" in {
val url = fileManager.generateGetPresignedUrl("testBucket", "testFolder", "testFile", 5).get
val url = fileManager.generateGetPresignedUrl("testBucket", "testFolder", "testFile", FiniteDuration(5, MINUTES)).get
assert(url.nonEmpty)
}
"Put presigned url" in {
val url = fileManager.generatePutPresignedUrl("testBucket", "testFolder", "testFile", 1).get
val url = fileManager.generatePutPresignedUrl("testBucket", "testFolder", "testFile", FiniteDuration(1, MINUTES)).get
assert(url.nonEmpty)
}
}
Expand Down

0 comments on commit fb96169

Please sign in to comment.