Getting started Community Training Tutorials Documentation APIs, AI & Tools
%dw 2.0
import dw::test::Asserts
---
payload must beObject()
The MUnit DataWeave Assertions Library is a set of DataWeave matcher functions for writing assertions in MUnit tests. Use it with the Assert Expression processor to validate values such as strings, numbers, arrays, and objects using DataWeave syntax.
This module contains the set of core Matchers to use in your tests
%dw 2.0
import dw::test::Asserts
---
payload must beObject()
Validates if a payload is of type Object
Validates that the given value is equal to the content of a resource file
The resource file must belong to the classpath
%dw 2.0
import dw::test::Asserts
---
{ name: "Lionel", lastName: "Messi" } must equalToResource("user.json", "application/json")