/** * @see UserService#getAllRoles() */ @Test public void getAllRoles_shouldReturnAllRolesInTheSystem() { executeDataSet(XML_FILENAME); List<Role> roles = userService.getAllRoles(); Assert.assertEquals(7, roles.size()); }
Context.addProxyPrivilege(PrivilegeConstants.MANAGE_ROLES); Set<String> currentRoleNames = new HashSet<>(); for (Role role : Context.getUserService().getAllRoles()) { currentRoleNames.add(role.getRole().toUpperCase());
for (Role role : Context.getUserService().getAllRoles()) { String output = "<update tableName=\"role\"><column name=\"uuid\" value=\"" + role.getUuid() + "\"/><where> role = '" + role.getRole().replace("'", "\\'") + "'</where></update>";
/** * @see org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceControllerTest#getAllCount() */ @Override public long getAllCount() { return service.getAllRoles().size(); }
@Override protected NeedsPaging<Role> doGetAll(RequestContext context) throws ResponseException { return new NeedsPaging<Role>(Context.getUserService().getAllRoles(), context); }