diff options
Diffstat (limited to 'tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala')
-rw-r--r-- | tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala index 392f6d8..55e21b8 100644 --- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala +++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala @@ -19,8 +19,12 @@ import com.softwaremill.sttp.asynchttpclient.cats.AsyncHttpClientCatsBackend import com.softwaremill.sttp.asynchttpclient.future.AsyncHttpClientFutureBackend import com.softwaremill.sttp.asynchttpclient.monix.AsyncHttpClientMonixBackend import com.softwaremill.sttp.asynchttpclient.scalaz.AsyncHttpClientScalazBackend +import com.softwaremill.sttp.impl.cats.convertCatsIOToFuture +import com.softwaremill.sttp.impl.monix.convertMonixTaskToFuture +import com.softwaremill.sttp.impl.scalaz.convertScalazTaskToFuture import com.softwaremill.sttp.okhttp.monix.OkHttpMonixBackend import com.softwaremill.sttp.okhttp.{OkHttpFutureBackend, OkHttpSyncBackend} +import com.softwaremill.sttp.testing.streaming.ConvertToFuture import com.typesafe.scalalogging.StrictLogging import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures} import org.scalatest.{path => _, _} @@ -180,19 +184,20 @@ class BasicTests var closeBackends: List[() => Unit] = Nil - runTests("HttpURLConnection")(HttpURLConnectionBackend(), ForceWrappedValue.id) - runTests("TryHttpURLConnection")(TryHttpURLConnectionBackend(), ForceWrappedValue.scalaTry) - runTests("Akka HTTP")(AkkaHttpBackend.usingActorSystem(actorSystem), ForceWrappedValue.future) - runTests("Async Http Client - Future")(AsyncHttpClientFutureBackend(), ForceWrappedValue.future) - runTests("Async Http Client - Scalaz")(AsyncHttpClientScalazBackend(), ForceWrappedValue.scalazTask) - runTests("Async Http Client - Monix")(AsyncHttpClientMonixBackend(), ForceWrappedValue.monixTask) - runTests("Async Http Client - Cats Effect")(AsyncHttpClientCatsBackend[cats.effect.IO](), ForceWrappedValue.catsIo) - runTests("OkHttpSyncClientHandler")(OkHttpSyncBackend(), ForceWrappedValue.id) - runTests("OkHttpAsyncClientHandler - Future")(OkHttpFutureBackend(), ForceWrappedValue.future) - runTests("OkHttpAsyncClientHandler - Monix")(OkHttpMonixBackend(), ForceWrappedValue.monixTask) - - def runTests[R[_]](name: String)(implicit backend: SttpBackend[R, Nothing], - forceResponse: ForceWrappedValue[R]): Unit = { + runTests("HttpURLConnection")(HttpURLConnectionBackend(), ConvertToFuture.id) + runTests("TryHttpURLConnection")(TryHttpURLConnectionBackend(), ConvertToFuture.scalaTry) + runTests("Akka HTTP")(AkkaHttpBackend.usingActorSystem(actorSystem), ConvertToFuture.future) + runTests("Async Http Client - Future")(AsyncHttpClientFutureBackend(), ConvertToFuture.future) + runTests("Async Http Client - Scalaz")(AsyncHttpClientScalazBackend(), convertScalazTaskToFuture) + runTests("Async Http Client - Monix")(AsyncHttpClientMonixBackend(), convertMonixTaskToFuture) + runTests("Async Http Client - Cats IO")(AsyncHttpClientCatsBackend[cats.effect.IO](), convertCatsIOToFuture) + runTests("OkHttpSyncClientHandler")(OkHttpSyncBackend(), ConvertToFuture.id) + runTests("OkHttpAsyncClientHandler - Future")(OkHttpFutureBackend(), ConvertToFuture.future) + runTests("OkHttpAsyncClientHandler - Monix")(OkHttpMonixBackend(), convertMonixTaskToFuture) + + def runTests[R[_]](name: String)(implicit + backend: SttpBackend[R, Nothing], + convertToFuture: ConvertToFuture[R]): Unit = { closeBackends = (() => backend.close()) :: closeBackends |