WowServer
A Wow application a test started (wowServer): its context, the publicPort and internalPort it bound, and clients of them. A test drives the service as its users do, with the typed clients of the public port: commands sends command objects and queries reads states, both as a caller, through the wow-client a peer calls with. The JSON clients (http, internal) are for what the wire itself must show: a route's shape, a header, a problem's members (Answer.problem). Closing it closes the application and every client.
val alice = Caller.of(subject = "alice", scope = Scope(ownerId = "alice"))
server.commands(alice).wait(Deposit(100), "alice").version.assert().isEqualTo(2)
val account = server.queries(alice).snapshots(AccountState::class.java).state("alice")!!
assertThrows<CommandRejectedException> { server.commands(alice).wait(Withdraw(150), "alice") }
.code.assert().isEqualTo("bank.account.insufficient-balance")Properties
Functions
The command client of the public port, sending as caller: the wow-client a peer calls with, in user mode. It sends the commands of the contexts the server serves as objects, system commands among them (a lifecycle command, a snapshot rebuild, a job's command), waits as their wait plans say, and throws a rejection as a CommandRejectedException, any other problem as a WowProblemException, each with its error code; a command of another context fails, as no endpoint is known for it.
The queries of the public port as caller, sent as commands sends, with credential: the states, snapshots, events and datasets of the contexts the server serves, by their state classes, read as that caller may.