AggregateSpec
Properties
Functions
Moves the time on by duration, then sends the aggregate each command it scheduled for itself that is due by then, earliest first, as the runtime would. Without expect it never fails, whether or not a command was due. expect checks the outcome of the last one sent, and fails when none was due: use expectNothingDue to show that none is, after a schedule was cancelled, say.
Runs block with caller sending the commands that name no caller of their own, as aggregateSpec's caller does for the whole specification: a scenario of several callers, the owner then another user, say.
Moves the time on by within, and fails when a command the aggregate scheduled for itself is due by then: a cancelled schedule, say, does not fire. Nothing is sent.
Runs block on a copy of the aggregate as it is at the ref from (ref), or now when from is null, so that several scenarios share a prefix: what block does stays in the fork, and the specification goes on from where it was. A failure in the fork names it (name, or from).
Runs block on a copy of the aggregate as fork does, with model deciding from there on: the same aggregate built with other services, as a domain module's generated factory builds it (orderModel(name, OutOfStockInventory)), so that one branch of a scenario sees a service answer otherwise. The copy keeps the log, which model reads as its own, so model is of the same aggregate type; the services the commands before the fork called are not called again.
Commits events as one stream, as if an earlier command had produced them, leaving the aggregate in scope (by default the scope it already has, at first none, or the owner its id is of an aggregate whose id is its owner's). The stream is committed at commitTime, the specification's time by default, in the name of operator, none by default: the commit a sourcing function reads (me.ahoo.wow.api.read.EventStream).
Commits records as one stream, as the log holds them, leaving the aggregate in scope, in the name of operator at commitTime as given does: a history the model's classes can no longer write, such as an event the aggregate retired, whose record the kernel skips, or a record of an older revision, read through its upgrades.
Starts the aggregate in state at version, as if its first version streams had left it there (9.x's givenState), in scope: the commands after it are decided on that state, and their streams continue from version; an aggregate whose id is its owner's is given in that owner's scope by default. It is the first step of a specification, before any event or command. The state is copied through its JSON, as a snapshot would be, so changing state afterwards changes nothing.
Starts the aggregate in its initial state changed by build, at version, as givenState does.
Whether the aggregate holds key in namespace, reserved with tenancy: reserved by a command that committed and not released since (me.ahoo.wow.api.decide.DecideScope.release), as a rename releases its old key.
Sends command through the kernel and checks its outcome in expect. An exception the decide function throws fails the specification, unless expect checks it with Expectations.expectError.