Skip to content

Instantly share code, notes, and snippets.

@berndruecker
Created March 31, 2017 12:25
Show Gist options
  • Save berndruecker/4c7ef3ec9fc6914dc20836eff87372b8 to your computer and use it in GitHub Desktop.
Save berndruecker/4c7ef3ec9fc6914dc20836eff87372b8 to your computer and use it in GitHub Desktop.
@Test
@Deployment(resources = { "Order.bpmn", "RiskyOrder.dmn" })
public void testHappyPath() {
when(orderFlow.waitsAtUserTask("UserTask_ApproveOrder")) //
.thenReturn((task) -> task.complete(Variables.putValue("approved", true)));
mockRestServer
.expect(requestTo("https://api.stripe.com"))
// normal mocking...
when(orderFlow.waitsAtReceiveTask("ReceiveTask_WaitForDelivery")) //
.thenReturn((messageSubscription) -> messageSubscription.receive());
Scenario.run(orderFlow).startByKey( //
"OrderGraphic", //
Variables.putValue("customerCategory", "unkown").putValue("orderAmount", 500)).execute();
verify(orderFlow).hasFinished("EndEvent_OrderShipped");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment