title: spring messagesource while testing
body: <p>i have message source defined in my java config as :</p>
  
  <pre><code>@Bean(name = "messageSource")
  public MessageSource messageSource() {
      ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
      messageSource.setBasenames(
              "/i18n/ir/kia/industry/webapp/entity",
              "/i18n/ir/kia/industry/webapp/formErrors",
              "/i18n/ir/kia/industry/webapp/frontend",
              "/i18n/ir/kia/industry/webapp/frontendPages");
      return messageSource;
  }
  </code></pre>
  
  <p>it works fine when using site and messages are displayed correctly, but when trying to write spring test with :</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(classes = {TestContext.class, SpringMVC.class})
  @WebAppConfiguration
  public abstract class AbstractTestClass {
    protected MockMvc mockMvc;
    @Autowired
    private WebApplicationContext webApplicationContext;
  
    @Before
    public void setUp() throws Exception {
      mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
    }
  }
  </code></pre>
  
  <p>and a test class that simply extends it, i get error <code>Can't find bundle for base name /i18n/ir/kia/industry/webapp/entity</code>.</p>
  
  <p>it works fine when starting tomcat and using message source in jsp files, but no luck when testing it. i have tried moving i18n folder under WEB-INF but it did not help it neither.</p>
  
  <p>the target folder looks like this  and please do not tell me add i18n folder to target resources ...</p>
  
  <p><img src="https://i.stack.imgur.com/CHJLN.jpg" alt="enter image description here"></p>