java - Resource files not found when running JUnit test -


I am having trouble running my trial test, it fails because this project is not capable of receiving resources is.

My test starts a server that loads all the necessary resources using a URLClassLoader Otherwise there is no problem with resources while running my project. This problem occurs only when I try to run my JUnit test.

I have tried to add file path as argument in my runtime configuration for this kind of test, example:

  -CP .: / path / To / the / config / file  

but it does not matter.

Please help!

Project structure: Enter image details here

The default maven test path is src / test / java , so if you test that If you are not in the directory, you must define the tag & lt; TestSourceDirectory & gt; inside & lt; Build & gt; Your test path in pom.xml with . You must also include the maven-surefire-plugin .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -