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, and a command the calling service may not call with 403 wow.call.command-forbidden (CallPermits): as a peer whose configuration lists no wow.callers, every system command (wow.*, the lifecycle's restore among them). It records neither, as a peer's internal port does. A body that is not JSON, or does not read as its command's class, is 400 wow.command.malformed, as the peer answers it; a body its command's constraints refuse is accepted by the fake and refused by the real peer (wow.command.invalid). 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
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