fork
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:
whenCommand(PlaceOrder(...)) {
expectEventTypes(OrderPlaced::class)
fork("paid") { whenCommand(PayOrder(...)) { expectEventTypes(OrderPaid::class) } }
fork("cancelled") { whenCommand(CancelOrder(...)) { expectEventTypes(OrderCancelled::class) } }
}Content copied to clipboard
A check that fails before it ends the block, so the forks after it do not run.
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).