Reputation: 99
I have created a mule flow using MS Dynamics CRM connector.
<flow name="Dynamics_crmFlow4" doc:name="Dynamics_crmFlow4">
<vm:inbound-endpoint exchange-pattern="one-way" path="CreateRecord" doc:name="VM"/>
<dynamicscrm:create config-ref="MS_Dynamics_CRM" logicalName="account" doc:name="CreateAccount">
<dynamicscrm:entity>
<dynamicscrm:entity key="address1_city">#[message.payload['city']]</dynamicscrm:entity>
<dynamicscrm:entity key="name">#[message.payload['name']]</dynamicscrm:entity>
</dynamicscrm:entity>
</dynamicscrm:create>
<logger message="Account created guid : #[payload]" level="INFO" doc:name="Logger"/>
</flow>
I am trying to write unit test for the above flow. In this process I would like mock "dynamicscrm:create" message processor in the above flow. Can any one suggest a best way to mock a message processor in a flow. Thanks in Advance.
Upvotes: 1
Views: 1148
Reputation: 2475
An example of mocking a message processor using munit can be found here: https://github.com/mulesoft/munit/blob/munit-3.4.x/munit-examples/munit-jira-mock-example/src/test/munit/jira-mock-example-test.xml
Upvotes: 0
Reputation: 2319
Check the Munit module: https://github.com/mulesoft/munit/wiki
Munit is a Mule testing framework, it allows mule developers to automate mule app testing in an easy manner.
Upvotes: 1