DrugInfoServiceImpl implements DrugInfoService { @Override public List<DrugInfo> getDrugInfosByDrugName(String name) { List<Drug> drugs = Context.getConceptService().getDrugs(name); List<DrugInfo> drugInfos = new ArrayList<DrugInfo>(); for (int i = 0; i < drugs.size(); i++) { drugInfos.add(dao.getDrugInfoByDrug(drugs.get(i).getDrugId())); } return drugInfos; }  @Override void setDrugInfoDAO(DrugInfoDAO dao); @Override DrugInfo saveDrugInfo(DrugInfo drugInfo); @Override DrugInfo getDrugInfo(Integer id); @Override DrugInfo getDrugInfoByUuid(String uuid); @Override DrugInfo getDrugInfoByDrugUuid(String uuid); @Override List<DrugInfo> getDrugInfosByDrugName(String name); @Override List<DrugInfo> getAllDrugInfo(boolean includeVoided); @Override DrugInfo updateDrugInfo(DrugInfo drugInfo); @Override void deleteDrugInfo(DrugInfo drugInfo); @Override void onStartup(); @Override void onShutdown();  }
@Test public void testGetDrugInfosByNameShouldReturnDrugInfos() { String drugName = "nyquil"; List<DrugInfo> results = s.getDrugInfosByDrugName(drugName); String name = results.get(0).getName(); assertEquals("TestDrugInfo1", name); }