aboutsummaryrefslogtreecommitdiff
path: root/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala
diff options
context:
space:
mode:
authorSam Guymer <sam@guymer.me>2018-05-17 20:11:22 +1000
committerSam Guymer <sam@guymer.me>2018-05-19 00:37:52 +1000
commit92e10991df0d168d1972d4618fcc7e02e2e0a0fa (patch)
tree14e0d112fd47856a8c87ad1782d51a928b01bbf6 /tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala
parent588395d018c258eb74f60ad95bad706698bdf915 (diff)
downloadsttp-92e10991df0d168d1972d4618fcc7e02e2e0a0fa.tar.gz
sttp-92e10991df0d168d1972d4618fcc7e02e2e0a0fa.tar.bz2
sttp-92e10991df0d168d1972d4618fcc7e02e2e0a0fa.zip
Move backend tests into their projects
Instead of having a single project which tests all backends, each backend now implements a http test trait along with a streaming test trait if it supports streaming. The test http server has been moved into its own project and is started automatically before running a backends test. This allows each backend to be tested without the possibility of dependency eviction from another backend or the test http server. It also has the side effect of parallelizing the tests providing a speed up when run with multiple cores.
Diffstat (limited to 'tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala')
-rw-r--r--tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala30
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala b/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala
deleted file mode 100644
index 8959ccc..0000000
--- a/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.softwaremill.sttp.streaming
-
-import java.nio.ByteBuffer
-
-import cats.effect._
-import cats.instances.string._
-import com.softwaremill.sttp.SttpBackend
-import com.softwaremill.sttp.asynchttpclient.fs2.AsyncHttpClientFs2Backend
-import com.softwaremill.sttp.impl.cats.convertCatsIOToFuture
-import com.softwaremill.sttp.testing.streaming.{ConvertToFuture, TestStreamingBackend}
-import fs2.{Chunk, Stream, text}
-
-class AsyncHttpClientFs2StreamingTests extends TestStreamingBackend[IO, Stream[IO, ByteBuffer]] {
-
- override implicit val backend: SttpBackend[IO, Stream[IO, ByteBuffer]] =
- AsyncHttpClientFs2Backend[IO]()
-
- override implicit val convertToFuture: ConvertToFuture[IO] = convertCatsIOToFuture
-
- override def bodyProducer(body: String): Stream[IO, ByteBuffer] =
- Stream.emits(body.getBytes("utf-8").map(b => ByteBuffer.wrap(Array(b))))
-
- override def bodyConsumer(stream: Stream[IO, ByteBuffer]): IO[String] =
- stream
- .map(bb => Chunk.array(bb.array))
- .through(text.utf8DecodeC)
- .compile
- .foldMonoid
-
-}