Class Group
java.lang.Object
com.adobe.cq.testing.client.security.AbstractAuthorizable
com.adobe.cq.testing.client.security.Group
- All Implemented Interfaces:
Authorizable
Object which handles group actions
-
Field Summary
Fields inherited from class com.adobe.cq.testing.client.security.AbstractAuthorizable
authorizableId, authorizablePath, client
Fields inherited from interface com.adobe.cq.testing.client.security.Authorizable
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.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>
GroupcreateGroup
(T client, String groupId, String intermediatePath, String givenName, String aboutMe, int... expectedStatus) Creates a new group.Get user profileGet root path of the authorizable (user/group) in repositoryboolean
hasGroupMember
(Authorizable authorizable) Check if authorizable is member of a given groupprotected void
org.apache.sling.testing.clients.SlingHttpResponse
removeMembers
(Authorizable[] authorizables, int... expectedStatus) Remove the group as member from other authorizablesMethods inherited from class com.adobe.cq.testing.client.security.AbstractAuthorizable
buildAuthorizableList, buildAuthorizablePath, create, delete, doGet, doPost, encodePathToURL, encodeURI, exists, exists, exists, getAuthorizableClass, getClient, getHomePath, getHomeUrl, getId, getImpersonators, getJsonAsString, getMemberOf, getMembers, getProfile, getQuery, getUserPropertiesJsonAsString, isImpersonated
-
Field Details
-
ROOT_PATH
- See Also:
-
profile
-
-
Constructor Details
-
Group
public Group(T client, String authorizableId) throws org.apache.sling.testing.clients.ClientException, InterruptedException - Throws:
org.apache.sling.testing.clients.ClientException
InterruptedException
-
-
Method Details
-
getRootPath
Description copied from interface:Authorizable
Get root path of the authorizable (user/group) in repository- Returns:
- root path
-
getGroupProfile
Get user profile- Returns:
GroupProfile
- Throws:
org.apache.sling.testing.clients.ClientException
- if the request failed
-
initProfile
protected void initProfile() throws org.apache.sling.testing.clients.ClientException- Throws:
org.apache.sling.testing.clients.ClientException
-
addMembers
public org.apache.sling.testing.clients.SlingHttpResponse addMembers(Authorizable[] authorizables, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Adds the group as member to other authorizables.- Parameters:
authorizables
- array of anyAuthorizable
expectedStatus
- array of allowed HTTP Status to be returned.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
addMember
public org.apache.sling.testing.clients.SlingHttpResponse addMember(Authorizable authorizable, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Adds the group as member to another authorizable.- Parameters:
authorizable
- anyAuthorizable
expectedStatus
- list of allowed HTTP Status to be returned.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
removeMembers
public org.apache.sling.testing.clients.SlingHttpResponse removeMembers(Authorizable[] authorizables, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Remove the group as member from other authorizables- Parameters:
authorizables
- list of anyAuthorizable
objectexpectedStatus
- list of allowed HTTP Status to be returned.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
hasGroupMember
public boolean hasGroupMember(Authorizable authorizable) throws org.apache.sling.testing.clients.ClientException, InterruptedException Check if authorizable is member of a given group- Parameters:
authorizable
- anyAuthorizable
object- Returns:
- true if authorizable is member of a given group
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"
-
createGroup
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 Creates a new group.- Type Parameters:
T
- client type- Parameters:
client
- any class implementing theSecurityClient
.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.- Returns:
Group
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"
-