SmsContentDAO extends BaseIbatisDAO { public SmsContent getByPrimaryKey(final Serializable id) { Object o = super.queryForObject("SMS_CONTENT.selectByPrimaryKey", id); if (null == o) { return null; } else { return (SmsContent) o; } }  SmsContent save(final SmsContent sms); @SuppressWarnings("unchecked") List<SmsContent> query(final Map<String, Object> parameters); void deleteByPrimaryKey(final Serializable id); void delete(final Map<String, Object> parameters); void updateFailureCount(final Serializable id); SmsContent getByPrimaryKey(final Serializable id); void retrySend(final Serializable serialId); static int getRule(); static void setRule(int rule); @SuppressWarnings("unchecked") List<SmsContent> queryByParam(Map<String, Object> param); void reSendSmsByMap(Map<Object, Object> extendParam); int update(SmsContent smsContent); void insert(SmsContent smsContent);  }
@Test public void testGetByPrimaryKey() throws Exception { SmsContent smsContent = new SmsContent("Test Sms", "13917677725"); smsContentDAO.save(smsContent); SmsContent content = smsContentDAO.getByPrimaryKey(smsContent.getId()); Assert.assertNotNull(content.getId()); Assert.assertEquals("Test Sms", content.getContent()); Assert.assertEquals("13917677725", content.getMobile()); Assert.assertEquals(5, content.getPriority().intValue()); Assert.assertNull(content.getType()); Assert.assertNotNull(content.getSendDate()); Assert.assertEquals(0, content.getFailure()); }