Tutorial: Automated unit testing
The best way to learn how to build and execute a unit test is to try an example.
Modify POProcessing to add a unit test, which sets the inbound message, the simulation message, and two assertions. The inbound message is a valid order with a valid credit card and order total between 1000 and 5000. This triggers the approveLargeOrder process but not the human task.
The simulated message is the message returned from the credit validation service as a VALID response.
The first assertion is on the data being passed to the WriteFile service, checking that the value of status = 'approved', which is the expected value for this input data.
The second assertion is on the data being passed to FulfillmentProcess, checking that ...