@Test public void testGetDrugGroupShouldUsePrivileges() { Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer")); Context.getUserContext().removeProxyPrivilege("View Drug Groups"); Integer drugGroupId = 1; DrugGroup result = null; try { result = s.getDrugGroup(drugGroupId); fail("No privileges required for getDrugGroup"); } catch (APIAuthenticationException e) { Context.getUserContext().addProxyPrivilege("View Drug Groups"); result = s.getDrugGroup(drugGroupId); } }
@Override public DrugGroup getDrugGroup(Integer id) { return dao.getDrugGroup(id); }
DrugGroupServiceImpl implements DrugGroupService { @Override public DrugGroup getDrugGroup(Integer id) { return dao.getDrugGroup(id); } }
DrugGroupServiceImpl implements DrugGroupService { @Override public DrugGroup getDrugGroup(Integer id) { return dao.getDrugGroup(id); }  }
DrugGroupServiceImpl implements DrugGroupService { @Override public DrugGroup getDrugGroup(Integer id) { return dao.getDrugGroup(id); }  @Override void setDrugGroupDAO(DrugGroupDAO dao); @Override DrugGroup saveDrugGroup(DrugGroup drugGroup); @Override DrugGroup getDrugGroup(Integer id); @Override List<DrugGroup> getDrugGroupByName(String name); @Override DrugGroup getDrugGroupByUuid(String uuid); @Override List<DrugGroup> getAllDrugGroup(boolean includeRetired); @Override DrugGroup updateDrugGroup(DrugGroup drugGroup); @Override void deleteDrugGroup(DrugGroup drugGroup); @Override void onStartup(); @Override void onShutdown(); }
DrugGroupServiceImpl implements DrugGroupService { @Override public DrugGroup getDrugGroup(Integer id) { return dao.getDrugGroup(id); }  @Override void setDrugGroupDAO(DrugGroupDAO dao); @Override DrugGroup saveDrugGroup(DrugGroup drugGroup); @Override DrugGroup getDrugGroup(Integer id); @Override List<DrugGroup> getDrugGroupByName(String name); @Override DrugGroup getDrugGroupByUuid(String uuid); @Override List<DrugGroup> getAllDrugGroup(boolean includeRetired); @Override DrugGroup updateDrugGroup(DrugGroup drugGroup); @Override void deleteDrugGroup(DrugGroup drugGroup); @Override void onStartup(); @Override void onShutdown();  }