MUnit 2.1.2 - Passing Uri Parameters and Headers in MUnit before calling the flow

How to pass Headers in MUnit test case before calling the flow?

For example, if you want to set the following headers like userId, role, TTL for the flow to do unit testing, then you need to use the attrible section of set message and use the following Mule expression.


The value would have the below value.
#[{headers : {'userId' :'105632756','role' :'Registration,Profile','TTL' :'2592000'}}]

<munit:attributes value="#[{headers : {'userId' :'105632756','role' :'Registration,Profile','TTL' :'2592000'}}]" encoding="UTF-16"/>


How to pass Uri Parameters in MUnit test case before calling flow?  
<munit:attributes value="#[{uriParams : {'id' :'18350','account-id' :'12278'}}]" />  

Jayaraman Pancharathinam
20 Nov 2018

Comments

Post a Comment

Popular posts from this blog

How to read xml file and set as mock response for an http web service call in MUnit 2.1.3 in Mule 4?

How to set headers before calling a sub-flow in MUnit 2.1.3 in Mule 4?

How to mock SOAP web service call with a SOAP message in MUnit 2.1.3?