HibernateDrugInventoryDAO implements DrugInventoryDAO { public void deleteDrugInventory(DrugInventory drugInventory) throws DAOException { sessionFactory.getCurrentSession().delete(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 testDeleteDrugInventory() { DrugInventory dInventory = new DrugInventory(); dInventory.setName("TestList6"); dInventory.setDescription("Third Test List"); dInventory.setCreator(Context.getUserContext().getAuthenticatedUser()); dInventory.setDateCreated(new java.util.Date()); dInventory.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d34"); dInventory.setDateCreated(new java.util.Date()); dInventory.setRetired(Boolean.FALSE); dInventory.setBatch("batch 1"); dInventory.setQuantity(10); dInventory.setStatus("true"); dInventory.setExpiryDate(new Date(2012 - 1 - 1)); dInventory.setValue(20); dInventory.setProviderId(2); dInventory.setLocationId(1); dInventory.setDrugPurchaseOrderId(14); dInventory.setOriginalQuantity(20); dao.deleteDrugInventory(dInventory); DrugInventory result = dao.getDrugInventoryByUuid("68547121-1b70-465c-99ee-c9dfd95e7d34"); assertEquals(result, null); }