Package com.adobe.cq.testing.junit.rules
Class TemporaryContentAuthorGroup
java.lang.Object
org.junit.rules.ExternalResource
com.adobe.cq.testing.junit.rules.TemporaryContentAuthorGroup
- All Implemented Interfaces:
org.junit.rules.TestRule
public class TemporaryContentAuthorGroup
extends org.junit.rules.ExternalResource
TemporaryContentAuthorGroup creates a content author group with write permission under /content
and deletes it at the end of the test.
Whether the delete is successful or not is not checked.
The create operation is retried until a timeout is reached.
The total wait time in the
before
method can be up to 30s.-
Constructor Summary
ConstructorDescriptionTemporaryContentAuthorGroup
(Supplier<org.apache.sling.testing.clients.SlingClient> creatorSupplier) Instantiate a new TemporaryContentAuthorGroup rule, to be used with the@Rule
annotation. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
after()
protected void
before()
protected String
createUniqueAuthorizableId
(String authorizableId) Create unique authorizable Id to make sure no side effects from versioning / restore occursprotected void
Delete the created group.Supplier
<org.apache.sling.testing.clients.SlingClient> Methods inherited from class org.junit.rules.ExternalResource
apply
-
Constructor Details
-
TemporaryContentAuthorGroup
public TemporaryContentAuthorGroup(Supplier<org.apache.sling.testing.clients.SlingClient> creatorSupplier) Instantiate a new TemporaryContentAuthorGroup rule, to be used with the@Rule
annotation.- Parameters:
creatorSupplier
- supplier for the client used to create the temporary content author group
-
-
Method Details
-
getClient
- Returns:
- the CQClient matching the temporary content author group
-
getGroupName
- Returns:
- the group name
-
getClientSupplier
- Returns:
- a
SlingClient
Supplier matching the temporary content author group
-
before
- Overrides:
before
in classorg.junit.rules.ExternalResource
- Throws:
Throwable
-
after
protected void after()- Overrides:
after
in classorg.junit.rules.ExternalResource
-
deleteGroup
protected void deleteGroup()Delete the created group. The delete operation is not retried and exceptions are ignored. -
createUniqueAuthorizableId
Create unique authorizable Id to make sure no side effects from versioning / restore occurs- Parameters:
authorizableId
- authorizable id- Returns:
- unique authorizableId
-