ITV/scala-pact

Create a wrapper to launch the stubber nicely, programmatically.

Closed this issue · 2 comments

Related to discussions about starting and stopping Http4s nicely itself.

https://gitter.im/http4s/http4s?at=58d50e7419cdf803632bf663

Maya and Bill have done work around this independently, should compare notes.

Related: #47

From version 2.3.0-RC1 you can now grab an IPactStubber e.g.:

val stubber = com.itv.scalapact.http.serverInstance

Which gives you methods to start and shutdown the stubber.

There is a catch, you need to decide how to keep is running. Scala-Pact employs two strategies:

  1. Runnable

  2. Wait for input to terminate

Depending on the use case.