Skip to content

Commit

Permalink
deleted unused import and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterITA committed Jun 10, 2024
1 parent a36123f commit 6db27cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit 6db27cf

Please sign in to comment.