I started writing tests for my Mule project.
I wrote a functional test case for my main threads as follows.
public void testMainFlow_1() throws Exception{ MuleClient client = muleContext.getClient(); MuleMessage result = client.send(helloServiceAddress, fileAsString("SamplePayloads/input_Request.xml"), properties); assertNotNull("Null Result", result); assertEquals(result.getPayloadAsString(), fileAsString("SampleResponses/sampleResponse.xml")); }
But how can I check my substreams. They have no endpoints. So how can I pass the payload to them and test it.
The following is the stream configuration.
<flow name="main_flow" > .... .... <flow-ref name="subflow_1" /> .... .... <flow-ref name="subflow_2" /> .... .... </flow> <sub-flow name="subflow_1"> .... <some-transformer ... /> <out-bound call to web-service /> <some-transformer ... /> .... </sub-flow> <sub-flow name="subflow_2"> .... <some-transformer ... /> <out-bound call to web-service /> <some-transformer ... /> .... </sub-flow>
source share