MUnit JSON Assertion

For a REST API in Mule which returns a JSON response, it is always advisable to write MUnit tests and assert the entire JSON response payload to avoid contract conflicts/mismatches. MUnit does not have any out-of-the-box component to compare two JSON files. In this example, we are using a Groovy script for this comparison/assertion.

Objective

Our objective is loading expected JSON data from a file and comparing it with actual MUnit payload which we got from the tested flow. https://goo.gl/BBAbcB #DataIntegration #ML

Subscribe To Newsletter

Sign up for my newsletter and get the latest technology news

2019 © Craig Brown PhD. All rights reserved.