Class TogglesClient

java.lang.Object
org.apache.sling.testing.clients.AbstractSlingClient
org.apache.sling.testing.clients.SlingClient
com.adobe.cq.testing.client.CQClient
com.adobe.cq.testing.client.TogglesClient
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.http.client.HttpClient

public class TogglesClient extends CQClient
CQClient for performing operations related to feature toggles.
  • Constructor Details

    • TogglesClient

      public TogglesClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException
      Throws:
      org.apache.sling.testing.clients.ClientException
    • TogglesClient

      public TogglesClient(URI serverUrl, String user, String password) throws org.apache.sling.testing.clients.ClientException
      Throws:
      org.apache.sling.testing.clients.ClientException
  • Method Details

    • getEnabledToggles

      public List<String> getEnabledToggles() throws org.apache.sling.testing.clients.ClientException
      Retrieves a list of all the enabled toggles on the instance.
      Returns:
      the list of enabled toggles
      Throws:
      org.apache.sling.testing.clients.ClientException - if the toggles state cannot be retrieved
    • isToggleEnabled

      public boolean isToggleEnabled(String toggle) throws org.apache.sling.testing.clients.ClientException
      Checks whether a toggle is enabled or not.
      Parameters:
      toggle - the toggle to check
      Returns:
      true if the toggle is enabled
      Throws:
      org.apache.sling.testing.clients.ClientException - if the toggles state cannot be retrieved