btomala / teapot   0.4.0

Apache License 2.0 GitHub

mock-http server base on akka-http

Scala versions: 2.12 2.11

Build Status Download

teapot

Is a simple mocking http server based on akka-http written in scala.

usage

To use add resolver to your build

resolvers += "btomala at bintray" at "https://dl.bintray.com/btomala/maven/"

libraryDependencies += "io.github.btomala" %% "teapot" % "0.4"

Sample of usage

import akka.http.scaladsl.model.{HttpRequest, HttpResponse}
import btomala.http.mock.HttpMock

  val server = new HttpMock()
  val request = HttpResponse()
  val response = HttpResponse()
  
  server.record (request  response)

  //here make request to the server..

For more look in to the HttpMockSpec

If somethings goes wrong, server response with 418 "I'm a teapot" status.

Test must executed sequential or create new instance of server for every test/suit.