Expectations
The checks of a command's outcome, or of the exception its decide function threw (expectError). version is the aggregate's version after the command and stateAt reads its committed state at a version: expectState reads the state the aggregate is in after a command that committed nothing.
The event checks (expectEvents, expectEventTypes, expectEvent) read the events the decision committed beside its schedules: the system events wow.ScheduleSet and wow.ScheduleCancelled are checked by expectScheduled and expectScheduleCancelled.
A rejection is a value, not an exception, so a scenario that does not look at it would pass whatever the command did: a rejected command fails the scenario unless expectRejected checks it. A rejection with events commits them as any decision does, so expectRejected composes with the event, version and state checks:
whenCommand(Unlock("0000")) {
expectRejected("wrong-code")
expectEventTypes(AttemptFailed::class)
expectState { failures.assert().isEqualTo(1) }
}A creation rejected with events fails the scenario, naming the command: its aggregate does not exist, so the events could never be committed.
What the decide function put for the caller (me.ahoo.wow.api.decide.DecideScope.putResult) is checked by expectResult, or read from results.
Constructors
Properties
The kernel's outcome of the command (Committed, Unchanged, Rejected, …), for Wow's own tests; a failure when its decide function threw. A domain's scenario checks it through the expect* functions and results.
Functions
The aggregate's access attributes (@Access) are exactly expected after the committed events, or, after a command that committed nothing, in the state the aggregate is in: each declared attribute by name, a single one's value or null, a multiple one's values in any order (AggregateModel.accessOf).
The command committed the aggregate's deletion, as 9.x's expectStateAggregate { deleted } read it.
The command's decide function threw a T (9.x's expectError), which check checks: nothing was written. A rejection is not an error: expectRejected checks it.
The command committed exactly count events, its schedules' system events aside.
The command committed exactly one event, an E, which check checks with its envelope: the stream's aggregate, version, command and request ids, request facts, operator and commit time beside the event itself (EventEnvelope.body).
The command committed exactly events, in order; a mismatch lists each difference by its path.
The command committed events of exactly these types, in order.
The decide function threw nothing and the command was not rejected.
The command cancelled the schedule key: it committed wow.ScheduleCancelled.
The committed stream leaves the aggregate in scope.
The aggregate's state after the command is expected, field by field as Wow writes it to JSON: a mismatch lists each difference by its path. As expectState of a check, after a command that committed nothing the state is the one the aggregate is in.
Checks the state after the committed events; after a command that committed nothing (it changed nothing, was rejected, or its decide function threw), the state the aggregate is in.
The command was accepted and changed nothing.
The aggregate is at version after the command: the committed stream's, or the version it was at when the command appended nothing (changed nothing, or was rejected), as 9.x's expectStateAggregate { version } read it.
Runs block on a copy of the aggregate as this command left it, as AggregateSpec.fork does, so that the scenarios after a command branch from its checks, as 9.x's VerifiedStage.fork did:
Runs block on a copy of the aggregate as this command left it, as fork does, with model deciding from there on: the same aggregate built with other services (AggregateSpec.fork of a model).