public class Group extends AbstractAuthorizable
Modifier and Type | Field and Description |
---|---|
protected GroupProfile |
profile |
static String |
ROOT_PATH |
authorizableId, authorizablePath, client
ACTION_CREATE_GROUP, ACTION_CREATE_USER, AUTHORIZABLE_ID, IMPERSONATORS, IS_IMPERSONATED, MEMBER_OF, MEMBERS, PARAM_ADD_IMPERSONATORS, PARAM_ADD_MEMBERS, PARAM_AUTHORIZABLE_ID, PARAM_CREATE_GROUP, PARAM_CREATE_USER, PARAM_DELETE, PARAM_INTERMEDIATE_PATH, PARAM_PASSWORD, PARAM_REMOVE_IMPERSONATORS, PARAM_REMOVE_MEMBERS, PROFILE, SCHEMA_AUTHORIZABLE, SELECTOR, SELECTOR_USERPROPERTIES, TYPE, TYPE_GROUP, TYPE_USER, WILDCARD
Modifier and Type | Method and Description |
---|---|
org.apache.sling.testing.clients.SlingHttpResponse |
addMember(Authorizable authorizable,
int... expectedStatus)
Adds the group as member to another authorizable.
|
org.apache.sling.testing.clients.SlingHttpResponse |
addMembers(Authorizable[] authorizables,
int... expectedStatus)
Adds the group as member to other authorizables.
|
static <T extends SecurityClient> |
createGroup(T client,
String groupId,
String intermediatePath,
String givenName,
String aboutMe,
int... expectedStatus)
Creates a new group.
|
GroupProfile |
getGroupProfile()
Get user profile
|
String |
getRootPath()
Get root path of the authorizable (user/group) in repository
|
boolean |
hasGroupMember(Authorizable authorizable)
Check if authorizable is member of a given group
|
protected void |
initProfile() |
org.apache.sling.testing.clients.SlingHttpResponse |
removeMembers(Authorizable[] authorizables,
int... expectedStatus)
Remove the group as member from other authorizables
|
buildAuthorizableList, buildAuthorizablePath, create, delete, doGet, doPost, encodePathToURL, encodeURI, exists, getAuthorizableClass, getClient, getHomePath, getHomeUrl, getId, getImpersonators, getJsonAsString, getMemberOf, getMembers, getProfile, getUserPropertiesJsonAsString, isImpersonated
public static final String ROOT_PATH
protected GroupProfile profile
public Group(T client, String authorizableId) throws org.apache.sling.testing.clients.ClientException, InterruptedException
org.apache.sling.testing.clients.ClientException
InterruptedException
public String getRootPath()
Authorizable
public GroupProfile getGroupProfile() throws org.apache.sling.testing.clients.ClientException
GroupProfile
org.apache.sling.testing.clients.ClientException
- if the request failedprotected void initProfile() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public org.apache.sling.testing.clients.SlingHttpResponse addMembers(Authorizable[] authorizables, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
authorizables
- array of any Authorizable
expectedStatus
- array of allowed HTTP Status to be returned.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse addMember(Authorizable authorizable, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
authorizable
- any Authorizable
expectedStatus
- list of allowed HTTP Status to be returned.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic org.apache.sling.testing.clients.SlingHttpResponse removeMembers(Authorizable[] authorizables, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
authorizables
- list of any Authorizable
objectexpectedStatus
- list of allowed HTTP Status to be returned.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic boolean hasGroupMember(Authorizable authorizable) throws org.apache.sling.testing.clients.ClientException, InterruptedException
authorizable
- any Authorizable
objectorg.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public static <T extends SecurityClient> Group createGroup(T client, String groupId, String intermediatePath, String givenName, String aboutMe, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
T
- client typeclient
- any class implementing the SecurityClient
.groupId
- the group ID for the new group.intermediatePath
- the root path user will be created.givenName
- the name of the group.aboutMe
- description of the group.expectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 201 (CREATED) is assumed.Group
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"Copyright © 2018. All rights reserved.