Skip to main content
Version: 2.x

ZIO Test Akka HTTP

ZIO Test Akka HTTP is an Akka-HTTP Route TestKit for zio-test.

Installationโ€‹

In order to use this library, we need to add the following line in our build.sbt file:

libraryDependencies += "info.senia" %% "zio-test-akka-http" % "2.0.0-RC5"

Exampleโ€‹

An example of writing Akka HTTP Route test spec:

import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.server.Directives.complete
import zio.test.Assertion._
import zio.test._
import zio.test.akkahttp.AkkaZIOSpecDefault

object MySpec extends AkkaZIOSpecDefault {
def spec =
suite("MySpec")(
test("my test") {
assertZIO(Get() ~> complete(HttpResponse()))(
handled(
response(equalTo(HttpResponse()))
)
)
}
)
}

ZIO Chat

๐Ÿ”ฅ Ignite your ZIO journey with ZIO Chat! ๐Ÿ”ฅ Ready to unravel the intricacies of ZIO? As your trusty sidekick, I'm here to light the way. No matter if you're wandering through functional forests or traversing effectful landscapes, I've got answers to keep you on track. Your ZIO adventure starts here โ€“ ask me anything and let's explore together!