I am writing an MUnit and the port of HttpListerner is mentioned in mule-app.properties file. it is not getting loaded when i load the flow using getConfigResources. is there anything else that I need to do?
4 Answers
Try to load it using the Logger component, for example if you place the http listener configuration in mule-app.properties you may access it by this example xml configuration (also it is HttpListener not HttpListerner)
<logger message="${HttpListener}" level="INFO" doc:name="Log HttpListener Value"/>
your mule-app.properties file contains:
HttpListener="configuration example, url, host, port"
Hope this helps.
Maybe you could try to load the properties with the property-placeholder element in your Munit Flow, like this :
<context:property-placeholder location="mule-app.test.properties"/>
Event better would be to configure the properties needed for each flow I think, like this at the beginning of the Munit flow
<global-property name="prop1" value="value1"/>
<global-property name="prop2" value="value2"/>
You can then access them like normal property.
You can find the doc here
Hope it helps.
/T
You can get the complete step by step solution to configure mule app-properties at https://docs.mulesoft.com/mule-user-guide/v/3.7/configuring-properties