I've been building a Mule application for a while now and have just begun experimenting with writing JUnit tests for my flows. The flows I've built typically handle flat-file transformations and are structured similar to the below:
<flow>
<inbound endpoint>
... DO SOMETHING WITH THE FILE ...
<outbound endpoint>
</flow>
My inbound/outbound endpoints are specific locations in the environments I'm deploying to and differ for each flow. The question I have is what's the best practice/approach in writing a test to inject a file into my flow and then check the output? Is it normal to create a test copy of the config file with dummy, vm endpoints and inject the file into that? Or is it more appropriate to go with a composite source like below and inject the file into the regular flow? Apologies for the potentially novice question, this is the first time I've worked with automated testing.
<flow>
<composite source>
<inbound endpoint>
<vm endpoint>
<composite source>
... DO SOMETHING WITH THE FILE ...
<choice>
<when "file originates from inbound endpoint...">
<outbound endpoint>
</when>
<otherwise>
<vm endpoint>
</otherwise>
</choice>
</flow>