Class SecurityAssert
- java.lang.Object
-
- com.adobe.cq.testing.junit.assertion.SecurityAssert
-
public class SecurityAssert extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
REP_POLICY
-
Constructor Summary
Constructors Constructor Description SecurityAssert()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends SecurityClient>
voidassertACE(T client, String userPath)
Assert permissions / rep:policy node exist and has at minimum one allow or deny nodestatic void
assertACENode(String userPath, com.fasterxml.jackson.databind.JsonNode aceNode)
Assert ACE node has correct resource type and structurestatic <T extends Authorizable>
voidassertIsMemberOf(Group authorizableMemberOf, T authorizableMember)
Assert authorizableMember is member of authorizableMemberOfstatic <T extends Authorizable>
voidassertIsNotMember(Group authorizableMemberOf, T authorizableMember)
Assert authorizableMemberOf is NOT member of authorizableMemberstatic <T extends Authorizable>
voidassertIsNotMemberOf(Group authorizableMemberOf, T authorizableMember)
Assert authorizableMember is NOT member of authorizableMemberOfstatic <T extends SecurityClient>
voidassertProfile(T client, String authorizablePath, HashMap<String,String> expectedProps)
Assert profile information is correctly setstatic <T extends SecurityClient>
voidassertValidGroup(T client, String groupPath)
Assert group is a valid groupstatic <T extends SecurityClient>
voidassertValidUser(T client, String userPath)
Assert user is a valid user
-
-
-
Field Detail
-
REP_POLICY
public static final String REP_POLICY
- See Also:
- Constant Field Values
-
-
Method Detail
-
assertIsMemberOf
public static <T extends Authorizable> void assertIsMemberOf(Group authorizableMemberOf, T authorizableMember) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Assert authorizableMember is member of authorizableMemberOf- Type Parameters:
T
- a class that extends Authorizable- Parameters:
authorizableMemberOf
- anyGroup
that has the memberEntryauthorizableMember
- authorizable that is member of the other authorizable- Throws:
org.apache.sling.testing.clients.ClientException
- if the membership cannot be retrievedInterruptedException
- to mark this operation as "waiting"
-
assertIsNotMember
public static <T extends Authorizable> void assertIsNotMember(Group authorizableMemberOf, T authorizableMember) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Assert authorizableMemberOf is NOT member of authorizableMember- Type Parameters:
T
- a class that extends Authorizable- Parameters:
authorizableMemberOf
- anyGroup
that has the memberEntryauthorizableMember
- authorizable that is member of the other authorizable- Throws:
org.apache.sling.testing.clients.ClientException
- if the membership cannot be retrievedInterruptedException
- to mark this operation as "waiting"
-
assertIsNotMemberOf
public static <T extends Authorizable> void assertIsNotMemberOf(Group authorizableMemberOf, T authorizableMember) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Assert authorizableMember is NOT member of authorizableMemberOf- Type Parameters:
T
- Authorizable class- Parameters:
authorizableMemberOf
- anyGroup
that has the memberEntryauthorizableMember
- authorizable that is member of the other authorizable- Throws:
org.apache.sling.testing.clients.ClientException
- if the membership cannot be retrievedInterruptedException
- to mark this operation as "waiting"
-
assertValidUser
public static <T extends SecurityClient> void assertValidUser(T client, String userPath) throws org.apache.sling.testing.clients.ClientException
Assert user is a valid user- Type Parameters:
T
- client type CQXSSUtils- Parameters:
client
-SecurityClient
userPath
- the path to the user, starting from root, encoded- Throws:
org.apache.sling.testing.clients.ClientException
- if something fails during request/response cycle
-
assertACE
public static <T extends SecurityClient> void assertACE(T client, String userPath) throws org.apache.sling.testing.clients.ClientException
Assert permissions / rep:policy node exist and has at minimum one allow or deny node- Type Parameters:
T
- client type- Parameters:
client
-SecurityClient
userPath
- the path to the user, starting from root- Throws:
org.apache.sling.testing.clients.ClientException
- if something fails during request/response cycle
-
assertACENode
public static void assertACENode(String userPath, com.fasterxml.jackson.databind.JsonNode aceNode)
Assert ACE node has correct resource type and structure- Parameters:
userPath
- user pathaceNode
- ace node
-
assertValidGroup
public static <T extends SecurityClient> void assertValidGroup(T client, String groupPath) throws org.apache.sling.testing.clients.ClientException
Assert group is a valid group- Type Parameters:
T
- client type- Parameters:
client
-SecurityClient
groupPath
- the path to group starting from root- Throws:
org.apache.sling.testing.clients.ClientException
- if something fails during request/response cycle
-
assertProfile
public static <T extends SecurityClient> void assertProfile(T client, String authorizablePath, HashMap<String,String> expectedProps) throws org.apache.sling.testing.clients.ClientException
Assert profile information is correctly set- Type Parameters:
T
- client type- Parameters:
client
-SecurityClient
authorizablePath
- the path to the user, starting from rootexpectedProps
- properties as map: key = propertyName, value = expected value- Throws:
org.apache.sling.testing.clients.ClientException
- if something fails during request/response cycle
-
-