0

Mule Munit test with maven : mule-domain-config.xml file not found

I am getting an error while trying to run Munit using Maven. It's a domain project and my Munit test cases are available in mule projects. when I ran maven, it is giving me file not found exception (mule-domain-config.xml). I tried all possible ways by checking in this site but of no luck. Below is the stack trace.

INFO 2017-01-06 01:15:01,226 [main] org.mule.munit.runner.MuleContextManager: Loading mule-app.properties ... INFO 2017-01-06 01:15:01,319 [main] org.mule.munit.runner.domain.MunitDomainContextBuilder: Loading mule-deploy.properties ... java.lang.RuntimeException: org.mule.api.config.ConfigurationException: mule-domain-config.xml (java.io.FileNotFoundException)

i already checked my pom configuration and i used an AnypointStudio.exe clean also.

CooperShelly
  • 103
  • 2
  • 6
  • 12

3 Answers3

0

Please add domain project dependency with test scope to your pom file like

<dependency>
    <groupId>domain project group id</groupId>
    <artifactId>domain project name</artifactId>
    <version>domain version</version>
    <scope>test</scope>
</dependency>

Hope this helps.

AnupamBhusari
  • 2,395
  • 2
  • 14
  • 22
0

Can you check if you are loading your mule domain config xml in your munit settings.

For instance...

<munit:config name="munit" doc:name="MUnit configuration"/>
<spring:beans>
    <spring:import resource="classpath:my-munit-test.xml"/>
    <spring:import resource="mule-domain-config.xml"/>
</spring:beans>
<munit:test name="tesad-test-suite-FlowTest"...

Check the spring:import lines

Also, as @anupambhusari said , please check that you are importing your domain config properly

mario martinez
  • 297
  • 2
  • 11
  • Hi there, just FYI adding the domain dependency should be enough. No need to import the file in the MUnit test suite – Dds Nov 15 '17 at 13:56
0

I am not sure if you found a solution of this problem, but I got this working by adding Mule domain project in build path, from Configure Build Path option.

Vicky
  • 871
  • 9
  • 16