I am trying to create a MUnit test for a flow with a HTTP Listener as message source.
When I'm running the test, I get:
org.mule.munit.runner.model.TestExecutionException: Error [HTTP:SERVICE_UNAVAILABLE] while running test 'AccServiceIntegrationTest-AccServiceFlowTest':HTTP GET on resource 'http://localhost:8303/AccService' failed: service unavailable (503).
My HTTP Listener configuration looks like this:
<http:listener-config name="ApiHttpListenerConfig" doc:name="HTTP Listener config" doc:id="b72fd4c2-e250-4591-b780-de4a40f3a805" >
<http:listener-connection host="localhost" port="8303" />
</http:listener-config>
and my listener itself:
<http:listener doc:name="Listener" doc:id="91f3dc92-d221-4961-b33e-61e65040f481" config-ref="ApiHttpListenerConfig" path="/AccService"/>
The HTTP Request configuration in my test looks like this:
<http:request-config name="HTTPTestRequestConfiguration" doc:name="HTTP Request configuration" doc:id="d7ccc980-3103-4367-8ecc-e0c031f093e9">
<http:request-connection host="localhost" port="8303" />
</http:request-config>
And the request itself:
<http:request method="GET" doc:name="Request" doc:id="912fe4a9-5e6b-4909-9dc7-a6f44642cf40" config-ref="HTTPTestRequestConfiguration" path="/AccService"/>
now the flow of the test looks like this:
<munit:test name="AccServiceIntegrationTest-AccServiceFlowTest" doc:id="5e2d057f-38b9-494f-a889-25579960a96f" description="Test">
<munit:execution >
<file:read doc:name="Read acc-service-request.xml" doc:id="66ad1782-cefc-42dd-8a9d-52f6b6e191f4" config-ref="XMLFileTest" path="resources/acc-service-request.xml"/>
<http:request method="GET" doc:name="Request" doc:id="912fe4a9-5e6b-4909-9dc7-a6f44642cf40" config-ref="HTTPTestRequestConfiguration" path="/AccService"/>
<flow-ref doc:name="Flow-ref to FleetServiceFlow" doc:id="b8536d75-c09f-4c1a-894e-f7d25392d6b7" name="AccServiceFlow"/>
</munit:execution>
</munit:test>
All I get is a Service unavailable (503)
response.
What am I doing wrong here? When I'm testing the configuration for the listener - everything seems to be alright...