Class RunOnceRule

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

    public class RunOnceRule
    extends Object
    implements org.junit.rules.TestRule
    Allows wrapping a junit TestRule that will be run only once. Once means once per class RunOnceRule being loaded
    • Constructor Detail

      • RunOnceRule

        public RunOnceRule​(T rule)
        Constructor*
        Type Parameters:
        T - The class of the TestRule
        Parameters:
        rule - The rule to wrap and run once per classloader load
    • 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