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
ConstructorsConstructorDescriptionTemporaryContentAuthorGroup(Supplier<org.apache.sling.testing.clients.SlingClient> creatorSupplier) Instantiate a new TemporaryContentAuthorGroup rule, to be used with the@Ruleannotation. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()protected voidbefore()protected StringcreateUniqueAuthorizableId(String authorizableId) Create unique authorizable Id to make sure no side effects from versioning / restore occursprotected voidDelete 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@Ruleannotation.- 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
SlingClientSupplier matching the temporary content author group
-
before
- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
protected void after()- Overrides:
afterin 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
-