fakePeer

fun fakePeer(context: String): FakePeer

Starts a fake of the peer service that serves context, on a port of the loopback interface the system chooses: the call routes of its internal port, which a saga's synchronous call and a service's wow-client send its commands to. Its commands and their routes are the ones its api module's contract on the class path declares, as the caller finds them. Give it to the server under test (wowServer's peers), which then calls it at its FakePeer.url.

fakePeer("eshop-ordering").use { ordering ->
wowServer<BasketServer>("dev", peers = listOf(ordering)).use { basket ->
// check out the basket: its saga calls the ordering
ordering.called<SubmitOrder>().operator!!.id.assert().isEqualTo("alice")
}
}