FakePeer

A fake of the peer service of context (fakePeer): it records each call it takes (calls), decoded as the peer's node would decode it, and answers it as answer says, a success by default. It refuses a request that names no service (Wow-Service) or no root command (Wow-Call) with 403 wow.auth.forbidden, as a peer's internal port does, and records none. Closing it stops its port.

Properties

Link copied to clipboard

Every call it took, in order.

Link copied to clipboard
Link copied to clipboard
val url: URI

The base URL of its internal port, which the server under test's wow.peers.<context>.url names.

Functions

Link copied to clipboard
fun answer(rule: (PeerCall) -> PeerAnswer)

Answers each call from now on as rule says: PeerAnswer.succeeded, PeerAnswer.rejected or PeerAnswer.timedOut.

Link copied to clipboard
inline fun <reified C : Any> called(timeout: Duration = EVENTUALLY_TIMEOUT): PeerCall

The first call of a command of C not returned yet, waited for at most timeout; see called.

fun called(type: Class<*>, timeout: Duration = EVENTUALLY_TIMEOUT): PeerCall

The first call of a command of type that no call of this function returned yet, waited for at most timeout; fails when none comes. A test takes each call of a type in turn so.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun toString(): String