Class SingletonRule

java.lang.Object
dev.enola.common.context.testlib.SingletonRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class SingletonRule extends Object implements org.junit.rules.TestRule
JUnit @ClassRule (or even just @Rule) for Singleton.
  • Method Details

    • $

      public static SingletonRule $(Singleton<?>... singletons)
      Intended to be statically imported into *Test classes.
    • onlyReset

      public static SingletonRule onlyReset(Singleton<?>... singletons)
    • 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
    • doNotReset

      public void doNotReset()