@Test public void testDeleteDrugInfoShouldUsePrivileges() { Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer")); Drug drug = new Drug(); drug.setId(3); DrugInfo drugInfo = new DrugInfo(); drugInfo.setDrug(drug); drugInfo.setId(2); drugInfo.setName("TestDrugInfo2"); drugInfo.setDescription("Second Test DrugInfo"); drugInfo.setCreator(Context.getUserContext().getAuthenticatedUser()); drugInfo.setDateCreated(new java.util.Date()); drugInfo.setUuid("68547121-1b70-465e-99ee-c9dfd95e7d30"); drugInfo.setRetired(Boolean.FALSE); try { s.deleteDrugInfo(drugInfo); fail("No privileges required for deleteDrugInfo"); } catch (APIAuthenticationException e) { Context.getUserContext().addProxyPrivilege("Delete Drug Info"); Context.getUserContext().addProxyPrivilege("View Drug Info"); s.deleteDrugInfo(drugInfo); } }
@Override public void deleteDrugInfo(DrugInfo drugInfo) { dao.deleteDrugInfo(drugInfo); }
DrugInfoServiceImpl implements DrugInfoService { @Override public void deleteDrugInfo(DrugInfo drugInfo) { dao.deleteDrugInfo(drugInfo); } }
DrugInfoServiceImpl implements DrugInfoService { @Override public void deleteDrugInfo(DrugInfo drugInfo) { dao.deleteDrugInfo(drugInfo); }  }
DrugInfoServiceImpl implements DrugInfoService { @Override public void deleteDrugInfo(DrugInfo drugInfo) { dao.deleteDrugInfo(drugInfo); }  @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(); }
DrugInfoServiceImpl implements DrugInfoService { @Override public void deleteDrugInfo(DrugInfo drugInfo) { dao.deleteDrugInfo(drugInfo); }  @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();  }