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 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

      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 class org.junit.rules.ExternalResource
      Throws:
      Throwable
    • after

      protected void after()
      Overrides:
      after in class org.junit.rules.ExternalResource
    • deleteGroup

      protected void deleteGroup()
      Delete the created group. The delete operation is not retried and exceptions are ignored.
    • createUniqueAuthorizableId

      protected String createUniqueAuthorizableId(String authorizableId)
      Create unique authorizable Id to make sure no side effects from versioning / restore occurs
      Parameters:
      authorizableId - authorizable id
      Returns:
      unique authorizableId