HibernateDrugInfoDAO implements DrugInfoDAO { @Override public DrugInfo getDrugInfoByUuid(String uuid) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugInfo.class); criteria.add(Restrictions.eq("uuid", uuid)); return (DrugInfo) criteria.uniqueResult(); }  void setSessionFactory(SessionFactory sessionFactory); @Override DrugInfo saveDrugInfo(DrugInfo drugInfo); @Override void deleteDrugInfo(DrugInfo drugInfo); @Override DrugInfo getDrugInfo(Integer drugInfoId); @Override DrugInfo getDrugInfoByUuid(String uuid); @Override List<DrugInfo> getDrugInfoByName(String name); @Override DrugInfo getDrugInfoByDrug(Integer id); @Override List<DrugInfo> getAllDrugInfo(boolean includeRetired); @Override DrugInfo updateDrugInfo(DrugInfo drugInfo);  }
@Test public void testGetDrugInfoByUuid() { String uuid = "68547121-1b70-465e-99ee-c9dfd95e7d30"; String result = dao.getDrugInfoByUuid(uuid).getName(); assertEquals("TestDrugInfo2", result); }