0

I am facing a strange scenario while writing Munit test cases in Mule. I have successfully written couple of Munit test cases for maven based sample Mule project and the test cases are running fine. When it comes to a project where I used RAML, and I've generated test cases and did every thing to test a flow. It was very strange that even a logger on a Munit flow is not printing any message.

Here is my flow:

<munit:config name="munit" doc:name="MUnit configuration"/>
<munit:test name="MainFlow-test-suite-MainFlowTest" description="Test">
<munit:set payload="{&quot;msg&quot;: &quot;Ram&quot;}" doc:name="Set Message" />
<logger message="#[payload]" level="INFO" doc:name="Logger" />
<!-- <flow-ref name="MainFlow" doc:name="Flow-ref to MainFlow"/> -->
</munit:test> 

At least, the logger should print {"msg": "Ram"}.

Can any one suggest?

Ram Bavireddi
  • 1,139
  • 1
  • 19
  • 43
  • The issue is related to Anypoint Studio update. I had 3.5.0 version of Studio where I installed Munit plugins. During this process Studio got upgraded to 3.5.2 which does't allow existing projects' Munit test cases running correctly. Now I created a new RAML based project on the upgraded Studio. This time it allowed me to run test cases properly – Ram Bavireddi Oct 26 '15 at 06:53

1 Answers1

0

The probable reason for it not to be working is that you are missing a few attributes in the munit:config, mock-connectors & mock-inbounds:

<munit:config mock-connectors="false" mock- inbounds="false"/>

In any case please take a look at this this doc page it explain the APIKit testing scenario.

HTH

Dds
  • 712
  • 5
  • 7