unisay / mockserver-client-scala   0.3.0

MIT License GitHub

Scala client for the www.mock-server.com

Scala versions: 2.12

Scala client for the MockServer

Build Status

Implemented as a wrapper around Java Client

Examples

Simplest case

forAnyRequest respond BadRequest once

One-liner with request and response bodies

when get "/path" has "Request body" respond Ok + "Response body" exactly 3.times

All features:

when post "/user" has {
  param("email", "[email protected]") and
  param("rating", 99) and
  ContentType("application/x-www-form-urlencoded") and
  body("firstName=John&lastName=Doe")
} after 10.seconds respond {
  Accepted and Location("http://localhost:8080/user/123")
} once

For more examples please see the test spec (DSLTest.scala)

Installation:

resolvers += Resolver.bintrayRepo("unisay", "maven")
libraryDependencies += "com.github.unisay" %% "mockserver-client-scala" % "0.3.0"