Test configuration for loading messages.proeprties
is
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="classpath:i18n/messages,classpath:i18n/application" p:fallbackToSystemLocale="false"/>
If I run a single test on Intellij (Junit test runner), it won't be able to load messages.properties
from src/main/webapp/WEB-INF/i18n/messages.properties
.
Running the same test from console (mvn -Dtest=blablatest test
) works.
In order to make it work on Intellij, I have to copy the messages.properties
to src/test/resources/i18n/messages.properties
.
Update1: "Running the same test from console (mvn -Dtest=blablatest test
) works."
Works only if the project is built first.