Class Group
- java.lang.Object
-
- com.adobe.cq.testing.client.security.AbstractAuthorizable
-
- com.adobe.cq.testing.client.security.Group
-
- All Implemented Interfaces:
Authorizable
public class Group extends AbstractAuthorizable
Object which handles group actions
-
-
Field Summary
Fields Modifier and Type Field Description protected GroupProfileprofilestatic StringROOT_PATH-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.sling.testing.clients.SlingHttpResponseaddMember(Authorizable authorizable, int... expectedStatus)Adds the group as member to another authorizable.org.apache.sling.testing.clients.SlingHttpResponseaddMembers(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.GroupProfilegetGroupProfile()Get user profileStringgetRootPath()Get root path of the authorizable (user/group) in repositorybooleanhasGroupMember(Authorizable authorizable)Check if authorizable is member of a given groupprotected voidinitProfile()org.apache.sling.testing.clients.SlingHttpResponseremoveMembers(Authorizable[] authorizables, int... expectedStatus)Remove the group as member from other authorizables-
Methods 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 Detail
-
ROOT_PATH
public static final String ROOT_PATH
- See Also:
- Constant Field Values
-
profile
protected GroupProfile profile
-
-
Constructor Detail
-
Group
public Group(T client, String authorizableId) throws org.apache.sling.testing.clients.ClientException, InterruptedException- Throws:
org.apache.sling.testing.clients.ClientExceptionInterruptedException
-
-
Method Detail
-
getRootPath
public String getRootPath()
Description copied from interface:AuthorizableGet root path of the authorizable (user/group) in repository- Returns:
- root path
-
getGroupProfile
public GroupProfile getGroupProfile() throws org.apache.sling.testing.clients.ClientException
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 anyAuthorizableexpectedStatus- 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- anyAuthorizableexpectedStatus- 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 anyAuthorizableobjectexpectedStatus- 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- anyAuthorizableobject- 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"
-
-