AsyncMsgRecordDao { public void delete(AsyncMsgRecord asyncMsgRecord) { LOG.debug("Performing a database record delete on asyncmsgrepo table"); Session sess = null; Transaction trans = null; try { sess = getSession(); if (sess != null) { trans = sess.beginTransaction(); sess.delete(asyncMsgRecord); } else { LOG.error("Failed to obtain a session from the sessionFactory"); } } finally { if (trans != null) { try { trans.commit(); } catch (HibernateException he) { LOG.error("Failed to commit transaction: {}", he.getLocalizedMessage(), he); } } if (sess != null) { try { sess.close(); } catch (HibernateException he) { LOG.error("Failed to close session: {}", he.getLocalizedMessage(), he); } } } LOG.debug("Completed database record delete"); } AsyncMsgRecordDao();  AsyncMsgRecordDao(PropertyAccessor accessor); List<AsyncMsgRecord> queryByMessageIdAndDirection(String messageId, String direction); List<AsyncMsgRecord> queryByMessageIdAndServiceName(String messageId, String serviceName); List<AsyncMsgRecord> queryByTime(Date timestamp); List<AsyncMsgRecord> queryForExpired(Date timestamp); List<AsyncMsgRecord> queryForDeferredQueueProcessing(); List<AsyncMsgRecord> queryForDeferredQueueSelected(); List<AsyncMsgRecord> queryByCriteria(QueryDeferredQueueRequestType queryCriteria); boolean insertRecords(List<AsyncMsgRecord> asyncMsgRecs); void save(AsyncMsgRecord asyncMsgRecord); void save(List<AsyncMsgRecord> asyncMsgRecs); void delete(AsyncMsgRecord asyncMsgRecord); void checkExpiration(); static final String QUEUE_DIRECTION_INBOUND; static final String QUEUE_DIRECTION_OUTBOUND; static final String QUEUE_RESPONSE_TYPE_AUTO; static final String QUEUE_RESPONSE_TYPE_EXTERNAL; static final String QUEUE_STATUS_EXPIRED; static final String QUEUE_STATUS_REQPROCESS; static final String QUEUE_STATUS_REQRCVD; static final String QUEUE_STATUS_REQRCVDACK; static final String QUEUE_STATUS_REQRCVDERR; static final String QUEUE_STATUS_REQSENT; static final String QUEUE_STATUS_REQSENTACK; static final String QUEUE_STATUS_REQSENTERR; static final String QUEUE_STATUS_RSPSELECT; static final String QUEUE_STATUS_RSPPROCESS; static final String QUEUE_STATUS_RSPRCVD; static final String QUEUE_STATUS_RSPRCVDACK; static final String QUEUE_STATUS_RSPRCVDERR; static final String QUEUE_STATUS_RSPSENT; static final String QUEUE_STATUS_RSPSENTACK; static final String QUEUE_STATUS_RSPSENTERR; }
@Test public void testDelete() { System.out.println("delete"); AsyncMsgRecord asyncMsgRecord = new AsyncMsgRecord(); asyncMsgRecordDao.delete(asyncMsgRecord); verify(session).delete(asyncMsgRecord); }