diff --git a/src/main/scala/io/findify/s3mock/response/ListBucket.scala b/src/main/scala/io/findify/s3mock/response/ListBucket.scala index 5b0bf3f..25ea9b8 100644 --- a/src/main/scala/io/findify/s3mock/response/ListBucket.scala +++ b/src/main/scala/io/findify/s3mock/response/ListBucket.scala @@ -11,9 +11,15 @@ case class ListBucket(bucket:String, prefix: Option[String], delimiter: Option[S def toXML = {bucket} - { prefix.map(p => {p} ) } - { delimiter.map(d => {d}) } - { if (commonPrefixes.nonEmpty) {commonPrefixes.map(cp => {cp})} } + { if (prefix.isDefined) {prefix.get} } + { if (delimiter.isDefined) {delimiter.get} } + { if (commonPrefixes.nonEmpty) + {commonPrefixes.map(cp => + + {cp} + + )} + } {contents.length} 1000 {isTruncated} diff --git a/src/test/scala/io/findify/s3mock/GetPutObjectTest.scala b/src/test/scala/io/findify/s3mock/GetPutObjectTest.scala index 4fd034b..3dec107 100644 --- a/src/test/scala/io/findify/s3mock/GetPutObjectTest.scala +++ b/src/test/scala/io/findify/s3mock/GetPutObjectTest.scala @@ -111,10 +111,10 @@ class GetPutObjectTest extends S3MockTest { it should "work with = in path" in { s3.createBucket("urlencoded") - s3.listBuckets().exists(_.getName == "urlencoded") shouldBe true + s3.listBuckets().asScala.exists(_.getName == "urlencoded") shouldBe true s3.putObject("urlencoded", "path/with=123/foo", "bar=") s3.putObject("urlencoded", "path/withoutequals/foo", "bar") - val result = s3.listObjects("urlencoded").getObjectSummaries.toList.map(_.getKey) + val result = s3.listObjects("urlencoded").getObjectSummaries.asScala.toList.map(_.getKey) result shouldBe List("path/with=123/foo", "path/withoutequals/foo") getContent(s3.getObject("urlencoded", "path/with=123/foo")) shouldBe "bar=" getContent(s3.getObject("urlencoded", "path/withoutequals/foo")) shouldBe "bar"