mockingsalesforcemulemunit

Mocking Salesforce in MUnit in Mule


I need to mock the salesforce endpoint. So I need to have a payload returned from the mock processor that's mocking the salesforce.

Currently I have written the MEL as follows :

[Arrays.asList((({AccountId='0012',FirstName=Martin},{AccountId='0014',FirstName=Dmitri}).asString().split(',')))]

This doesn't seem to work properly. I need to use a MEL to convert the payload to a Array list of hash maps. I also tried separating the string by some other character like '|' instead of ',', but it didn't work.

Please let me know if there's any change required in the MEL.

Thank you.


Solution

  • Please refer this link http://www.slideshare.net/prudhvivreddy/munit-junit-test-case and http://www.slideshare.net/krishananth/mule-esb-mocksalesforce. You need to create saleforce response payload and return as required type as mentioned here. Check slide number 18. Hope that helps .