Class SlingRule

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

    public class SlingRule
    extends Object
    implements org.junit.rules.TestRule
    Sling Rule that wraps all the Rules (at method level) useful when running a Sling Integration Test. Can be used in any junit test using the @Rule annotation It chains: TestTimeout, TestDescriptionRule, TestStickyCookieRule, FilterRule
    • Field Detail

      • testTimeoutRule

        public final TestTimeout testTimeoutRule
        Rule to define the max timeout for all the tests
      • testStickySessionRule

        public final TestStickyCookieRule testStickySessionRule
        Rule to add a Sticky Session Cookie for requests
      • filterRule

        public final FilterRule filterRule
        Rule to filter tests per method name
      • testDescriptionRule

        public final TestDescriptionRule testDescriptionRule
        Rule to send in every request a header with the test name
      • ruleChain

        protected org.junit.rules.RuleChain ruleChain
        Main RuleChain describing the order of execution of all the rules
    • Constructor Detail

      • SlingRule

        public SlingRule​(Instance... instances)
    • 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