DataSourceMessageSource extends AbstractMessageSource implements
        InitializingBean { @Override protected synchronized String resolveCodeWithoutArguments( String code, Locale locale) { String msg = internalResolveCodeWithoutArguments(code, locale); if (msg == null) { if (log.isDebugEnabled()) { log.debug("could not resolve [" + code + "] for locale [" + locale + "]"); } } return msg; }  void setDefaultLocale(Locale defaultLocale); synchronized void setDbMessageResourceDAO(
            DBMessageResourceDAO dbMessageResourceDAO); @Override void afterPropertiesSet(); synchronized void reloadDataSourceMessage();  }
@Test public void testResolveCodeWithoutArguments01() throws Exception { DataSourceMessageSource_DataSourceMessageSourceStub04 ds = new DataSourceMessageSource_DataSourceMessageSourceStub04(); String code = "code01"; Locale locale = new Locale("ja", "JP", ""); String msg = "テストメッセージ０１"; ds.msg = msg; String returnMsg = ds.resolveCodeWithoutArguments(code, locale); assertEquals(code, ds.code); assertSame(locale, ds.locale); assertTrue(ds.isRead); assertEquals(msg, returnMsg); }
@Test public void testResolveCodeWithoutArguments02() throws Exception { DataSourceMessageSource_DataSourceMessageSourceStub04 ds = new DataSourceMessageSource_DataSourceMessageSourceStub04(); String code = "code01"; Locale locale = new Locale("ja", "JP", ""); String returnMsg = ds.resolveCodeWithoutArguments(code, locale); assertEquals(code, ds.code); assertSame(locale, ds.locale); assertTrue(ds.isRead); assertNull(returnMsg); }