From bcb94e252a96c78b1db29aebe47b18bfd337e764 Mon Sep 17 00:00:00 2001 From: Sam Guymer Date: Sun, 20 May 2018 21:02:37 +1000 Subject: Code review updates Remove tests sub project, all tests are now in core. Remove TestStreamingBackend, StreamingTest now has the required abstract methods. --- .../fs2/AsyncHttpClientFs2HttpStreamingTest.scala | 11 ++--------- .../monix/AsyncHttpClientMonixStreamingTest.scala | 19 +++---------------- 2 files changed, 5 insertions(+), 25 deletions(-) (limited to 'async-http-client-backend') diff --git a/async-http-client-backend/fs2/src/test/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala b/async-http-client-backend/fs2/src/test/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala index 565db5c..56bb18b 100644 --- a/async-http-client-backend/fs2/src/test/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala +++ b/async-http-client-backend/fs2/src/test/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala @@ -5,21 +5,14 @@ import java.nio.ByteBuffer import cats.effect.IO import cats.instances.string._ import com.softwaremill.sttp.SttpBackend -import com.softwaremill.sttp.testing.streaming.{StreamingTest, TestStreamingBackend} +import com.softwaremill.sttp.testing.streaming.StreamingTest import com.softwaremill.sttp.testing.ConvertToFuture import fs2.{Chunk, Stream, text} import scala.concurrent.Future class AsyncHttpClientFs2HttpStreamingTest extends StreamingTest[IO, Stream[IO, ByteBuffer]] { - override val testStreamingBackend: TestStreamingBackend[IO, Stream[IO, ByteBuffer]] = - new AsyncHttpClientFs2TestStreamingBackend -} - -class AsyncHttpClientFs2TestStreamingBackend extends TestStreamingBackend[IO, Stream[IO, ByteBuffer]] { - - override implicit val backend: SttpBackend[IO, Stream[IO, ByteBuffer]] = - AsyncHttpClientFs2Backend[IO]() + override implicit val backend: SttpBackend[IO, Stream[IO, ByteBuffer]] = AsyncHttpClientFs2Backend[IO]() override implicit val convertToFuture: ConvertToFuture[IO] = new ConvertToFuture[IO] { diff --git a/async-http-client-backend/monix/src/test/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala b/async-http-client-backend/monix/src/test/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala index 34c15ff..8e93074 100644 --- a/async-http-client-backend/monix/src/test/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala +++ b/async-http-client-backend/monix/src/test/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala @@ -3,24 +3,11 @@ package com.softwaremill.sttp.asynchttpclient.monix import java.nio.ByteBuffer import com.softwaremill.sttp.SttpBackend -import com.softwaremill.sttp.impl.monix.MonixTestStreamingBackend -import com.softwaremill.sttp.testing.streaming.{StreamingTest, TestStreamingBackend} +import com.softwaremill.sttp.impl.monix.MonixStreamingTest import monix.eval.Task import monix.reactive.Observable -class AsyncHttpClientMonixStreamingTest extends StreamingTest[Task, Observable[ByteBuffer]] { +class AsyncHttpClientMonixStreamingTest extends MonixStreamingTest { - override val testStreamingBackend: TestStreamingBackend[Task, Observable[ByteBuffer]] = - new AsyncHttpClientMonixTestStreamingBackend -} - -class AsyncHttpClientMonixTestStreamingBackend extends MonixTestStreamingBackend[ByteBuffer] { - - import monix.execution.Scheduler.Implicits.global - - override def toByteArray(v: ByteBuffer): Array[Byte] = v.array() - override def fromByteArray(v: Array[Byte]): ByteBuffer = ByteBuffer.wrap(v) - - override implicit val backend: SttpBackend[Task, Observable[ByteBuffer]] = - AsyncHttpClientMonixBackend() + override implicit val backend: SttpBackend[Task, Observable[ByteBuffer]] = AsyncHttpClientMonixBackend() } -- cgit v1.2.3