@Test public void testGetDrugInfoByUuidShouldUsePrivileges() { Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer")); Context.getUserContext().removeProxyPrivilege("View Drug Info"); String uuid = "68547121-1b70-465e-99ee-c9dfd95e7d30"; String result = null; try { result = s.getDrugInfoByUuid(uuid).getName(); fail("No privileges required for getDrugInfoByUuid"); } catch (APIAuthenticationException e) { Context.getUserContext().addProxyPrivilege("View Drug Info"); result = s.getDrugInfoByUuid(uuid).getName(); } }
@Override public DrugInfo getDrugInfoByUuid(String uuid) { return dao.getDrugInfoByUuid(uuid); }
DrugInfoServiceImpl implements DrugInfoService { @Override public DrugInfo getDrugInfoByUuid(String uuid) { return dao.getDrugInfoByUuid(uuid); } }
DrugInfoServiceImpl implements DrugInfoService { @Override public DrugInfo getDrugInfoByUuid(String uuid) { return dao.getDrugInfoByUuid(uuid); }  }
DrugInfoServiceImpl implements DrugInfoService { @Override public DrugInfo getDrugInfoByUuid(String uuid) { return dao.getDrugInfoByUuid(uuid); }  @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 getDrugInfoByUuid(String uuid) { return dao.getDrugInfoByUuid(uuid); }  @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();  }