How to read xml file and set as mock response for an http web service call in MUnit 2.1.3 in Mule 4?
Reading XML file from src/test/resources folder and set as mock response for a http web service call in MUnit 2.1.3 in mule 4 You need to place the XML file under src/test/resources in order read by MUnit tools. And it has to be mentioned as below. < munit-tools:mock-when doc:name = "Mock when" doc:id = "9bc2c6a1-dd68-4d19-a8b0-0ad1b892b015" processor = "wsc:consume" > < munit-tools:with-attributes > < munit-tools:with-attribute attributeName = "doc:name" whereValue = "Get Token" /> </ munit-tools:with-attributes > < munit-tools:then-return > < munit-tools:payload value = " #[MunitTools::getResourceAsString ( ' getTokenWS_response.xml ' ) ] " mediaType = "application/xml" /> </ munit-tools:then-return > </ munit-tools:mock-when > In case the file lo...