Skip to content

Instantly share code, notes, and snippets.

@monkey-codes
Created April 8, 2021 05:24
Show Gist options
  • Select an option

  • Save monkey-codes/9543a890fa308bde95d9fea1b712a509 to your computer and use it in GitHub Desktop.

Select an option

Save monkey-codes/9543a890fa308bde95d9fea1b712a509 to your computer and use it in GitHub Desktop.
Aggregate Test
@Test
fun `should take an order`() {
val waiterId = UUID.randomUUID()
val takeOrderCommand = takeOrderCommand(waiterId = waiterId)
fixture
.given(WaiterHiredEvent(id = waiterId, name = "monkey codes"))
.`when`(takeOrderCommand)
.expectSuccessfulHandlerExecution()
.expectEvents(
OrderTakenEvent(waiterId = waiterId,
orderId = takeOrderCommand.orderId,
items = takeOrderCommand.items)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment