public class SecurityAssert extends Object
Modifier and Type | Field and Description |
---|---|
static String |
REP_POLICY |
Constructor and Description |
---|
SecurityAssert() |
Modifier and Type | Method and Description |
---|---|
static <T extends SecurityClient> |
assertACE(T client,
String userPath)
Assert permissions / rep:policy node exist and has at minimum one allow or deny node
|
static void |
assertACENode(String userPath,
org.codehaus.jackson.JsonNode aceNode)
Assert ACE node has correct resource type and structure
|
static <T extends Authorizable> |
assertIsMemberOf(Group authorizableMemberOf,
T authorizableMember)
Assert authorizableMember is member of authorizableMemberOf
|
static <T extends Authorizable> |
assertIsNotMember(Group authorizableMemberOf,
T authorizableMember)
Assert authorizableMemberOf is NOT member of authorizableMember
|
static <T extends Authorizable> |
assertIsNotMemberOf(Group authorizableMemberOf,
T authorizableMember)
Assert authorizableMember is NOT member of authorizableMemberOf
|
static <T extends SecurityClient> |
assertProfile(T client,
String authorizablePath,
HashMap<String,String> expectedProps)
Assert profile information is correctly set
|
static <T extends SecurityClient> |
assertValidGroup(T client,
String groupPath)
Assert group is a valid group
|
static <T extends SecurityClient> |
assertValidUser(T client,
String userPath)
Assert user is a valid user
|
public static final String REP_POLICY
public static <T extends Authorizable> void assertIsMemberOf(Group authorizableMemberOf, T authorizableMember) throws org.apache.sling.testing.clients.ClientException, InterruptedException
T
- a class that extends AuthorizableauthorizableMemberOf
- any Group
that has the memberEntryauthorizableMember
- authorizable that is member of the other authorizableorg.apache.sling.testing.clients.ClientException
- if the membership cannot be retrievedInterruptedException
- to mark this operation as "waiting"public static <T extends Authorizable> void assertIsNotMember(Group authorizableMemberOf, T authorizableMember) throws org.apache.sling.testing.clients.ClientException, InterruptedException
T
- a class that extends AuthorizableauthorizableMemberOf
- any Group
that has the memberEntryauthorizableMember
- authorizable that is member of the other authorizableorg.apache.sling.testing.clients.ClientException
- if the membership cannot be retrievedInterruptedException
- to mark this operation as "waiting"public static <T extends Authorizable> void assertIsNotMemberOf(Group authorizableMemberOf, T authorizableMember) throws org.apache.sling.testing.clients.ClientException, InterruptedException
T
- Authorizable classauthorizableMemberOf
- any Group
that has the memberEntryauthorizableMember
- authorizable that is member of the other authorizableorg.apache.sling.testing.clients.ClientException
- if the membership cannot be retrievedInterruptedException
- to mark this operation as "waiting"public static <T extends SecurityClient> void assertValidUser(T client, String userPath) throws org.apache.sling.testing.clients.ClientException
T
- client type
CQXSSUtilsclient
- SecurityClient
userPath
- the path to the user, starting from root, encodedorg.apache.sling.testing.clients.ClientException
- if something fails during request/response cyclepublic static <T extends SecurityClient> void assertACE(T client, String userPath) throws org.apache.sling.testing.clients.ClientException
T
- client typeclient
- SecurityClient
userPath
- the path to the user, starting from rootorg.apache.sling.testing.clients.ClientException
- if something fails during request/response cyclepublic static void assertACENode(String userPath, org.codehaus.jackson.JsonNode aceNode)
userPath
- user pathaceNode
- ace nodepublic static <T extends SecurityClient> void assertValidGroup(T client, String groupPath) throws org.apache.sling.testing.clients.ClientException
T
- client typeclient
- SecurityClient
groupPath
- the path to group starting from rootorg.apache.sling.testing.clients.ClientException
- if something fails during request/response cyclepublic static <T extends SecurityClient> void assertProfile(T client, String authorizablePath, HashMap<String,String> expectedProps) throws org.apache.sling.testing.clients.ClientException
T
- client typeclient
- SecurityClient
authorizablePath
- the path to the user, starting from rootexpectedProps
- properties as map: key = propertyName, value = expected valueorg.apache.sling.testing.clients.ClientException
- if something fails during request/response cycleCopyright © 2018. All rights reserved.