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.ExternalResourceTemporaryContentAuthorGroup 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 thebeforemethod can be up to 30s.
-
-
Constructor Summary
Constructors Constructor Description TemporaryContentAuthorGroup(Supplier<org.apache.sling.testing.clients.SlingClient> creatorSupplier)Instantiate a new TemporaryContentAuthorGroup rule, to be used with the@Ruleannotation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafter()protected voidbefore()protected StringcreateUniqueAuthorizableId(String authorizableId)Create unique authorizable Id to make sure no side effects from versioning / restore occursprotected voiddeleteGroup()Delete the created group.CQClientgetClient()Supplier<org.apache.sling.testing.clients.SlingClient>getClientSupplier()StringgetGroupName()
-
-
-
Constructor Detail
-
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 Detail
-
getClient
public CQClient getClient()
- Returns:
- the CQClient matching the temporary content author group
-
getGroupName
public String getGroupName()
- Returns:
- the group name
-
getClientSupplier
public Supplier<org.apache.sling.testing.clients.SlingClient> getClientSupplier()
- Returns:
- a
SlingClientSupplier matching the temporary content author group
-
before
protected void before() throws Throwable- 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.
-
-