projectionSpec

fun projectionSpec(handlers: List<ProcessorBinding<*>>, block: ProcessorSpec.() -> Unit)

Specifies a projection's behaviour: given a commit (a StateEvent, built with stateEvent), what its handlers write. handlers are the projection's, from the function the compiler generated for it (<processor>Handlers), with a fake of the port it writes to, which the expectations then read:

val views = InMemoryOrderViews()
projectionSpec(orderViewProjectionHandlers(views)) {
whenEvent(stateEvent(order, state, orderCreated)) {
expectHandledBy("onOrder")
views["order-1"]!!.status.assert().isEqualTo("CREATED")
}
}