Class TogglesAwareTestRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class TogglesAwareTestRule
    extends Object
    implements org.junit.rules.TestRule
    Junit rule for filtering tests based on the toggles enabled on the remote instance.

    The rule is used in combination with the annotations RunIfToggleEnabled and SkipIfToggleEnabled. If both annotations are applied to a test, both conditions must be met (AND operation).
    See Also:
    RunIfToggleEnabled, SkipIfToggleEnabled
    • Constructor Detail

      • TogglesAwareTestRule

        public TogglesAwareTestRule​(Supplier<org.apache.sling.testing.clients.SlingClient> clientSupplier)
    • Method Detail

      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule
      • shouldRunTest

        protected boolean shouldRunTest​(org.junit.runner.Description description)