Ram Bavireddi
Ram Bavireddi

Reputation: 1187

Mule Munit Test cases are not working for a RAML based project

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?

Upvotes: 0

Views: 639

Answers (1)

Dds
Dds

Reputation: 712

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

Upvotes: 0

Related Questions