Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

About Mock When Event Processor

The Mock When event processor allows you to mock an Event Processor when it matches the defined Mock When Event Processor name and attributes.

The following example shows you how to mock the payload of an HTTP Request.


         
      
1
2
3
4
5
6
7
8
<munit-tools:mock-when processor="http:request">
   <munit-tools:with-attributes>
       <munit-tools:with-attribute attributeName="method" whereValue="#['POST']"/>
   </munit-tools:with-attributes>
   <munit-tools:then-return>
       <munit-tools:payload value="#['mockPayload']"/>
   </munit-tools:then-return>
</munit-tools:mock-when>

In this topic: