From fb961697aa8abc4187fdd8a2448bb7ad9b738983 Mon Sep 17 00:00:00 2001 From: AsterITA Date: Mon, 10 Jun 2024 10:56:19 +0200 Subject: [PATCH] minor fix --- .../interop/commons/files/service/impl/S3ManagerImpl.scala | 4 ++-- .../it/pagopa/interop/commons/files/S3FileManagerTest.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/file-manager/src/main/scala/it/pagopa/interop/commons/files/service/impl/S3ManagerImpl.scala b/file-manager/src/main/scala/it/pagopa/interop/commons/files/service/impl/S3ManagerImpl.scala index 52bcd33..8075fed 100644 --- a/file-manager/src/main/scala/it/pagopa/interop/commons/files/service/impl/S3ManagerImpl.scala +++ b/file-manager/src/main/scala/it/pagopa/interop/commons/files/service/impl/S3ManagerImpl.scala @@ -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() @@ -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() diff --git a/file-manager/src/test/scala/it/pagopa/interop/commons/files/S3FileManagerTest.scala b/file-manager/src/test/scala/it/pagopa/interop/commons/files/S3FileManagerTest.scala index 974f701..abfed85 100644 --- a/file-manager/src/test/scala/it/pagopa/interop/commons/files/S3FileManagerTest.scala +++ b/file-manager/src/test/scala/it/pagopa/interop/commons/files/S3FileManagerTest.scala @@ -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) } }