HibernateDrugInventoryDAO implements DrugInventoryDAO { public DrugInventory updateDrugInventory(DrugInventory drugInventory) { sessionFactory.getCurrentSession().update(drugInventory); return drugInventory; }  void setSessionFactory(SessionFactory sessionFactory); DrugInventory saveDrugInventory(DrugInventory drugInventory); void deleteDrugInventory(DrugInventory drugInventory); DrugInventory getDrugInventoryByUuid(String uuid); List<DrugInventory> getAllDrugInventories(); List<DrugInventory> getAllDrugInventoriesByStatus(String status); DrugInventory updateDrugInventory(DrugInventory drugInventory); List<DrugInventory> getDrugInventoryByProvider(Integer providerId); @Override List<DrugInventory> getDrugInventoriesByLocation(Integer location); @Override List<DrugInventory> getDrugInventoriesByDrugPurchaseOrder(Integer drugPurchaseOrderId);  }
@Test public void testUpdateDrugInventory() { DrugInventory dInventory = dao.getDrugInventoryByUuid("68547121-1b70-465c-99ee-c9dfd95e7d36"); dInventory.setName("new test list"); dao.updateDrugInventory(dInventory); String name = dao.getDrugInventoryByUuid("68547121-1b70-465c-99ee-c9dfd95e7d36").getName(); assertEquals(name, "new test list"); }