Can't load ResourceBundle during junit test

。_饼干妹妹 提交于 2019-12-05 09:35:29

Resources are not resolved from the source folder but from the class directory. Are your resource files copied to the output folder (bin, target/classes etc.) ? If not, your classes can't find them.

Morten

If you are using maven, you typically want to put all kind of properties files and resource bundles in a separate source folder called src/main/resources/.

If you want to override values in your unit tests then you can add a duplicate prop. file in the src/test/resources source folder.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!