diff --git a/file-manager/src/main/scala/it/pagopa/interop/commons/files/StorageConfiguration.scala b/file-manager/src/main/scala/it/pagopa/interop/commons/files/StorageConfiguration.scala index 225a9f1..89bc5f9 100644 --- a/file-manager/src/main/scala/it/pagopa/interop/commons/files/StorageConfiguration.scala +++ b/file-manager/src/main/scala/it/pagopa/interop/commons/files/StorageConfiguration.scala @@ -1,6 +1,6 @@ package it.pagopa.interop.commons.files -import com.typesafe.config.{Config, ConfigFactory} +import com.typesafe.config.ConfigFactory object StorageConfiguration { val maxConcurrency: Int = ConfigFactory.load().getInt("interop-commons.storage.max-concurrency") 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 4933829..974f701 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 @@ -65,8 +65,8 @@ class S3FileManagerTest "have a single file with just one is written" in { val filesAndContent: Future[(List[String], String)] = for { - _ <- fileManager.storeBytes("testBucket", "testFolder", "testFile")("testFile".getBytes()) - files <- fileManager.listFiles("testBucket")("/testFolder") + _ <- fileManager.storeBytes("testBucket", "testFolder", "testFile")("testFile".getBytes()) + files <- fileManager.listFiles("testBucket")("/testFolder") content <- fileManager.getFile("testBucket")("/testFolder/testFile").map(new String(_)) } yield (files, content) @@ -77,10 +77,10 @@ class S3FileManagerTest "have two files, one of whom in the root dir" in { val filesAndContent: Future[(List[String], String, String)] = for { - _ <- fileManager.storeBytes("testBucket", "", "rootFile")("rootFile".getBytes()) - _ <- fileManager.storeBytes("testBucket", "testFolder", "testFile")("testFile".getBytes()) - files <- fileManager.listFiles("testBucket")("") - content <- fileManager.getFile("testBucket")("/testFolder/testFile").map(new String(_)) + _ <- fileManager.storeBytes("testBucket", "", "rootFile")("rootFile".getBytes()) + _ <- fileManager.storeBytes("testBucket", "testFolder", "testFile")("testFile".getBytes()) + files <- fileManager.listFiles("testBucket")("") + content <- fileManager.getFile("testBucket")("/testFolder/testFile").map(new String(_)) rootContent <- fileManager.getFile("testBucket")("/rootFile").map(new String(_)) } yield (files, content, rootContent) @@ -91,17 +91,17 @@ class S3FileManagerTest } "get all the files" in { val filesF: Future[Map[String, Array[Byte]]] = for { - _ <- fileManager.storeBytes("testBucket", "", "rootFile")("rootFile".getBytes()) - _ <- fileManager.storeBytes("testBucket", "testFolder", "testFile")("testFile".getBytes()) - _ <- fileManager.storeBytes("testBucket", "testFolder/nestedFolder", "nestedFile")("nestedFile".getBytes()) + _ <- fileManager.storeBytes("testBucket", "", "rootFile")("rootFile".getBytes()) + _ <- fileManager.storeBytes("testBucket", "testFolder", "testFile")("testFile".getBytes()) + _ <- fileManager.storeBytes("testBucket", "testFolder/nestedFolder", "nestedFile")("nestedFile".getBytes()) files <- fileManager.getAllFiles("testBucket")("") } yield files val files = filesF.futureValue val contentMap = files.map { case (k, v) => (k, new String(v)) } val expected = Map( - "rootFile" -> "rootFile", - "testFolder/testFile" -> "testFile", + "rootFile" -> "rootFile", + "testFolder/testFile" -> "testFile", "testFolder/nestedFolder/nestedFile" -> "nestedFile" ) assert(contentMap == expected)