简体   繁体   中英

How to mock a message processor in a Mule flow

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM