DBMessageResourceDAOImpl extends JdbcDaoSupport implements
        DBMessageResourceDAO { @SuppressWarnings("unchecked") @Override public List<DBMessage> findDBMessages() { return dBMessageQuery.execute(); } protected  DBMessageResourceDAOImpl(); void setTableName(String tableName); void setCodeColumn(String codeColumn); void setLanguageColumn(String languageColumn); void setCountryColumn(String countryColumn); void setVariantColumn(String variantColumn); void setMessageColumn(String messageColumn); void setFindMessageSql(String findMessageSql); @SuppressWarnings("unchecked") @Override List<DBMessage> findDBMessages();  }
@Test public void testFindDBMessages01() throws Exception { DataSource ds = mock(DataSource.class); DBMessageResourceDAOImpl_DBMessageQueryStub01 query = new DBMessageResourceDAOImpl_DBMessageQueryStub01(ds, "SELECT CODE,MESSAGE FROM MESSAGES", "CODE", "LANGUAGE", "COUNTRY", "VARIANT", "MESSAGE"); DBMessageResourceDAOImpl dbmr = new DBMessageResourceDAOImpl(); dbmr.dBMessageQuery = query; List<String> list = new ArrayList<String>(); list.add("success"); query.list = list; List<?> listReturn = dbmr.findDBMessages(); assertSame(list, listReturn); }