DataSourceMessageSource extends AbstractMessageSource implements
        InitializingBean { protected Properties getMessages(Locale locale) { Properties messages = cachedMergedProperties.get(locale); if (messages == null) { messages = new Properties(); cachedMergedProperties.put(locale, messages); } return messages; }  void setDefaultLocale(Locale defaultLocale); synchronized void setDbMessageResourceDAO(
            DBMessageResourceDAO dbMessageResourceDAO); @Override void afterPropertiesSet(); synchronized void reloadDataSourceMessage();  }
@Test public void testGetMessages01() throws Exception { DataSourceMessageSource ds = new DataSourceMessageSource(); Locale locale = new Locale("ja", "JP", ""); Properties props = new Properties(); ds.cachedMergedProperties.put(locale, props); Properties returnProp = ds.getMessages(locale); assertSame(props, returnProp); }
@Test public void testGetMessages02() throws Exception { DataSourceMessageSource ds = new DataSourceMessageSource(); Locale locale = new Locale("ja", "JP", ""); ds.cachedMergedProperties.clear(); Properties returnProps = ds.getMessages(locale); assertEquals(1, ds.cachedMergedProperties.size()); Properties result = null; result = ds.cachedMergedProperties.get(locale); assertSame(returnProps, result); }