Created
March 31, 2017 12:25
-
-
Save berndruecker/4c7ef3ec9fc6914dc20836eff87372b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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