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 thebefore
method 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@Rule
annotation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
deleteGroup()
Delete the created group.CQClient
getClient()
Supplier<org.apache.sling.testing.clients.SlingClient>
getClientSupplier()
String
getGroupName()
-
-
-
Constructor Detail
-
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 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
SlingClient
Supplier matching the temporary content author group
-
before
protected void before() throws Throwable
- 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.
-
-