Cannot load ResourceBundle during junit test

I am trying to write some Junit tests to test old classes in our application. The code tries to load the ResourceBundle (for translations), but it crashes. I think the problem is with the classpath, but I can not understand.

The code is in / src and my tests are in / test. ResourceBundles are loaded with the base name relative to / src, say, "foo / bar / baz".

My tests use the same class path as the application itself, so I don’t understand why it will not find packages.

Any ideas on what's wrong?

+5
source share
2 answers

, . (bin, target/classes ..)? , .

+6

maven, src/main/resources/.

, . src/test/resources.

+5

All Articles