.getBean("org.raxa.module.raxacore.db.hibernate.HibernateDrugPurchaseOrderDAO");
}
@Test
public void testsaveDrugPurchaseOrder() {
DrugPurchaseOrder dpOrder = new DrugPurchaseOrder();
Provider provider = new Provider(1);
provider.setDateCreated(new Date());
Location location = new Location(1);
location.setDateCreated(new Date());
//NOTE: never set Id, will be generated automatically (when saving)
dpOrder.setName("TestList4");
dpOrder.setDescription("Third Test List");
dpOrder.setCreator(Context.getUserContext().getAuthenticatedUser());
dpOrder.setDateCreated(new java.util.Date());
dpOrder.setDrugPurchaseOrderDate(new Date());
dpOrder.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d30");
dpOrder.setRetired(Boolean.FALSE);
dpOrder.setProviderId(new Integer(3));
dpOrder.setDispenseLocationId(1);
dpOrder.setStockLocationId(2);
dpOrder.setProvider(provider);
dpOrder.setDispenseLocation(Context.getLocationService().getLocation(1));
dpOrder.setStockLocation(Context.getLocationService().getLocation(2));
dao.saveDrugPurchaseOrder(dpOrder);
DrugPurchaseOrder result = dao.getDrugPurchaseOrderByUuid("68547121-1b70-465c-99ee-c9dfd95e7d30");
String uuid = result.getUuid();
assertEquals(uuid, "68547121-1b70-465c-99ee-c9dfd95e7d30");
//assertEquals()
}