Reputation: 605
I am having a flow as follows
<flow name="MyMainFlow">
<flow-ref name="MySubFlow" >
</flow>
<sub-flow name="MySubFlow">
------
</sub-flow>
While testing with Munit I am getting class not found exception . Due to some reasons I am not allowed to test through mule files . Is there any way where I could test sub-flow with Munit?
Upvotes: 1
Views: 1634
Reputation: 205
Subflow can be tested from parent flow which called by using the flow -ref.
you can try with latest versions of munit 3.5.2-m2 version.
Upvotes: 0
Reputation: 91
You can do a flow ref to a sub flow
The class not found exception is related with your test classpath, can we have a stacktrace?
Upvotes: 0
Reputation: 699
I was able to test a sub flow using the following flow and sub-flow:
<flow name="main">
<vm:inbound-endpoint path="in"/>
<flow-ref name="MySubFlow" />
<vm:outbound-endpoint path="out"/>
</flow>
<sub-flow name="MySubFlow">
<append-string-transformer message=" Received"/>
</sub-flow>
and the following munit test:
<munit:test name="test" description="Create your test here">
<munit:set payload-ref="#[string: Hello world!]"/>
<munit:assert-not-null/>
</munit:test>
Upvotes: 1