Skip to content

Commit

Permalink
Test2
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Dec 30, 2024
1 parent 1f793a9 commit 957874e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,21 +235,21 @@ trait HttpTestExtensions[F[_]] extends AsyncFreeSpecLike { self: HttpTest[F] =>
}
}

"should compress a file-based request body using gzip" in {
val testFileContent = "test file content" * 100
"should compress a file-based request body using deflate" in {
val testFileContent = "test file content"
withTemporaryFile(Some(testFileContent.getBytes())) { file =>
val req = basicRequest
// .compressBody(Encodings.Gzip)
.compressBody(Encodings.Deflate)
.response(asByteArrayAlways)
.post(uri"$endpoint/echo/exact")
.body(file)
req.send(backend).toFuture().map { resp =>
resp.code shouldBe StatusCode.Ok

// val gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(resp.body))
// val decompressedBytes = gzipInputStream.readAllBytes()
val inflaterInputStream = new InflaterInputStream(new ByteArrayInputStream(resp.body))
val decompressedBytes = inflaterInputStream.readAllBytes()

new String(resp.body) shouldBe testFileContent
new String(decompressedBytes) shouldBe testFileContent
}
}
}
Expand Down

0 comments on commit 957874e

Please sign in to comment.