@Test public void testGetDrugInfoShouldUsePrivileges() { Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer")); Context.getUserContext().removeProxyPrivilege("View Drug Info"); Integer drugInfoId = 1; DrugInfo result = null; try { result = s.getDrugInfo(drugInfoId); fail("No privileges required for getDrugInfo"); } catch (APIAuthenticationException e) { Context.getUserContext().addProxyPrivilege("View Drug Info"); result = s.getDrugInfo(drugInfoId); } }
@Override public DrugInfo getDrugInfo(Integer id) { return dao.getDrugInfo(id); }
DrugInfoServiceImpl implements DrugInfoService { @Override public DrugInfo getDrugInfo(Integer id) { return dao.getDrugInfo(id); } }
DrugInfoServiceImpl implements DrugInfoService { @Override public DrugInfo getDrugInfo(Integer id) { return dao.getDrugInfo(id); }  }
DrugInfoServiceImpl implements DrugInfoService { @Override public DrugInfo getDrugInfo(Integer id) { return dao.getDrugInfo(id); }  @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 DrugInfo getDrugInfo(Integer id) { return dao.getDrugInfo(id); }  @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();  }